diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bcc73892..b925325c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,73 @@ +# v3.2.0-beta1 + +- Move beta to main repo +- Fix #1053 so that the right and left tabs display correctly in Joomla 4&5 + +# v3.1.42-beta + +- Fix #1055 to add the style and scripts to all views. + +# v3.1.40-beta + +- Fix #1052 so that tabs last opened is remembered and opened again on save, refresh or reopening of an item. +- Fix #1057 so that the datetime fields will be set correctly in mysql. + +# v3.1.39 + +- Fix #1051 making sure the list view is lowercase. + +# v3.1.38 + +- Fix #1046 so that the version restore function will work. + +# v3.1.37 + +- Fix #1041 so that custom tabs are build correctly. +- Fix #1043 so that delete function in Joomla 4 and 5 will work. +- Fix #1045 so that plug-in Structure::setMainXmlFile method will except an object. +- Fix #1042 so that it will remove line breaks and new lines from other languages as well. + +# v3.1.36 + +- Move the defined or die below use statements. +- Add the new router view + +# v3.1.35 + +- Improve the Joomla 4 Templates. +- Fix #1033 the response class issue for the gitea classes. +- Remove the JRegistry class to resolve #1036, #1035 + +# v3.1.34 + +- Fix the AjaxController contructor class. +- Improved the getModel calls from the AxajController class. + +# v3.1.33 + +- Fix #1026 by adding the correct layout to the filter views. +- Fix #1026 by adding the class to the filter views. +- Fix #1026 by adding a hint to the filters that are having multiple selection. +- Fix the directional bog where a field in the filters are also called direction. +- Fix the getModel helper method fot J4+. + +# v3.1.32 + +- Fix #1026 by removing chosen everywhere. +- Resolve #1028 by adding in line helper toggle integration to all admin views. +- Remove the import and export buttons until the area is fixed. +- Add emptystate list template to all admin list views. + +# v3.1.31 + +- Add joomla_version to custom code. +- Add Joomla 4 and 5 correct build files. + +# v3.1.30 + +- Add namspace prefix to both global, and component override level. +- Add Joomla 4 and 5 build option + # v3.1.28 - Updates PHPSecLib. @@ -23,7 +93,7 @@ - Adds option to add additional templates to a module. - Resolves #1002 by adding STRING instead of WORD. - Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof -- Changed all CSS and JS to use `JHtml::_(` instead of `$this->document->` in compiler code. +- Changed all CSS and JS to use `Html::_(` instead of `$this->document->` in compiler code. - Adds option to turn jQuery off if UIKIT 3 is added. - Adds option to auto write injection boilerplate code in Powers area. - Adds option to auto write service provider boilerplate code in the Powers area. diff --git a/README.md b/README.md index 1ec22857e..0b84a794a 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.28) 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.2.0-beta1) 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) @@ -144,14 +144,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*: 24th October, 2023 -+ *Version*: 3.1.28 ++ *Last Build*: 2nd March, 2024 ++ *Version*: 3.2.0-beta1 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **635155** -+ *Field count*: **2047** -+ *File count*: **4731** -+ *Folder count*: **436** ++ *Line count*: **694660** ++ *Field count*: **2077** ++ *File count*: **5121** ++ *Folder count*: **455** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) diff --git a/admin/README.txt b/admin/README.txt index 1ec22857e..0b84a794a 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.28) 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.2.0-beta1) 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) @@ -144,14 +144,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*: 24th October, 2023 -+ *Version*: 3.1.28 ++ *Last Build*: 2nd March, 2024 ++ *Version*: 3.2.0-beta1 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **635155** -+ *Field count*: **2047** -+ *File count*: **4731** -+ *Folder count*: **436** ++ *Line count*: **694660** ++ *Field count*: **2077** ++ *File count*: **5121** ++ *Folder count*: **455** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) diff --git a/admin/access.xml b/admin/access.xml index 37dfadbef..86cf7d64b 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -211,6 +211,16 @@ + + + + + + + + + + @@ -899,6 +909,17 @@ +
+ + + + + + + + + +
diff --git a/admin/assets/css/component_router.css b/admin/assets/css/component_router.css new file mode 100644 index 000000000..2731fc5aa --- /dev/null +++ b/admin/assets/css/component_router.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/assets/css/components_routers.css b/admin/assets/css/components_routers.css new file mode 100644 index 000000000..2731fc5aa --- /dev/null +++ b/admin/assets/css/components_routers.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/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 615e5f30f..3b92116c7 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -11,153 +11,153 @@ /* CSS Document */ .dashboard-container { - margin-left: 10px; - margin-top: 10px; - width: 100%; + margin-left: 10px; + margin-top: 10px; + width: 100%; } .dashboard-container [class*="span"] { - display: block; - float: none; - margin-left: 0; - width: auto; + display: block; + float: none; + margin-left: 0; + width: auto; } .dashboard-container:before, .dashboard-container:after { - content: ""; - display: table; + content: ""; + display: table; } .dashboard-container:after { - clear: both; + clear: both; } .dashboard-container [class*="span"] { - box-sizing: border-box; - display: block; - float: left; - min-height: 145px; - min-width: 96px; - width: 100%; + box-sizing: border-box; + display: block; + float: left; + min-height: 145px; + min-width: 96px; + width: 100%; } .dashboard-container [class*="span"]:first-child { - margin-left: 0; + margin-left: 0; } .dashboard-wraper { - background: none repeat scroll 0 0 hsl(0, 0%, 93%); - border-radius: 5px; - float: left; - margin: 1%; - padding: 3px; - width: 17%; - min-height: 194px; - min-width: 96px; + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 5px; + float: left; + margin: 1%; + padding: 3px; + width: 17%; + min-height: 194px; + min-width: 96px; } .dashboard-content a { - background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 85%); - border-radius: 4px; - box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; - color: hsl(0, 0%, 20%); - display: block; - min-height: 89px; - padding: 10px; - text-align: center; - text-decoration: none; + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + min-height: 89px; + padding: 10px; + text-align: center; + text-decoration: none; } .dashboard-content a:hover { - background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - color: hsl(200, 100%, 30%); - text-decoration: none; + background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + color: hsl(200, 100%, 30%); + text-decoration: none; } .dashboard-title { - display: block; - padding-top: 5px; + display: block; + padding-top: 5px; } .dashboard-info { - background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 85%); - border-radius: 4px; - box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; - color: hsl(0, 0%, 20%); - display: block; - font-size: 12px; - padding: 10px; - text-align: center; + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + font-size: 12px; + padding: 10px; + text-align: center; } .dashboard-info span { - display: block; - text-align: center; + display: block; + text-align: center; } .dashboard-info img { - margin: 0 auto; + margin: 0 auto; } .dashboard-table { - border-top: 1px solid hsl(0, 0%, 87%); - margin-top: 5px; - width: 100%; + border-top: 1px solid hsl(0, 0%, 87%); + margin-top: 5px; + width: 100%; } .dashboard-info h5 { - font-size: 11px; - font-weight: bold; + font-size: 11px; + font-weight: bold; } .dashboard-block { - background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 76%); - border-radius: 3px; - box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; - margin-bottom: 20px; + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 76%); + border-radius: 3px; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; + margin-bottom: 20px; } .dashboard-block .dashboard-block-head { - background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border-bottom: 1px solid hsl(0, 0%, 76%); - border-radius: 3px 3px 0 0; - box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); - height: 40px; - position: relative; + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border-bottom: 1px solid hsl(0, 0%, 76%); + border-radius: 3px 3px 0 0; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); + height: 40px; + position: relative; } .dashboard-block .dashboard-block-head h5 { - font-size: 12px; - margin: 0; - padding-left: 10px; - padding-top: 11px; - text-transform: uppercase; + font-size: 12px; + margin: 0; + padding-left: 10px; + padding-top: 11px; + text-transform: uppercase; } .dashboard-block .dashboard-block-content { - background: none repeat scroll 0 0 hsl(0, 0%, 93%); - border-radius: 0 0 3px 3px; + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 0 0 3px 3px; } .dashboard-block .dashboard-block-box { - background: none repeat scroll 0 0 hsl(0, 0%, 100%); - border-top: 1px solid hsl(0, 0%, 82%); - box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; + background: none repeat scroll 0 0 hsl(0, 0%, 100%); + border-top: 1px solid hsl(0, 0%, 82%); + box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; } .dashboard-block .dashboard-block-content .dashboard-block-box { - margin-top: 0 !important; + margin-top: 0 !important; } .dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table { - margin-bottom: 0 !important; + margin-bottom: 0 !important; } .dashboard-block-table { - background-color: hsla(0, 0%, 0%, 0); - border-collapse: collapse; - border-spacing: 0; - margin-bottom: 20px; - max-width: 100%; - width: 100%; + background-color: hsla(0, 0%, 0%, 0); + border-collapse: collapse; + border-spacing: 0; + margin-bottom: 20px; + max-width: 100%; + width: 100%; } .dashboard-block-table th, .dashboard-block-table td { - border-top: 1px solid hsl(0, 0%, 87%); - line-height: 20px; - padding: 5px; - text-align: left; - vertical-align: middle; + border-top: 1px solid hsl(0, 0%, 87%); + line-height: 20px; + padding: 5px; + text-align: left; + vertical-align: middle; } .dashboard-badge { - background-color: hsl(0, 0%, 60%); - border-radius: 9px; - color: hsl(0, 0%, 100%); - font-size: 11.844px; - font-weight: bold; - line-height: 14px; - padding: 1px 9px 2px; - text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); - vertical-align: baseline; - white-space: nowrap; + background-color: hsl(0, 0%, 60%); + border-radius: 9px; + color: hsl(0, 0%, 100%); + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + padding: 1px 9px 2px; + text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); + vertical-align: baseline; + white-space: nowrap; } \ No newline at end of file diff --git a/admin/assets/images/import.gif b/admin/assets/images/import.gif index 4371cc618..10bcb8569 100644 Binary files a/admin/assets/images/import.gif and b/admin/assets/images/import.gif differ diff --git a/admin/compiler/joomla_3/AdminController.php b/admin/compiler/joomla_3/AdminController.php index 98c6d9aeb..1837a17b6 100644 --- a/admin/compiler/joomla_3/AdminController.php +++ b/admin/compiler/joomla_3/AdminController.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/AdminControllerDashboard.php b/admin/compiler/joomla_3/AdminControllerDashboard.php index 8f53ecd75..4bb2b3659 100644 --- a/admin/compiler/joomla_3/AdminControllerDashboard.php +++ b/admin/compiler/joomla_3/AdminControllerDashboard.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/AdminController_custom_admin.php b/admin/compiler/joomla_3/AdminController_custom_admin.php index 8c32dc3cb..2cd69c6ed 100644 --- a/admin/compiler/joomla_3/AdminController_custom_admin.php +++ b/admin/compiler/joomla_3/AdminController_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -34,9 +34,9 @@ class ###Component###Controller###SViews### extends AdminController /** * Proxy for getModel. - * @since 2.5 + * @since 2.5 */ - public function getModel($name = '###SView###', $prefix = '###Component###Model', $config = array()) + public function getModel($name = '###SView###', $prefix = '###Component###Model', $config = []) { $model = parent::getModel($name, $prefix, array('ignore_request' => true)); @@ -45,7 +45,7 @@ class ###Component###Controller###SViews### extends AdminController public function dashboard() { - $this->setRedirect(JRoute::_('index.php?option=com_###component###', false)); + $this->setRedirect(Route::_('index.php?option=com_###component###', false)); return; }###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER### } diff --git a/admin/compiler/joomla_3/AdminModel.php b/admin/compiler/joomla_3/AdminModel.php index 4c2c92c56..a41ce196a 100644 --- a/admin/compiler/joomla_3/AdminModel.php +++ b/admin/compiler/joomla_3/AdminModel.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -52,18 +52,18 @@ class ###Component###Model###View### extends AdminModel * @param string $prefix A prefix for the table class name. Optional. * @param array $config Configuration array for model. Optional. * - * @return JTable A database object + * @return Table A database object * * @since 1.6 */ - public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array()) + public function getTable($type = '###view###', $prefix = '###Component###Table', $config = []) { // add table path for when model gets used from other component $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables'); // get instance of the table - return JTable::getInstance($type, $prefix, $config); + return Table::getInstance($type, $prefix, $config); }###ADMIN_CUSTOM_BUTTONS_METHOD### - + /** * Method to get a single record. * @@ -108,7 +108,7 @@ class ###Component###Model###View### extends AdminModel * * @since 1.6 */ - public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + public function getForm($data = [], $loadData = true, $options = array('control' => 'jform')) { // set load data option $options['load_data'] = $loadData;###JMODELADMIN_GETFORM### @@ -117,13 +117,13 @@ class ###Component###Model###View### extends AdminModel /** * Method to get the script that have to be included on the form * - * @return string script files + * @return string script files */ public function getScript() { return 'media/com_###component###/js/###view###.js'; } - + /** * Method to test whether a record can be deleted. * @@ -149,24 +149,24 @@ class ###Component###Model###View### extends AdminModel protected function canEditState($record) {###JMODELADMIN_CANEDITSTATE### } - + /** * Method override to check if you can edit an existing record. * - * @param array $data An array of input data. - * @param string $key The name of the key for the primary key. + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. * - * @return boolean - * @since 2.5 + * @return boolean + * @since 2.5 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') {###JMODELADMIN_ALLOWEDIT### } - + /** * Prepare and sanitise the table data prior to saving. * - * @param JTable $table A JTable object. + * @param Table $table A Table object. * * @return void * @@ -174,19 +174,19 @@ class ###Component###Model###View### extends AdminModel */ protected function prepareTable($table) {###LICENSE_TABLE_LOCKED_CHECK### - $date = JFactory::getDate(); - $user = JFactory::getUser(); - + $date = Factory::getDate(); + $user = Factory::getUser(); + if (isset($table->name)) { $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); } - + if (isset($table->alias) && empty($table->alias)) { $table->generateAlias(); } - + if (empty($table->id)) { $table->created = $date->toSql(); @@ -198,7 +198,7 @@ class ###Component###Model###View### extends AdminModel // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from($db->quoteName('#__###component###_###view###')); @@ -213,7 +213,7 @@ class ###Component###Model###View### extends AdminModel $table->modified = $date->toSql(); $table->modified_by = $user->id; } - + if (!empty($table->id)) { // Increment the items version number. @@ -228,10 +228,10 @@ class ###Component###Model###View### extends AdminModel * * @since 1.6 */ - protected function loadFormData() + protected function loadFormData() { // Check the session for previously entered form data. - $data = JFactory::getApplication()->getUserState('com_###component###.edit.###view###.data', array()); + $data = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []); if (empty($data)) { @@ -242,7 +242,7 @@ class ###Component###Model###View### extends AdminModel return $data; }###VALIDATIONFIX######UNIQUEFIELDS### - + /** * Method to delete one or more records. * @@ -258,7 +258,7 @@ class ###Component###Model###View### extends AdminModel { return false; }###JMODELADMIN_AFTER_DELETE### - + return true; } @@ -278,10 +278,10 @@ class ###Component###Model###View### extends AdminModel { return false; }###JMODELADMIN_AFTER_PUBLISH### - + return true; - } - + } + /** * Method to perform batch operations on an item or a set of items. * @@ -307,30 +307,30 @@ class ###Component###Model###View### extends AdminModel if (empty($pks)) { - $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + $this->setError(Text::_('JGLOBAL_NO_ITEM_SELECTED')); return false; } $done = false; // Set some needed variables. - $this->user = JFactory::getUser(); - $this->table = $this->getTable(); - $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); - $this->canDo = ###Component###Helper::getActions('###view###'); - $this->batchSet = true; + $this->user = Factory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new UCMType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ###Component###Helper::getActions('###view###'); + $this->batchSet = true; if (!$this->canDo->get('core.batch')) { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } - + if ($this->type == false) { - $type = new JUcmType; + $type = new UCMType; $this->type = $type->getTypeByAlias($this->typeAlias); } @@ -367,8 +367,7 @@ class ###Component###Model###View### extends AdminModel if (!$done) { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); - + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } @@ -377,7 +376,7 @@ class ###Component###Model###View### extends AdminModel return true; }###MODEL_BATCH_COPY######MODEL_BATCH_MOVE### - + /** * Method to save the form data. * @@ -389,34 +388,34 @@ class ###Component###Model###View### extends AdminModel */ public function save($data) { - $input = JFactory::getApplication()->input; - $filter = JFilterInput::getInstance(); - + $input = Factory::getApplication()->input; + $filter = InputFilter::getInstance(); + // set the metadata to the Item Data if (isset($data['metadata']) && isset($data['metadata']['author'])) { $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); - - $metadata = new JRegistry; + + $metadata = new Registry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; }###CHECKBOX_SAVE######METHOD_ITEM_SAVE### - + // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) { - $params = new JRegistry; + $params = new Registry; $params->loadArray($data['params']); $data['params'] = (string) $params; }###TITLEALIASFIX### - + if (parent::save($data)) { return true; } return false; } - + /** * Method to generate a unique value. * @@ -429,7 +428,6 @@ class ###Component###Model###View### extends AdminModel */ protected function generateUnique($field,$value) { - // set field value unique $table = $this->getTable(); diff --git a/admin/compiler/joomla_3/AdminModel_site.php b/admin/compiler/joomla_3/AdminModel_site.php index b805c970f..beb541e8d 100644 --- a/admin/compiler/joomla_3/AdminModel_site.php +++ b/admin/compiler/joomla_3/AdminModel_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -52,18 +52,18 @@ class ###Component###Model###View### extends AdminModel * @param string $prefix A prefix for the table class name. Optional. * @param array $config Configuration array for model. Optional. * - * @return JTable A database object + * @return Table A database object * * @since 1.6 */ - public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array()) + public function getTable($type = '###view###', $prefix = '###Component###Table', $config = []) { // add table path for when model gets used from other component $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables'); // get instance of the table - return JTable::getInstance($type, $prefix, $config); + return Table::getInstance($type, $prefix, $config); }###ADMIN_CUSTOM_BUTTONS_METHOD### - + /** * Method to get a single record. * @@ -108,7 +108,7 @@ class ###Component###Model###View### extends AdminModel * * @since 1.6 */ - public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + public function getForm($data = [], $loadData = true, $options = array('control' => 'jform')) { // set load data option $options['load_data'] = $loadData;###JMODELADMIN_GETFORM### @@ -117,13 +117,13 @@ class ###Component###Model###View### extends AdminModel /** * Method to get the script that have to be included on the form * - * @return string script files + * @return string script files */ public function getScript() { return 'media/com_###component###/js/###view###.js'; } - + /** * Method to test whether a record can be deleted. * @@ -149,24 +149,24 @@ class ###Component###Model###View### extends AdminModel protected function canEditState($record) {###JMODELADMIN_CANEDITSTATE### } - + /** * Method override to check if you can edit an existing record. * - * @param array $data An array of input data. - * @param string $key The name of the key for the primary key. + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. * - * @return boolean - * @since 2.5 + * @return boolean + * @since 2.5 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') {###JMODELADMIN_ALLOWEDIT### } - + /** * Prepare and sanitise the table data prior to saving. * - * @param JTable $table A JTable object. + * @param Table $table A Table object. * * @return void * @@ -174,19 +174,19 @@ class ###Component###Model###View### extends AdminModel */ protected function prepareTable($table) {###LICENSE_TABLE_LOCKED_CHECK### - $date = JFactory::getDate(); - $user = JFactory::getUser(); - + $date = Factory::getDate(); + $user = Factory::getUser(); + if (isset($table->name)) { $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); } - + if (isset($table->alias) && empty($table->alias)) { $table->generateAlias(); } - + if (empty($table->id)) { $table->created = $date->toSql(); @@ -198,7 +198,7 @@ class ###Component###Model###View### extends AdminModel // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from($db->quoteName('#__###component###_###view###')); @@ -213,7 +213,7 @@ class ###Component###Model###View### extends AdminModel $table->modified = $date->toSql(); $table->modified_by = $user->id; } - + if (!empty($table->id)) { // Increment the items version number. @@ -228,10 +228,10 @@ class ###Component###Model###View### extends AdminModel * * @since 1.6 */ - protected function loadFormData() + protected function loadFormData() { // Check the session for previously entered form data. - $data = JFactory::getApplication()->getUserState('com_###component###.edit.###view###.data', array()); + $data = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []); if (empty($data)) { @@ -242,7 +242,7 @@ class ###Component###Model###View### extends AdminModel return $data; }###VALIDATIONFIX######UNIQUEFIELDS### - + /** * Method to delete one or more records. * @@ -258,7 +258,7 @@ class ###Component###Model###View### extends AdminModel { return false; }###JMODELADMIN_AFTER_DELETE### - + return true; } @@ -278,10 +278,10 @@ class ###Component###Model###View### extends AdminModel { return false; }###JMODELADMIN_AFTER_PUBLISH### - + return true; - } - + } + /** * Method to perform batch operations on an item or a set of items. * @@ -307,30 +307,30 @@ class ###Component###Model###View### extends AdminModel if (empty($pks)) { - $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + $this->setError(Text::_('JGLOBAL_NO_ITEM_SELECTED')); return false; } $done = false; // Set some needed variables. - $this->user = JFactory::getUser(); - $this->table = $this->getTable(); - $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); - $this->canDo = ###Component###Helper::getActions('###view###'); - $this->batchSet = true; + $this->user = Factory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new UCMType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ###Component###Helper::getActions('###view###'); + $this->batchSet = true; if (!$this->canDo->get('core.batch')) { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } - + if ($this->type == false) { - $type = new JUcmType; + $type = new UCMType; $this->type = $type->getTypeByAlias($this->typeAlias); } @@ -367,8 +367,7 @@ class ###Component###Model###View### extends AdminModel if (!$done) { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); - + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } @@ -377,7 +376,7 @@ class ###Component###Model###View### extends AdminModel return true; }###MODEL_BATCH_COPY######MODEL_BATCH_MOVE### - + /** * Method to save the form data. * @@ -389,34 +388,34 @@ class ###Component###Model###View### extends AdminModel */ public function save($data) { - $input = JFactory::getApplication()->input; - $filter = JFilterInput::getInstance(); - + $input = Factory::getApplication()->input; + $filter = InputFilter::getInstance(); + // set the metadata to the Item Data if (isset($data['metadata']) && isset($data['metadata']['author'])) { $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); - - $metadata = new JRegistry; + + $metadata = new Registry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; }###CHECKBOX_SAVE######METHOD_ITEM_SAVE### - + // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) { - $params = new JRegistry; + $params = new Registry; $params->loadArray($data['params']); $data['params'] = (string) $params; }###TITLEALIASFIX### - + if (parent::save($data)) { return true; } return false; } - + /** * Method to generate a unique value. * @@ -427,9 +426,8 @@ class ###Component###Model###View### extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { - // set field value unique $table = $this->getTable(); diff --git a/admin/compiler/joomla_3/BaseController.php b/admin/compiler/joomla_3/BaseController.php index b7dd77c85..51991743a 100644 --- a/admin/compiler/joomla_3/BaseController.php +++ b/admin/compiler/joomla_3/BaseController.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -19,6 +19,8 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Controller\BaseController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; /** * General Controller of ###Component### component @@ -34,7 +36,7 @@ class ###Component###Controller extends BaseController * * @since 3.0 */ - public function __construct($config = array()) + public function __construct($config = []) { // set the default view $config['default_view'] = '###DASHBOARDVIEW###'; @@ -50,38 +52,38 @@ class ###Component###Controller extends BaseController function display($cachable = false, $urlparams = false) { // set default view if not set - $view = $this->input->getCmd('view', '###DASHBOARDVIEW###'); - $data = $this->getViewRelation($view); - $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); + $view = $this->input->getCmd('view', '###DASHBOARDVIEW###'); + $data = $this->getViewRelation($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); // Check for edit form. - if(###Component###Helper::checkArray($data)) + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($data)) { if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id)) { // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); // set redirect - if ($refid > 0 && ###Component###Helper::checkString($ref)) + if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) { // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); } - elseif (###Component###Helper::checkString($ref)) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) { // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false)); } else { // normal redirect back to the list view - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.$data['views'], false)); } return false; @@ -94,7 +96,7 @@ class ###Component###Controller extends BaseController protected function getViewRelation($view) { // check the we have a value - if (###Component###Helper::checkString($view)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view)) { // the view relationships $views = array(###VIEWARRAY### diff --git a/admin/compiler/joomla_3/BaseControllerAjax.php b/admin/compiler/joomla_3/BaseControllerAjax.php index fb3b4ac1c..1d9640c5b 100644 --- a/admin/compiler/joomla_3/BaseControllerAjax.php +++ b/admin/compiler/joomla_3/BaseControllerAjax.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,7 +17,9 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -29,9 +31,9 @@ class ###Component###ControllerAjax extends BaseController { parent::__construct($config); // make sure all json stuff are set - JFactory::getDocument()->setMimeEncoding( 'application/json' ); + Factory::getDocument()->setMimeEncoding( 'application/json' ); // get the application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); $app->setHeader('Access-Control-Allow-Origin', '*'); // load the tasks ###REGISTER_AJAX_TASK### @@ -40,16 +42,16 @@ class ###Component###ControllerAjax extends BaseController public function ajax() { // get the user for later use - $user = JFactory::getUser(); + $user = Factory::getUser(); // get the input values - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; // check if we should return raw - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); // return to a callback function - $callback = $jinput->get('callback', null, 'CMD'); + $callback = $jinput->get('callback', null, 'CMD'); // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { // get the task diff --git a/admin/compiler/joomla_3/BaseControllerAjaxSite.php b/admin/compiler/joomla_3/BaseControllerAjaxSite.php index b32768f64..a02fa0127 100644 --- a/admin/compiler/joomla_3/BaseControllerAjaxSite.php +++ b/admin/compiler/joomla_3/BaseControllerAjaxSite.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,7 +17,9 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -29,9 +31,9 @@ class ###Component###ControllerAjax extends BaseController { parent::__construct($config); // make sure all json stuff are set - JFactory::getDocument()->setMimeEncoding( 'application/json' ); + Factory::getDocument()->setMimeEncoding( 'application/json' ); // get the application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); $app->setHeader('Access-Control-Allow-Origin', '*'); // load the tasks ###REGISTER_SITE_AJAX_TASK### @@ -40,16 +42,16 @@ class ###Component###ControllerAjax extends BaseController public function ajax() { // get the user for later use - $user = JFactory::getUser(); + $user = Factory::getUser(); // get the input values - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; // check if we should return raw - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); // return to a callback function - $callback = $jinput->get('callback', null, 'CMD'); + $callback = $jinput->get('callback', null, 'CMD'); // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { // get the task @@ -71,7 +73,7 @@ class ###Component###ControllerAjax extends BaseController echo json_encode(false); } else - { + { echo "(".json_encode(false).");"; } } diff --git a/admin/compiler/joomla_3/BaseControllerHelp.php b/admin/compiler/joomla_3/BaseControllerHelp.php index 86f92aa41..8cd3d0ebf 100644 --- a/admin/compiler/joomla_3/BaseControllerHelp.php +++ b/admin/compiler/joomla_3/BaseControllerHelp.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -34,12 +37,12 @@ class ###Component###ControllerHelp extends BaseController public function help() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); - if($user->id != 0 && $token == $call_token) + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) { $task = $this->getTask(); switch($task){ @@ -67,7 +70,7 @@ class ###Component###ControllerHelp extends BaseController break; } } - else + else { // stop execution gracefully jexit(); @@ -76,8 +79,8 @@ class ###Component###ControllerHelp extends BaseController protected function getHelpDocumentText($id) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true); + $db = Factory::getDbo(); + $query = $db->getQuery(true); $query->select(array('a.title','a.content')); $query->from('#__###component###_help_document AS a'); $query->where('a.id = '.(int) $id); @@ -86,21 +89,21 @@ class ###Component###ControllerHelp extends BaseController $db->execute(); if($db->getNumRows()) { - $text = array(); + $text = []; $document = $db->loadObject(); // fix image issue - $images['src="images'] = 'src="'.JURI::root().'images'; - $images["src='images"] = "src='".JURI::root()."images"; - $images['src="/images'] = 'src="'.JURI::root().'images'; - $images["src='/images"] = "src='".JURI::root()."images"; + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; // set document template $text[] = ""; $text[] = ''; $text[] = ""; $text[] = ''; $text[] = "".$document->title.""; - $text[] = ''; - $text[] = ''; + $text[] = ''; + $text[] = ''; $text[] = ""; $text[] = '
'; $text[] = '
'; diff --git a/admin/compiler/joomla_3/BaseControllerHelp_site.php b/admin/compiler/joomla_3/BaseControllerHelp_site.php index 2df722c4b..dfeb2d229 100644 --- a/admin/compiler/joomla_3/BaseControllerHelp_site.php +++ b/admin/compiler/joomla_3/BaseControllerHelp_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -34,12 +37,12 @@ class ###Component###ControllerHelp extends BaseController public function help() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); - if($token == $call_token) + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) { $task = $this->getTask(); switch($task){ @@ -76,8 +79,8 @@ class ###Component###ControllerHelp extends BaseController protected function getHelpDocumentText($id) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true); + $db = Factory::getDbo(); + $query = $db->getQuery(true); $query->select(array('a.title','a.content')); $query->from('#__###component###_help_document AS a'); $query->where('a.id = '.(int) $id); @@ -87,21 +90,21 @@ class ###Component###ControllerHelp extends BaseController $db->execute(); if($db->getNumRows()) { - $text = array(); + $text = []; $document = $db->loadObject(); // fix image issue - $images['src="images'] = 'src="'.JURI::root().'images'; - $images["src='images"] = "src='".JURI::root()."images"; - $images['src="/images'] = 'src="'.JURI::root().'images'; - $images["src='/images"] = "src='".JURI::root()."images"; + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; // set document template $text[] = ""; $text[] = ''; $text[] = ""; $text[] = ''; $text[] = "".$document->title.""; - $text[] = ''; - $text[] = ''; + $text[] = ''; + $text[] = ''; $text[] = ""; $text[] = '
'; $text[] = '
'; diff --git a/admin/compiler/joomla_3/BaseControllerSITE.php b/admin/compiler/joomla_3/BaseControllerSITE.php index af2bde03e..cee5dbb72 100644 --- a/admin/compiler/joomla_3/BaseControllerSITE.php +++ b/admin/compiler/joomla_3/BaseControllerSITE.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,8 +17,11 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; /** * ###Component### Component Base Controller @@ -37,51 +40,51 @@ class ###Component###Controller extends BaseController function display($cachable = false, $urlparams = false) { // set default view if not set - $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###'); + $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###'); $this->input->set('view', $view); - $isEdit = $this->checkEditView($view); - $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); - // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238) - + $isEdit = $this->checkEditView($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); + // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238) + // insure that the view is not cashable if edit view or if user is logged in - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->get('id') || $isEdit) { $cachable = false; } - + // Check for edit form. if($isEdit) { if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id)) { // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); // set redirect - if ($refid > 0 && ###Component###Helper::checkString($ref)) + if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) { // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); } - elseif (###Component###Helper::checkString($ref)) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) { // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false)); } else { // normal redirect back to the list default site view - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false)); } return false; } } - + // we may need to make this more dynamic in the future. (TODO) $safeurlparams = array( 'catid' => 'INT', @@ -102,9 +105,9 @@ class ###Component###Controller extends BaseController 'Itemid' => 'INT'); // should these not merge? - if (###Component###Helper::checkArray($urlparams)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($urlparams)) { - $safeurlparams = ###Component###Helper::mergeArrays(array($urlparams, $safeurlparams)); + $safeurlparams = Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge(array($urlparams, $safeurlparams)); } return parent::display($cachable, $safeurlparams); @@ -112,7 +115,7 @@ class ###Component###Controller extends BaseController protected function checkEditView($view) { - if (###Component###Helper::checkString($view)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view)) { $views = array(###SITE_EDIT_VIEW_ARRAY### ); diff --git a/admin/compiler/joomla_3/BaseController_custom_admin.php b/admin/compiler/joomla_3/BaseController_custom_admin.php index 8ed50653a..3976b770a 100644 --- a/admin/compiler/joomla_3/BaseController_custom_admin.php +++ b/admin/compiler/joomla_3/BaseController_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -31,7 +31,7 @@ class ###Component###Controller###SView### extends BaseController public function dashboard() { - $this->setRedirect(JRoute::_('index.php?option=com_###component###', false)); + $this->setRedirect(Route::_('index.php?option=com_###component###', false)); return; }###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER### } diff --git a/admin/compiler/joomla_3/BaseController_import.php b/admin/compiler/joomla_3/BaseController_import.php index 504c266f2..f5811358a 100644 --- a/admin/compiler/joomla_3/BaseController_import.php +++ b/admin/compiler/joomla_3/BaseController_import.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -32,21 +32,21 @@ class ###Component###ControllerImport extends BaseController public function import() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); $model = $this->getModel('import'); if ($model->import()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $redirect_url = $app->getUserState('com_###component###.redirect_url'); if (empty($redirect_url)) { - $redirect_url = JRoute::_('index.php?option=com_###component###&view=import', false); + $redirect_url = Route::_('index.php?option=com_###component###&view=import', false); } else { diff --git a/admin/compiler/joomla_3/BaseController_import_custom.php b/admin/compiler/joomla_3/BaseController_import_custom.php index dbe424603..a9283454a 100644 --- a/admin/compiler/joomla_3/BaseController_import_custom.php +++ b/admin/compiler/joomla_3/BaseController_import_custom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -32,21 +32,21 @@ class ###Component###Controller###View### extends BaseController public function import() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); $model = $this->getModel('###View###'); if ($model->import()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $redirect_url = $app->getUserState('com_###component###.redirect_url'); if (empty($redirect_url)) { - $redirect_url = JRoute::_('index.php?option=com_###component###&view=###view###', false); + $redirect_url = Route::_('index.php?option=com_###component###&view=###view###', false); } else { diff --git a/admin/compiler/joomla_3/BaseDatabaseModel_import.php b/admin/compiler/joomla_3/BaseDatabaseModel_import.php index f7501c7ec..020739141 100644 --- a/admin/compiler/joomla_3/BaseDatabaseModel_import.php +++ b/admin/compiler/joomla_3/BaseDatabaseModel_import.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -27,8 +27,8 @@ class ###Component###ModelImport extends BaseDatabaseModel // set uploading values protected $use_streams = false; protected $allow_unsafe = false; - protected $safeFileOptions = array(); - + protected $safeFileOptions = []; + /** * @var object JTable object */ @@ -45,13 +45,13 @@ class ###Component###ModelImport extends BaseDatabaseModel * @var string */ protected $_context = 'com_###component###.import'; - + /** * Import Settings */ - protected $getType = NULL; - protected $dataType = NULL; - + protected $getType = NULL; + protected $dataType = NULL; + /** * Method to auto-populate the model state. * @@ -62,7 +62,7 @@ class ###Component###ModelImport extends BaseDatabaseModel */ protected function populateState() { - $app = JFactory::getApplication('administrator'); + $app = Factory::getApplication('administrator'); $this->setState('message', $app->getUserState('com_###component###.message')); $app->setUserState('com_###component###.message', ''); @@ -82,14 +82,14 @@ class ###Component###ModelImport extends BaseDatabaseModel public function import() { $this->setState('action', 'import'); - $app = JFactory::getApplication(); - $session = JFactory::getSession(); + $app = Factory::getApplication(); + $session = Factory::getSession(); $package = null; $continue = false; // get import type $this->getType = $app->input->getString('gettype', NULL); // get import type - $this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL); + $this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL); if ($package === null) { @@ -110,9 +110,9 @@ class ###Component###ModelImport extends BaseDatabaseModel break; case 'continue': - $continue = true; - $package = $session->get('package', null); - $package = json_decode($package, true); + $continue = true; + $package = $session->get('package', null); + $package = json_decode($package, true); // clear session $session->clear('package'); $session->clear('dataType'); @@ -120,7 +120,7 @@ class ###Component###ModelImport extends BaseDatabaseModel break; default: - $app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND')); + $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND')); return false; break; @@ -134,10 +134,10 @@ class ###Component###ModelImport extends BaseDatabaseModel $this->remove($package['packagename']); } - $app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE')); + $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE')); return false; } - + // first link data to table headers if(!$continue){ $package = json_encode($package); @@ -146,13 +146,13 @@ class ###Component###ModelImport extends BaseDatabaseModel $session->set('hasPackage', true); return true; } - + // set the data $headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false), true); if (!$this->setData($package,$this->dataType,$headerList)) { // There was an error importing the package - $msg = JText::_('COM_###COMPONENT###_IMPORT_ERROR'); + $msg = Text::_('COM_###COMPONENT###_IMPORT_ERROR'); $back = $session->get('backto_VDM_IMPORT', NULL); if ($back) { @@ -164,12 +164,12 @@ class ###Component###ModelImport extends BaseDatabaseModel else { // Package imported sucessfully - $msg = JText::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']); + $msg = Text::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']); $back = $session->get('backto_VDM_IMPORT', NULL); if ($back) { - $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back); - $session->clear('backto_VDM_IMPORT'); + $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back); + $session->clear('backto_VDM_IMPORT'); } $result = true; } @@ -180,7 +180,7 @@ class ###Component###ModelImport extends BaseDatabaseModel // remove file after import $this->remove($package['packagename']); $session->clear($this->getType.'_VDM_IMPORTHEADERS'); - + return $result; } @@ -190,48 +190,47 @@ class ###Component###ModelImport extends BaseDatabaseModel * @return spreadsheet definition or false on failure */ protected function _getPackageFromUpload() - { + { // Get the uploaded file information - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. $userfile = $input->files->get('import_package', null, 'raw'); - + // Make sure that file uploads are enabled in php if (!(bool) ini_get('file_uploads')) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); return false; } // If there is no uploaded file, we have a problem... if (!is_array($userfile)) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); return false; } // Check if there was a problem uploading the file. if ($userfile['error'] || $userfile['size'] < 1) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); return false; } // Build the appropriate paths - $config = JFactory::getConfig(); + $config = Factory::getConfig(); $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_src = $userfile['tmp_name']; // Move uploaded file - jimport('joomla.filesystem.file'); $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions); // Was the package downloaded? if (!$p_file) { - $session = JFactory::getSession(); + $session = Factory::getSession(); $session->clear('package'); $session->clear('dataType'); $session->clear('hasPackage'); @@ -253,16 +252,16 @@ class ###Component###ModelImport extends BaseDatabaseModel */ protected function _getPackageFromFolder() { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Get the path to the package to import $p_dir = $input->getString('import_directory'); - $p_dir = JPath::clean($p_dir); + $p_dir = Path::clean($p_dir); // Did you give us a valid path? if (!file_exists($p_dir)) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); return false; } @@ -272,17 +271,17 @@ class ###Component###ModelImport extends BaseDatabaseModel // Did you give us a valid package? if (!$type) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); } - + // check the extention if(!$this->checkExtension($p_dir)) { // set error message - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; } - + $package['packagename'] = null; $package['dir'] = $p_dir; $package['type'] = $type; @@ -298,26 +297,26 @@ class ###Component###ModelImport extends BaseDatabaseModel */ protected function _getPackageFromUrl() { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; - + // Get the URL of the package to import $url = $input->getString('import_url'); // Did you give us a URL? if (!$url) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); return false; } // Download the package at the URL given - $p_file = JInstallerHelper::downloadPackage($url); + $p_file = InstallerHelper::downloadPackage($url); // Was the package downloaded? if (!$p_file) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); return false; } @@ -326,7 +325,7 @@ class ###Component###ModelImport extends BaseDatabaseModel return $package; } - + /** * Check a file and verifies it as a spreadsheet file * Supports .csv .xlsx .xls and .ods @@ -338,29 +337,29 @@ class ###Component###ModelImport extends BaseDatabaseModel */ protected function check($archivename) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Clean the name - $archivename = JPath::clean($archivename); - + $archivename = Path::clean($archivename); + // check the extention if(!$this->checkExtension($archivename)) { // Cleanup the import files $this->remove($archivename); - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; } - - $config = JFactory::getConfig(); + + $config = Factory::getConfig(); // set Package Name $check['packagename'] = $archivename; - + // set directory $check['dir'] = $config->get('tmp_path'). '/' .$archivename; - + // set type $check['type'] = $this->getType; - + return $check; }###IMPORT_EXT_METHOD### @@ -375,8 +374,8 @@ class ###Component###ModelImport extends BaseDatabaseModel protected function remove($package) { jimport('joomla.filesystem.file'); - - $config = JFactory::getConfig(); + + $config = Factory::getConfig(); $package = $config->get('tmp_path'). '/' .$package; // Is the package file a valid file? @@ -384,23 +383,23 @@ class ###Component###ModelImport extends BaseDatabaseModel { File::delete($package); } - elseif (is_file(JPath::clean($package))) + elseif (is_file(Path::clean($package))) { // It might also be just a base filename - File::delete(JPath::clean($package)); + File::delete(Path::clean($package)); } }###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD### protected function getAlias($name,$type = false) { // sanitize the name to an alias - if (JFactory::getConfig()->get('unicodeslugs') == 1) + if (Factory::getConfig()->get('unicodeslugs') == 1) { - $alias = JFilterOutput::stringURLUnicodeSlug($name); + $alias = OutputFilter::stringURLUnicodeSlug($name); } else { - $alias = JFilterOutput::stringURLSafe($name); + $alias = OutputFilter::stringURLSafe($name); } // must be a uniqe alias if ($type) @@ -409,7 +408,7 @@ class ###Component###ModelImport extends BaseDatabaseModel } return $alias; } - + /** * Method to generate a uniqe value. * @@ -424,16 +423,16 @@ class ###Component###ModelImport extends BaseDatabaseModel // insure the filed is always uniqe while (isset($this->uniqeValueArray[$type][$field][$value])) { - $value = JString::increment($value, 'dash'); + $value = StringHelper::increment($value, 'dash'); } $this->uniqeValueArray[$type][$field][$value] = $value; return $value; } - + protected function getAliasesUsed($table) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // first we check if there is a alias column $columns = $db->getTableColumns('#__###component###_'.$table); if(isset($columns['alias'])){ diff --git a/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php b/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php index 19be712eb..e429a0223 100644 --- a/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php +++ b/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -27,8 +27,8 @@ class ###Component###Model###View### extends BaseDatabaseModel // set uploading values protected $use_streams = false; protected $allow_unsafe = false; - protected $safeFileOptions = array(); - + protected $safeFileOptions = []; + /** * @var object JTable object */ @@ -45,13 +45,13 @@ class ###Component###Model###View### extends BaseDatabaseModel * @var string */ protected $_context = 'com_###component###.###view###'; - + /** * Import Settings */ protected $getType = NULL; protected $dataType = NULL; - + /** * Method to auto-populate the model state. * @@ -62,7 +62,7 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function populateState() { - $app = JFactory::getApplication('administrator'); + $app = Factory::getApplication('administrator'); $this->setState('message', $app->getUserState('com_###component###.message')); $app->setUserState('com_###component###.message', ''); @@ -72,7 +72,7 @@ class ###Component###Model###View### extends BaseDatabaseModel $this->setState('import.directory', $path); parent::populateState(); } - ###IMPORT_METHOD_CUSTOM### + ###IMPORT_METHOD_CUSTOM### /** * Works out an importation spreadsheet from a HTTP upload @@ -80,37 +80,37 @@ class ###Component###Model###View### extends BaseDatabaseModel * @return spreadsheet definition or false on failure */ protected function _getPackageFromUpload() - { + { // Get the uploaded file information - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. $userfile = $input->files->get('import_package', null, 'raw'); - + // Make sure that file uploads are enabled in php if (!(bool) ini_get('file_uploads')) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); return false; } // If there is no uploaded file, we have a problem... if (!is_array($userfile)) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); return false; } // Check if there was a problem uploading the file. if ($userfile['error'] || $userfile['size'] < 1) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); return false; } // Build the appropriate paths - $config = JFactory::getConfig(); + $config = Factory::getConfig(); $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_src = $userfile['tmp_name']; @@ -120,7 +120,7 @@ class ###Component###Model###View### extends BaseDatabaseModel // Was the package downloaded? if (!$p_file) { - $session = JFactory::getSession(); + $session = Factory::getSession(); $session->clear('package'); $session->clear('dataType'); $session->clear('hasPackage'); @@ -142,16 +142,16 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function _getPackageFromFolder() { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Get the path to the package to import $p_dir = $input->getString('import_directory'); - $p_dir = JPath::clean($p_dir); + $p_dir = Path::clean($p_dir); // Did you give us a valid path? if (!file_exists($p_dir)) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); return false; } @@ -161,17 +161,17 @@ class ###Component###Model###View### extends BaseDatabaseModel // Did you give us a valid package? if (!$type) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); } - + // check the extention if(!$this->checkExtension($p_dir)) { // set error message - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; } - + $package['packagename'] = null; $package['dir'] = $p_dir; $package['type'] = $type; @@ -187,7 +187,7 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function _getPackageFromUrl() { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Get the URL of the package to import @@ -196,17 +196,17 @@ class ###Component###Model###View### extends BaseDatabaseModel // Did you give us a URL? if (!$url) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); return false; } // Download the package at the URL given - $p_file = JInstallerHelper::downloadPackage($url); + $p_file = InstallerHelper::downloadPackage($url); // Was the package downloaded? if (!$p_file) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); return false; } @@ -215,7 +215,7 @@ class ###Component###Model###View### extends BaseDatabaseModel return $package; } - + /** * Check a file and verifies it as a spreadsheet file * Supports .csv .xlsx .xls and .ods @@ -227,29 +227,29 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function check($archivename) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Clean the name - $archivename = JPath::clean($archivename); - + $archivename = Path::clean($archivename); + // check the extention if(!$this->checkExtension($archivename)) { // Cleanup the import files $this->remove($archivename); - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; } - - $config = JFactory::getConfig(); + + $config = Factory::getConfig(); // set Package Name $check['packagename'] = $archivename; - + // set directory $check['dir'] = $config->get('tmp_path'). '/' .$archivename; - + // set type $check['type'] = $this->getType; - + return $check; } ###IMPORT_EXT_METHOD### @@ -264,9 +264,7 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function remove($package) { - jimport('joomla.filesystem.file'); - - $config = JFactory::getConfig(); + $config = Factory::getConfig(); $package = $config->get('tmp_path'). '/' .$package; // Is the package file a valid file? @@ -274,10 +272,10 @@ class ###Component###Model###View### extends BaseDatabaseModel { File::delete($package); } - elseif (is_file(JPath::clean($package))) + elseif (is_file(Path::clean($package))) { // It might also be just a base filename - File::delete(JPath::clean($package)); + File::delete(Path::clean($package)); } } ###IMPORT_SETDATA_METHOD### @@ -286,13 +284,13 @@ class ###Component###Model###View### extends BaseDatabaseModel protected function getAlias($name,$type = false) { // sanitize the name to an alias - if (JFactory::getConfig()->get('unicodeslugs') == 1) + if (Factory::getConfig()->get('unicodeslugs') == 1) { - $alias = JFilterOutput::stringURLUnicodeSlug($name); + $alias = OutputFilter::stringURLUnicodeSlug($name); } else { - $alias = JFilterOutput::stringURLSafe($name); + $alias = OutputFilter::stringURLSafe($name); } // must be a uniqe alias if ($type) @@ -301,7 +299,7 @@ class ###Component###Model###View### extends BaseDatabaseModel } return $alias; } - + /** * Method to generate a uniqe value. * @@ -316,16 +314,16 @@ class ###Component###Model###View### extends BaseDatabaseModel // insure the filed is always uniqe while (isset($this->uniqeValueArray[$type][$field][$value])) { - $value = JString::increment($value, 'dash'); + $value = StringHelper::increment($value, 'dash'); } $this->uniqeValueArray[$type][$field][$value] = $value; return $value; } - + protected function getAliasesUsed($table) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // first we check if there is a alias column $columns = $db->getTableColumns('#__###component###_'.$table); if(isset($columns['alias'])){ diff --git a/admin/compiler/joomla_3/DASHJViewLagacy.php b/admin/compiler/joomla_3/DASHJViewLagacy.php index c9a759f75..d8dc3d60f 100644 --- a/admin/compiler/joomla_3/DASHJViewLagacy.php +++ b/admin/compiler/joomla_3/DASHJViewLagacy.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -22,7 +22,7 @@ defined('_JEXEC') or die('Restricted access'); /** * ###Component### View class */ -class ###Component###View###Component### extends JViewLegacy +class ###Component###View###Component### extends HtmlView { /** * View display method @@ -31,15 +31,15 @@ class ###Component###View###Component### extends JViewLegacy function display($tpl = null) { // Assign data to the view - $this->icons = $this->get('Icons'); - $this->contributors = ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA### - + $this->icons = $this->get('Icons'); + $this->contributors = ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA### + // get the manifest details of the component $this->manifest = ###Component###Helper::manifest(); - + // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -59,18 +59,18 @@ class ###Component###View###Component### extends JViewLegacy protected function addToolBar() { $canDo = ###Component###Helper::getActions('###component###'); - JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###component###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } if ($canDo->get('core.admin') || $canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); } } @@ -81,15 +81,17 @@ class ###Component###View###Component### extends JViewLegacy */ protected function setDocument() { - $document = JFactory::getDocument(); - - // add dashboard style sheets - $document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/dashboard.css"); - + if (!isset($this->document)) + { + $this->document = Factory::getDocument(); + } // set page title - $document->setTitle(JText::_('COM_###COMPONENT###_DASHBOARD')); - + $this->document->setTitle(Text::_('COM_###COMPONENT###_DASHBOARD')); + // add manifest to page JavaScript - $document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript"); + $this->document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript"); + + // add dashboard style sheets + Html::_('stylesheet', "administrator/components/com_###component###/assets/css/dashboard.css", ['version' => 'auto']); } } diff --git a/admin/compiler/joomla_3/DASHdefault.php b/admin/compiler/joomla_3/DASHdefault.php index 14691c6cd..bda607bcf 100644 --- a/admin/compiler/joomla_3/DASHdefault.php +++ b/admin/compiler/joomla_3/DASHdefault.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/FormController.php b/admin/compiler/joomla_3/FormController.php index feb4ec217..59827b281 100644 --- a/admin/compiler/joomla_3/FormController.php +++ b/admin/compiler/joomla_3/FormController.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -40,13 +40,13 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = '###Views###'; // safeguard for setting the return view listing to the main view. parent::__construct($config); }###ADMIN_CUSTOM_BUTTONS_CONTROLLER### - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -55,7 +55,7 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) {###JCONTROLLERFORM_ALLOWADD### } @@ -69,7 +69,7 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') {###JCONTROLLERFORM_ALLOWEDIT### } @@ -94,12 +94,12 @@ class ###Component###Controller###View### extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -116,13 +116,13 @@ class ###Component###Controller###View### extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('###View###', '', array()); + $model = $this->getModel('###View###', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -147,13 +147,13 @@ class ###Component###Controller###View### extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -164,7 +164,7 @@ class ###Component###Controller###View### extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -175,7 +175,7 @@ class ###Component###Controller###View### extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -201,7 +201,7 @@ class ###Component###Controller###View### extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -219,29 +219,29 @@ class ###Component###Controller###View### extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -253,15 +253,14 @@ class ###Component###Controller###View### extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) {###POSTSAVEHOOK### } - } diff --git a/admin/compiler/joomla_3/FormController_custom_site.php b/admin/compiler/joomla_3/FormController_custom_site.php index 8d6d30cd5..6f38faedb 100644 --- a/admin/compiler/joomla_3/FormController_custom_site.php +++ b/admin/compiler/joomla_3/FormController_custom_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -33,7 +33,7 @@ class ###Component###Controller###SView### extends FormController */ protected $task; - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view. parent::__construct($config); @@ -51,13 +51,13 @@ class ###Component###Controller###SView### extends FormController * * @since 12.2 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // to insure no other tampering return false; } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -66,7 +66,7 @@ class ###Component###Controller###SView### extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // to insure no other tampering return false; @@ -101,7 +101,7 @@ class ###Component###Controller###SView### extends FormController * * @since 12.2 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(JModelLegacy $model, $validData = []) { } } diff --git a/admin/compiler/joomla_3/FormController_site.php b/admin/compiler/joomla_3/FormController_site.php index 530f3ac90..b55b176fc 100644 --- a/admin/compiler/joomla_3/FormController_site.php +++ b/admin/compiler/joomla_3/FormController_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -40,13 +40,13 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view. parent::__construct($config); }###ADMIN_CUSTOM_BUTTONS_CONTROLLER### - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -55,7 +55,7 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) {###JCONTROLLERFORM_ALLOWADD### } @@ -69,7 +69,7 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') {###JCONTROLLERFORM_ALLOWEDIT### } @@ -94,12 +94,12 @@ class ###Component###Controller###View### extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -116,13 +116,13 @@ class ###Component###Controller###View### extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('###View###', '', array()); + $model = $this->getModel('###View###', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -147,35 +147,35 @@ class ###Component###Controller###View### extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -201,7 +201,7 @@ class ###Component###Controller###View### extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -219,29 +219,29 @@ class ###Component###Controller###View### extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -253,14 +253,14 @@ class ###Component###Controller###View### extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) {###POSTSAVEHOOK### } diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index ded32f2d4..6caa65c0a 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -29,7 +29,7 @@ abstract class ###Component###Helper * * @var array */ - protected static $composer = array(); + protected static $composer = []; /** * The Main Active Language @@ -80,7 +80,7 @@ abstract class ###Component###Helper // check if set if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -91,18 +91,18 @@ abstract class ###Component###Helper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) - { + { if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } @@ -116,8 +116,8 @@ abstract class ###Component###Helper $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; @@ -129,7 +129,7 @@ abstract class ###Component###Helper public static function addSubmenu($submenu) { // load user for access menus - $user = JFactory::getUser(); + $user = Factory::getUser(); // load the submenus to sidebar ###SUBMENU### }###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL### @@ -211,7 +211,7 @@ abstract class ###Component###Helper { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__###component###_'.$type.' AS a'); @@ -229,7 +229,7 @@ abstract class ###Component###Helper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getDBO(); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -238,7 +238,7 @@ abstract class ###Component###Helper $db->execute(); $found = $db->getNumRows(); if($found) - { + { return $db->loadResult(); } return $id; @@ -254,7 +254,7 @@ abstract class ###Component###Helper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions + * @return object The CMSObject of permission/authorised actions * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') @@ -263,22 +263,22 @@ abstract class ###Component###Helper if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getUser(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view); if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views)) { $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views); - } + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; @@ -445,14 +445,14 @@ abstract class ###Component###Helper /** * Get any component's model */ - public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = []) { // fix the name $name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name); // full path to models $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model'); // make sure the table path is loaded if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path'])) { @@ -460,7 +460,7 @@ abstract class ###Component###Helper $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; } // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); + $model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { @@ -495,14 +495,14 @@ abstract class ###Component###Helper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_###component###'); $parentId = $parent->id; $name = 'com_###component###.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -526,14 +526,14 @@ abstract class ###Component###Helper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else @@ -546,7 +546,7 @@ abstract class ###Component###Helper $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); } } return false; @@ -563,7 +563,7 @@ abstract class ###Component###Helper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -578,8 +578,8 @@ abstract class ###Component###Helper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -594,7 +594,7 @@ abstract class ###Component###Helper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -602,8 +602,8 @@ abstract class ###Component###Helper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -648,7 +648,7 @@ abstract class ###Component###Helper * @return null * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); } @@ -662,7 +662,7 @@ abstract class ###Component###Helper * @return void * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); } @@ -733,7 +733,7 @@ abstract class ###Component###Helper /** * Check if have an json string * - * @input string The json string to check + * @input string The json string to check * * @returns bool true on success * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); @@ -746,7 +746,7 @@ abstract class ###Component###Helper /** * Check if have an object with a length * - * @input object The object to check + * @input object The object to check * * @returns bool true on success * @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); @@ -759,7 +759,7 @@ abstract class ###Component###Helper /** * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * * @returns bool/int number of items in array on success * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); @@ -772,7 +772,7 @@ abstract class ###Component###Helper /** * Check if have a string with a length * - * @input string The string to check + * @input string The string to check * * @returns bool true on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); @@ -792,7 +792,7 @@ abstract class ###Component###Helper { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -810,7 +810,7 @@ abstract class ###Component###Helper /** * Merge an array of array's * - * @input array The arrays you would like to merge + * @input array The arrays you would like to merge * * @returns array on success * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); @@ -829,7 +829,7 @@ abstract class ###Component###Helper /** * Shorten a string * - * @input string The you would like to shorten + * @input string The you would like to shorten * * @returns string on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...); @@ -842,7 +842,7 @@ abstract class ###Component###Helper /** * Making strings safe (various ways) * - * @input string The you would like to make safe + * @input string The you would like to make safe * * @returns string on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...); @@ -861,7 +861,7 @@ abstract class ###Component###Helper /** * Convert none English strings to code usable string * - * @input an string + * @input an string * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); @@ -874,7 +874,7 @@ abstract class ###Component###Helper /** * make sure a string is HTML save * - * @input an html string + * @input an html string * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...); @@ -892,7 +892,7 @@ abstract class ###Component###Helper /** * Convert all int in a string to an English word string * - * @input an string with numbers + * @input an string with numbers * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); @@ -906,7 +906,7 @@ abstract class ###Component###Helper * Convert an integer into an English word string * Thanks to Tom Nicholson * - * @input an int + * @input an int * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); */ diff --git a/admin/compiler/joomla_3/Helper_category.php b/admin/compiler/joomla_3/Helper_category.php index ad4ed490c..193ebff3a 100644 --- a/admin/compiler/joomla_3/Helper_category.php +++ b/admin/compiler/joomla_3/Helper_category.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/Helper_category_view.php b/admin/compiler/joomla_3/Helper_category_view.php index 53e2d88d3..ac2046a0e 100644 --- a/admin/compiler/joomla_3/Helper_category_view.php +++ b/admin/compiler/joomla_3/Helper_category_view.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -28,7 +28,7 @@ class ###Component######View###Categories extends JCategories * @param array $options Array of options * */ - public function __construct($options = array()) + public function __construct($options = []) { $options['table'] = '#__###component###_###view###'; $options['extension'] = 'com_###component###.###view###'; diff --git a/admin/compiler/joomla_3/Helper_email.php b/admin/compiler/joomla_3/Helper_email.php index 309817cac..f51347eb9 100644 --- a/admin/compiler/joomla_3/Helper_email.php +++ b/admin/compiler/joomla_3/Helper_email.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,11 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Mail\Mail; +use Joomla\Registry\Registry; + /** * ###Component### component email helper */ @@ -27,28 +32,28 @@ abstract class ###Component###Email * * @var activeRecipient (array) */ - public static $active = array(); + public static $active = []; /** * Configuraiton object * - * @var JConfig + * @var Registry */ - public static $config = null; + public static ?Registry $config = null; /** * Mailer object * - * @var JMail + * @var Mail */ - public static $mailer = null; + public static ?Mail $mailer = null; /** * Custom Headers * * @var array */ - protected static $header = array(); + protected static array $header = []; /** * Get a configuration object @@ -58,7 +63,7 @@ abstract class ###Component###Email { if (!self::$config) { - self::$config = JComponentHelper::getParams('com_###component###'); + self::$config = ComponentHelper::getParams('com_###component###'); } return self::$config; @@ -97,7 +102,7 @@ abstract class ###Component###Email * @static * @access public */ - public static function validateAddress($address, $patternselect = null) + public static function validateAddress($address, $patternselect = null): bool { return self::getMailerInstance()->validateAddress($address, $patternselect); } @@ -105,13 +110,13 @@ abstract class ###Component###Email /** * Get a mailer object. * - * Returns the global {@link JMail} object, only creating it if it doesn't already exist. + * Returns the global {@link Mail} object, only creating it if it doesn't already exist. * - * @return JMail object + * @return Mail object * - * @see JMail + * @see Mail */ - public static function getMailer() + public static function getMailer(): Mail { if (!self::$mailer) { @@ -126,58 +131,58 @@ abstract class ###Component###Email /** * Create a mailer object * - * @return JMail object + * @return Mail object * - * @see JMail + * @see Mail */ - protected static function createMailer() + protected static function createMailer(): Mail { // set component params $conf = self::getConfig(); - + // now load the mailer $mailer = $conf->get('mailer', 'global'); - - // Create a JMail object - $mail = JMail::getInstance(); + + // Create a Mail object + $mail = Mail::getInstance(); // check if set to global if ('global' == $mailer) { // get the global details - $globalConf = JFactory::getConfig(); - - $mailer = $globalConf->get('mailer'); - $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1; - $smtpuser = $globalConf->get('smtpuser'); - $smtppass = $globalConf->get('smtppass'); - $smtphost = $globalConf->get('smtphost'); - $smtpsecure = $globalConf->get('smtpsecure'); - $smtpport = $globalConf->get('smtpport'); - $sendmail = $globalConf->get('sendmail'); - $mailfrom = $globalConf->get('mailfrom'); - $fromname = $globalConf->get('fromname'); - $replyto = $globalConf->get('replyto'); - $replytoname = $globalConf->get('replytoname'); + $globalConf = Factory::getConfig(); + + $mailer = $globalConf->get('mailer'); + $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $globalConf->get('smtpuser'); + $smtppass = $globalConf->get('smtppass'); + $smtphost = $globalConf->get('smtphost'); + $smtpsecure = $globalConf->get('smtpsecure'); + $smtpport = $globalConf->get('smtpport'); + $sendmail = $globalConf->get('sendmail'); + $mailfrom = $globalConf->get('mailfrom'); + $fromname = $globalConf->get('fromname'); + $replyto = $globalConf->get('replyto'); + $replytoname = $globalConf->get('replytoname'); } else { - $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; - $smtpuser = $conf->get('smtpuser'); - $smtppass = $conf->get('smtppass'); - $smtphost = $conf->get('smtphost'); - $smtpsecure = $conf->get('smtpsecure'); - $smtpport = $conf->get('smtpport'); - $sendmail = $conf->get('sendmail'); - $mailfrom = $conf->get('emailfrom'); - $fromname = $conf->get('fromname'); - $replyto = $conf->get('replyto'); - $replytoname = $conf->get('replytoname'); + $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $conf->get('smtpuser'); + $smtppass = $conf->get('smtppass'); + $smtphost = $conf->get('smtphost'); + $smtpsecure = $conf->get('smtpsecure'); + $smtpport = $conf->get('smtpport'); + $sendmail = $conf->get('sendmail'); + $mailfrom = $conf->get('emailfrom'); + $fromname = $conf->get('fromname'); + $replyto = $conf->get('replyto'); + $replytoname = $conf->get('replytoname'); } // Set global sender $mail->setSender(array($mailfrom, $fromname)); - + // set the global reply-to if found if ($replyto && $replytoname) { @@ -226,25 +231,25 @@ abstract class ###Component###Email */ public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null) { - // Get a JMail instance + // Get a Mail instance $mail = self::getMailer(); - + // set component params $conf = self::getConfig(); - + // set if we have override if ($mailfrom && $fromname) { $mail->setSender(array($mailfrom, $fromname)); } - + // load the bounce email as sender if set if (!is_null($bounce_email)) - { + { $mail->Sender = $bounce_email; } - - // Add tag to email to identify it + + // Add tag to email to identify it if (!is_null($idsession)) { $mail->addCustomHeader('X-VDMmethodID:'.$idsession); @@ -262,7 +267,7 @@ abstract class ###Component###Email // set the subject & Body $mail->setSubject($subject); $mail->setBody($body); - + // Are we sending the email as HTML? if ($mode) { @@ -273,7 +278,7 @@ abstract class ###Component###Email //embed images if ($embeded) { - if(###Component###Helper::checkArray($embeds)) + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($embeds)) { foreach($embeds as $embed) { @@ -308,21 +313,21 @@ abstract class ###Component###Email { if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) { - $mail->DKIM_domain = $conf->get('dkim_domain'); - $mail->DKIM_selector = $conf->get('dkim_selector'); - $mail->DKIM_identity = $conf->get('dkim_identity'); - $mail->DKIM_passphrase = $conf->get('dkim_passphrase'); - - $tmp = tempnam(sys_get_temp_dir(), 'VDM'); - $h = fopen($tmp, 'w'); + $mail->DKIM_domain = $conf->get('dkim_domain'); + $mail->DKIM_selector = $conf->get('dkim_selector'); + $mail->DKIM_identity = $conf->get('dkim_identity'); + $mail->DKIM_passphrase = $conf->get('dkim_passphrase'); + + $tmp = tempnam(sys_get_temp_dir(), 'VDM'); + $h = fopen($tmp, 'w'); fwrite($h, $conf->get('dkim_private')); fclose($h); - $mail->DKIM_private = $tmp; + $mail->DKIM_private = $tmp; } } $sendmail = $mail->Send(); - + if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) { @unlink($tmp); @@ -351,7 +356,7 @@ abstract class ###Component###Email /** * Set html text (in a row) and subject (as title) to a email table. * do not use

instead use
- * in your html that you pass to this method + * in your html that you pass to this method * since it is a table row it does not * work well with paragraphs * @@ -360,7 +365,7 @@ abstract class ###Component###Email */ public static function setBasicBody($html, $subject) { - $body = array(); + $body = []; $body[] = ""; $body[] = ""; $body[] = ""; @@ -397,7 +402,7 @@ abstract class ###Component###Email /** * Set html text (in a row) and subject (as title) to a email table. * do not use

instead use
- * in your html that you pass to this method + * in your html that you pass to this method * since it is a table row it does not * work well with paragraphs * @@ -406,7 +411,7 @@ abstract class ###Component###Email */ public static function setTableBody($html, $subject) { - $body = array(); + $body = []; $body[] = ""; $body[] = ""; $body[] = ""; diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index 2f61d0c50..c831a708b 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -29,7 +29,7 @@ abstract class ###Component###Helper * * @var array */ - protected static $composer = array(); + protected static $composer = []; /** * The Main Active Language @@ -99,7 +99,7 @@ abstract class ###Component###Helper // check if set if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -110,9 +110,9 @@ abstract class ###Component###Helper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) @@ -121,22 +121,22 @@ abstract class ###Component###Helper { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } - elseif($params->get("useContributor".$nr) == 2) - { + elseif($params->get("useContributor".$nr) == 2) + { $link_front = ''; $link_back = ''; } - else - { + else + { $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; @@ -145,14 +145,14 @@ abstract class ###Component###Helper /** * Get any component's model */ - public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = []) { // fix the name $name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name); // full path to models $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model'); // make sure the table path is loaded if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path'])) { @@ -160,7 +160,7 @@ abstract class ###Component###Helper $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; } // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); + $model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { @@ -195,14 +195,14 @@ abstract class ###Component###Helper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_###component###'); $parentId = $parent->id; $name = 'com_###component###.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -226,14 +226,14 @@ abstract class ###Component###Helper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else @@ -246,7 +246,7 @@ abstract class ###Component###Helper $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); } } return false; @@ -263,7 +263,7 @@ abstract class ###Component###Helper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -278,8 +278,8 @@ abstract class ###Component###Helper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -294,7 +294,7 @@ abstract class ###Component###Helper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -302,8 +302,8 @@ abstract class ###Component###Helper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -348,7 +348,7 @@ abstract class ###Component###Helper * @return null * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); } @@ -362,7 +362,7 @@ abstract class ###Component###Helper * @return void * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); } @@ -488,7 +488,7 @@ abstract class ###Component###Helper { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__###component###_'.$type.' AS a'); @@ -506,7 +506,7 @@ abstract class ###Component###Helper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getDBO(); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -531,7 +531,7 @@ abstract class ###Component###Helper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions + * @return object The CMSObject of permission/authorised actions * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') @@ -540,22 +540,22 @@ abstract class ###Component###Helper if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getUser(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view); if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views)) { $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views); - } + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; @@ -722,7 +722,7 @@ abstract class ###Component###Helper /** * Check if have an json string * - * @input string The json string to check + * @input string The json string to check * * @returns bool true on success * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); @@ -735,7 +735,7 @@ abstract class ###Component###Helper /** * Check if have an object with a length * - * @input object The object to check + * @input object The object to check * * @returns bool true on success * @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); @@ -748,7 +748,7 @@ abstract class ###Component###Helper /** * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * * @returns bool/int number of items in array on success * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); @@ -761,7 +761,7 @@ abstract class ###Component###Helper /** * Check if have a string with a length * - * @input string The string to check + * @input string The string to check * * @returns bool true on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); @@ -781,7 +781,7 @@ abstract class ###Component###Helper { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -799,7 +799,7 @@ abstract class ###Component###Helper /** * Merge an array of array's * - * @input array The arrays you would like to merge + * @input array The arrays you would like to merge * * @returns array on success * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); @@ -818,7 +818,7 @@ abstract class ###Component###Helper /** * Shorten a string * - * @input string The you would like to shorten + * @input string The you would like to shorten * * @returns string on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...); @@ -831,7 +831,7 @@ abstract class ###Component###Helper /** * Making strings safe (various ways) * - * @input string The you would like to make safe + * @input string The you would like to make safe * * @returns string on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...); @@ -850,7 +850,7 @@ abstract class ###Component###Helper /** * Convert none English strings to code usable string * - * @input an string + * @input an string * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); @@ -863,7 +863,7 @@ abstract class ###Component###Helper /** * make sure a string is HTML save * - * @input an html string + * @input an html string * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...); @@ -881,7 +881,7 @@ abstract class ###Component###Helper /** * Convert all int in a string to an English word string * - * @input an string with numbers + * @input an string with numbers * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); @@ -895,7 +895,7 @@ abstract class ###Component###Helper * Convert an integer into an English word string * Thanks to Tom Nicholson * - * @input an int + * @input an int * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); */ diff --git a/admin/compiler/joomla_3/HtmlView_custom_admin.php b/admin/compiler/joomla_3/HtmlView_custom_admin.php index a7f97fbee..dc0f06ed4 100644 --- a/admin/compiler/joomla_3/HtmlView_custom_admin.php +++ b/admin/compiler/joomla_3/HtmlView_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT### +defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED### -###CUSTOM_ADMIN_VIEW_HTML_HEADER### +###CUSTOM_ADMIN_VIEW_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### /** * ###Component### Html View class for the ###SView### @@ -28,11 +28,11 @@ class ###Component###View###SView### extends HtmlView function display($tpl = null) { // get component params - $this->params = JComponentHelper::getParams('com_###component###'); + $this->params = ComponentHelper::getParams('com_###component###'); // get the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // get global action permissions $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### @@ -43,7 +43,7 @@ class ###Component###View###SView### extends HtmlView protected function setDocument() {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### // add the document default css file - JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### + Html::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### } /** @@ -59,22 +59,22 @@ class ###Component###View###SView### extends HtmlView // Check for empty title and add view name if param is set if (empty($title)) { - $title = JText::_('COM_###COMPONENT###_###SVIEW###'); + $title = Text::_('COM_###COMPONENT###_###SVIEW###'); } // add title to the page - JToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### + ToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_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_###component###'); + ToolbarHelper::preferences('com_###component###'); } }###CUSTOM_ADMIN_GET_MODULE### @@ -88,7 +88,17 @@ class ###Component###View###SView### extends HtmlView public function escape($var) { // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } ?> diff --git a/admin/compiler/joomla_3/HtmlView_edit.php b/admin/compiler/joomla_3/HtmlView_edit.php index 309e298b9..a0c3431a5 100644 --- a/admin/compiler/joomla_3/HtmlView_edit.php +++ b/admin/compiler/joomla_3/HtmlView_edit.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -31,7 +31,7 @@ class ###Component###View###View### extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_###component###'); + $this->params = ComponentHelper::getParams('com_###component###'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -40,7 +40,7 @@ class ###Component###View###View### extends HtmlView // get action permissions $this->canDo = ###Component###Helper::getActions('###view###', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -65,7 +65,7 @@ class ###Component###View###View### extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -99,11 +99,11 @@ class ###Component###View###View### extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); } /** @@ -114,14 +114,20 @@ class ###Component###View###View### extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### - $this->document->addScript(JURI::root() . $this->script, (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); ###DOCUMENT_CUSTOM_PHP### - JText::script('view not acceptable. Error'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); + Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP### + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/HtmlView_edit_site.php b/admin/compiler/joomla_3/HtmlView_edit_site.php index b2fd1f338..070fde9f5 100644 --- a/admin/compiler/joomla_3/HtmlView_edit_site.php +++ b/admin/compiler/joomla_3/HtmlView_edit_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -31,7 +31,7 @@ class ###Component###View###View### extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_###component###'); + $this->params = ComponentHelper::getParams('com_###component###'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -40,7 +40,7 @@ class ###Component###View###View### extends HtmlView // get action permissions $this->canDo = ###Component###Helper::getActions('###view###', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -65,7 +65,7 @@ class ###Component###View###View### extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -86,7 +86,7 @@ class ###Component###View###View### extends HtmlView protected function addToolBar() {###ADDTOOLBAR### // now initiate the toolbar - $this->toolbar = JToolbar::getInstance(); + $this->toolbar = Toolbar::getInstance(); } /** @@ -100,11 +100,11 @@ class ###Component###View###View### extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); } /** @@ -115,11 +115,7 @@ class ###Component###View###View### extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); // only add the ISIS template css & js if needed (default is 1 = true) // you can override this in the global component options // just add a (radio yes/no field) with a name called add_isis_template @@ -127,14 +123,24 @@ class ###Component###View###View### extends HtmlView if ($this->params->get('add_isis_template', 1)) { // we need this to fix the form display (TODO) - $this->document->addStyleSheet(JURI::root() . "administrator/templates/isis/css/template.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); - $this->document->addScript(JURI::root() . "administrator/templates/isis/js/template.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('stylesheet', "administrator/templates/isis/css/template.css", ['version' => 'auto']); + Html::_('script', "administrator/templates/isis/js/template.js", ['version' => 'auto']); } // the default style of this view - $this->document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### + Html::_('stylesheet', "components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### // default javascript of this view - $this->document->addScript(JURI::root(). $this->script, (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); ###DOCUMENT_CUSTOM_PHP### - JText::script('view not acceptable. Error'); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP### + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/HtmlView_import.php b/admin/compiler/joomla_3/HtmlView_import.php index c19e19f8d..9569a7aec 100644 --- a/admin/compiler/joomla_3/HtmlView_import.php +++ b/admin/compiler/joomla_3/HtmlView_import.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; /** * ###Component### Import Html View @@ -31,7 +34,7 @@ class ###Component###ViewImport extends HtmlView protected $dataType; public function display($tpl = null) - { + { if ($this->getLayout() !== 'modal') { // Include helper submenu @@ -44,7 +47,7 @@ class ###Component###ViewImport extends HtmlView $this->paths = &$paths; $this->state = &$state; - // get global action permissions + // get global action permissions $this->canDo = ###Component###Helper::getActions('import'); // We don't need toolbar in the modal window. @@ -55,18 +58,18 @@ class ###Component###ViewImport extends HtmlView } // get the session object - $session = JFactory::getSession(); + $session = Factory::getSession(); // check if it has package - $this->hasPackage = $session->get('hasPackage', false); - $this->dataType = $session->get('dataType', false); + $this->hasPackage = $session->get('hasPackage', false); + $this->dataType = $session->get('dataType', false); if($this->hasPackage && $this->dataType) { - $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); - $this->headers = ###Component###Helper::getFileHeaders($this->dataType); + $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); + $this->headers = ###Component###Helper::getFileHeaders($this->dataType); // clear the data type $session->clear('dataType'); } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -82,19 +85,19 @@ class ###Component###ViewImport extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); JHtmlSidebar::setAction('index.php?option=com_###component###&view=import'); if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); } // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('import'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/compiler/joomla_3/HtmlView_import_custom.php b/admin/compiler/joomla_3/HtmlView_import_custom.php index bee878fc1..68390de5b 100644 --- a/admin/compiler/joomla_3/HtmlView_import_custom.php +++ b/admin/compiler/joomla_3/HtmlView_import_custom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,7 +17,13 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; /** * ###Component### ###View### Html View @@ -30,19 +36,19 @@ class ###Component###View###View### extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); JHtmlSidebar::setAction('index.php?option=com_###component###&view=###view###'); if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); } // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###view###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/compiler/joomla_3/HtmlView_list.php b/admin/compiler/joomla_3/HtmlView_list.php index 740a8c545..f00898087 100644 --- a/admin/compiler/joomla_3/HtmlView_list.php +++ b/admin/compiler/joomla_3/HtmlView_list.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -40,10 +40,10 @@ class ###Component###View###Views### extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser();###ADMIN_DIPLAY_METHOD### + $this->user = Factory::getUser();###ADMIN_DIPLAY_METHOD### $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO### @@ -58,7 +58,7 @@ class ###Component###View###Views### extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -77,32 +77,32 @@ class ###Component###View###Views### extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###'); JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('###view###.add'); + ToolbarHelper::addNew('###view###.add'); } // Only load if there are items - if (###Component###Helper::checkArray($this->items)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('###view###.edit'); + ToolbarHelper::editList('###view###.edit'); } if ($this->canState) { - JToolBarHelper::publishList('###views###.publish'); - JToolBarHelper::unpublishList('###views###.unpublish'); - JToolBarHelper::archiveList('###views###.archive'); + ToolbarHelper::publishList('###views###.publish'); + ToolbarHelper::unpublishList('###views###.unpublish'); + ToolbarHelper::archiveList('###views###.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('###views###.checkin'); + ToolbarHelper::checkin('###views###.checkin'); } } @@ -110,11 +110,11 @@ class ###Component###View###Views### extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -122,25 +122,25 @@ class ###Component###View###Views### extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('###views###.trash'); + ToolbarHelper::trash('###views###.trash'); }###EXPORTBUTTON### }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST######IMPORTBUTTON### // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###views###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_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_###component###'); + ToolbarHelper::preferences('com_###component###'); }###FILTERFIELDDISPLAYHELPER######BATCHDISPLAYHELPER### } @@ -153,10 +153,10 @@ class ###Component###View###Views### extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_###COMPONENT###_###VIEWS###')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###ADMIN_ADD_JAVASCRIPT_FILE### + $this->document->setTitle(Text::_('COM_###COMPONENT###_###VIEWS###')); + Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###views###.css", ['version' => 'auto']);###ADMIN_ADD_JAVASCRIPT_FILE### } /** @@ -171,19 +171,29 @@ class ###Component###View###Views### extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ###Component###Helper::htmlEscape($var, $this->_charset, true); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { ###SORTFIELDS### + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; }###FILTERFUNCTIONS### } diff --git a/admin/compiler/joomla_3/HtmlView_list_custom_admin.php b/admin/compiler/joomla_3/HtmlView_list_custom_admin.php index 171226444..ebea61327 100644 --- a/admin/compiler/joomla_3/HtmlView_list_custom_admin.php +++ b/admin/compiler/joomla_3/HtmlView_list_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -###CUSTOM_ADMIN_VIEWS_HTML_HEADER### +###CUSTOM_ADMIN_VIEWS_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### /** * ###Component### Html View class for the ###SViews### @@ -28,11 +28,11 @@ class ###Component###View###SViews### extends HtmlView function display($tpl = null) { // get component params - $this->params = JComponentHelper::getParams('com_###component###'); + $this->params = ComponentHelper::getParams('com_###component###'); // get the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // get global action permissions $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### @@ -43,7 +43,7 @@ class ###Component###View###SViews### extends HtmlView protected function setDocument() {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### // add the document default css file - JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### + Html::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### } /** @@ -52,19 +52,19 @@ class ###Component###View###SViews### extends HtmlView protected function addToolBar() {###HIDEMAINMENU### // add title to the page - JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### + ToolbarHelper::title(Text::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_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_###component###'); + ToolbarHelper::preferences('com_###component###'); } }###CUSTOM_ADMIN_GET_MODULE### @@ -78,6 +78,16 @@ class ###Component###View###SViews### extends HtmlView public function escape($var) { // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/HtmlView_list_site.php b/admin/compiler/joomla_3/HtmlView_list_site.php index e981783d2..424a6acae 100644 --- a/admin/compiler/joomla_3/HtmlView_list_site.php +++ b/admin/compiler/joomla_3/HtmlView_list_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -###SITE_VIEWS_HTML_HEADER### +###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT### /** * ###Component### Html View class for the ###SViews### @@ -26,13 +26,13 @@ class ###Component###View###SViews### extends HtmlView { // Overwriting JView display method function display($tpl = null) - { + { // get combined params of both component and menu - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->params = $this->app->getParams(); $this->menu = $this->app->getMenu()->getActive(); // get the user object - $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD### + $this->user = Factory::getUser();###SITE_DIPLAY_METHOD### }###SITE_EXTRA_DIPLAY_METHODS### /** @@ -41,7 +41,7 @@ class ###Component###View###SViews### extends HtmlView protected function _prepareDocument() {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### // add the document default css file - JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### + Html::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### } /** @@ -49,15 +49,15 @@ class ###Component###View###SViews### extends HtmlView */ protected function addToolBar() {###SITE_CUSTOM_BUTTONS### - + // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // now initiate the toolbar - $this->toolbar = JToolbar::getInstance(); + $this->toolbar = Toolbar::getInstance(); }###SITE_GET_MODULE### /** @@ -70,6 +70,16 @@ class ###Component###View###SViews### extends HtmlView public function escape($var, $sorten = false, $length = 40) { // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, $sorten, $length); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/HtmlView_site.php b/admin/compiler/joomla_3/HtmlView_site.php index 13bc3fd01..5c4ca5ecd 100644 --- a/admin/compiler/joomla_3/HtmlView_site.php +++ b/admin/compiler/joomla_3/HtmlView_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -###SITE_VIEW_HTML_HEADER### +###SITE_VIEW_HTML_HEADER######SITE_GET_MODULE_JIMPORT### /** * ###Component### Html View class for the ###SView### @@ -26,22 +26,22 @@ class ###Component###View###SView### extends HtmlView { // Overwriting JView display method function display($tpl = null) - { + { // get combined params of both component and menu - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->params = $this->app->getParams(); $this->menu = $this->app->getMenu()->getActive(); // get the user object - $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD### + $this->user = Factory::getUser();###SITE_DIPLAY_METHOD### }###SITE_EXTRA_DIPLAY_METHODS### /** * Prepares the document */ protected function _prepareDocument() - {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### + {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### // add the document default css file - JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### + Html::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### } /** @@ -52,12 +52,12 @@ class ###Component###View###SView### extends HtmlView // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###sview###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // now initiate the toolbar - $this->toolbar = JToolbar::getInstance(); + $this->toolbar = Toolbar::getInstance(); }###SITE_GET_MODULE### /** @@ -70,6 +70,16 @@ class ###Component###View###SView### extends HtmlView public function escape($var, $sorten = false, $length = 40) { // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, $sorten, $length); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/ItemModel_custom_admin.php b/admin/compiler/joomla_3/ItemModel_custom_admin.php index 56f08cab1..c8c49b430 100644 --- a/admin/compiler/joomla_3/ItemModel_custom_admin.php +++ b/admin/compiler/joomla_3/ItemModel_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -31,7 +31,7 @@ class ###Component###Model###SView### extends ItemModel */ protected $_context = 'com_###component###.###sview###'; - /** + /** * Model user data. * * @var strings @@ -61,7 +61,7 @@ class ###Component###Model###SView### extends ItemModel */ protected function populateState() { - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; // Get the item main id $id = $this->input->getInt('id', null); @@ -80,12 +80,12 @@ class ###Component###Model###SView### extends ItemModel */ public function getItem($pk = null) { - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // check if this user has permission to access item if (!$this->user->authorise('###sview###.access', 'com_###component###')) { - $app = JFactory::getApplication(); - $app->enqueueMessage(JText::_('Not authorised!'), 'error'); + $app = Factory::getApplication(); + $app->enqueueMessage(Text::_('Not authorised!'), 'error'); // redirect away if not a correct to cPanel/default view $app->redirect('index.php?option=com_###component###'); return false; @@ -98,10 +98,10 @@ class ###Component###Model###SView### extends ItemModel $this->initSet = true; $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM### - + if ($this->_item === null) { - $this->_item = array(); + $this->_item = []; }###LICENSE_LOCKED_CHECK### if (!isset($this->_item[$pk])) @@ -114,7 +114,7 @@ class ###Component###Model###SView### extends ItemModel if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWarning(404, $e->getMessage()); + JError::raiseError(404, $e->getMessage()); } else { diff --git a/admin/compiler/joomla_3/ItemModel_site.php b/admin/compiler/joomla_3/ItemModel_site.php index 621f2f1c7..ca73e7e3e 100644 --- a/admin/compiler/joomla_3/ItemModel_site.php +++ b/admin/compiler/joomla_3/ItemModel_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -61,7 +61,7 @@ class ###Component###Model###SView### extends ItemModel */ protected function populateState() { - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; // Get the itme main id $id = $this->input->getInt('id', null); @@ -82,7 +82,7 @@ class ###Component###Model###SView### extends ItemModel */ public function getItem($pk = null) { - $this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS### + $this->user = Factory::getUser();###USER_PERMISSION_CHECK_ACCESS### $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); $this->groups = $this->user->get('groups'); @@ -91,10 +91,10 @@ class ###Component###Model###SView### extends ItemModel $this->initSet = true; $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM### - + if ($this->_item === null) { - $this->_item = array(); + $this->_item = []; }###LICENSE_LOCKED_CHECK### if (!isset($this->_item[$pk])) @@ -107,7 +107,7 @@ class ###Component###Model###SView### extends ItemModel if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWarning(404, $e->getMessage()); + JError::raiseError(404, $e->getMessage()); } else { diff --git a/admin/compiler/joomla_3/JFormFieldCheckboxes.php b/admin/compiler/joomla_3/JFormFieldCheckboxes.php index d5a12f4ba..f852886b6 100644 --- a/admin/compiler/joomla_3/JFormFieldCheckboxes.php +++ b/admin/compiler/joomla_3/JFormFieldCheckboxes.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('checkboxes'); @@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldCheckboxes /** * The ###type### field type. * - * @var string + * @var string */ public $type = '###type###'; /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of Html options. */ protected function getOptions() { diff --git a/admin/compiler/joomla_3/JFormFieldCustom.php b/admin/compiler/joomla_3/JFormFieldCustom.php index ee8b72e07..307bc608a 100644 --- a/admin/compiler/joomla_3/JFormFieldCustom.php +++ b/admin/compiler/joomla_3/JFormFieldCustom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,7 +17,7 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); -###JFORM_TYPE_HEADER### +###FORM_CUSTOM_FIELD_HEADER### /** * ###Type### Form Field class for the ###Component### component @@ -27,7 +27,7 @@ class ###JPREFIX###FormField###Type### extends JFormField###JFORM_EXTENDS### /** * The ###type### field type. * - * @var string + * @var string */ - public $type = '###type###';###JFORM_TYPE_PHP### + public $type = '###type###';###FORM_CUSTOM_FIELD_PHP### } diff --git a/admin/compiler/joomla_3/JFormFieldList.php b/admin/compiler/joomla_3/JFormFieldList.php index 5a56cd132..504167838 100644 --- a/admin/compiler/joomla_3/JFormFieldList.php +++ b/admin/compiler/joomla_3/JFormFieldList.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('list'); @@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldList /** * The ###type### field type. * - * @var string + * @var string */ public $type = '###type###';###ADD_BUTTON### /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of Html options. */ protected function getOptions() { diff --git a/admin/compiler/joomla_3/JFormFieldRadio.php b/admin/compiler/joomla_3/JFormFieldRadio.php index ac9412514..75ec4e5c5 100644 --- a/admin/compiler/joomla_3/JFormFieldRadio.php +++ b/admin/compiler/joomla_3/JFormFieldRadio.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('radio'); @@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldRadio /** * The ###type### field type. * - * @var string + * @var string */ public $type = '###type###'; /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of Html options. */ protected function getOptions() { diff --git a/admin/compiler/joomla_3/JFormFieldUser.php b/admin/compiler/joomla_3/JFormFieldUser.php index 4a9966db1..85ed69077 100644 --- a/admin/compiler/joomla_3/JFormFieldUser.php +++ b/admin/compiler/joomla_3/JFormFieldUser.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('user'); @@ -29,7 +33,7 @@ class ###JPREFIX###FormField###Type### extends JFormFieldUser /** * The ###type### field type. * - * @var string + * @var string */ public $type = '###type###'; diff --git a/admin/compiler/joomla_3/JFormRule.php b/admin/compiler/joomla_3/JFormRule.php index 830ed92a0..34b02fefa 100644 --- a/admin/compiler/joomla_3/JFormRule.php +++ b/admin/compiler/joomla_3/JFormRule.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,9 +17,12 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('JPATH_PLATFORM') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\Form\Form; use Joomla\CMS\Form\FormRule; use Joomla\Registry\Registry; +use Joomla\CMS\HTML\HTMLHelper as Html; /** * Form Rule (###Name###) class for the Joomla Platform. diff --git a/admin/compiler/joomla_3/ListModel.php b/admin/compiler/joomla_3/ListModel.php index 2d45037ab..f2d12e963 100644 --- a/admin/compiler/joomla_3/ListModel.php +++ b/admin/compiler/joomla_3/ListModel.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -24,10 +24,10 @@ defined('_JEXEC') or die('Restricted access'); */ class ###Component###Model###Views### extends ListModel { - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) - { + { $config['filter_fields'] = array( ###FILTER_FIELDS### ); @@ -49,7 +49,7 @@ class ###Component###Model###Views### extends ListModel */ protected function populateState($ordering = null, $direction = null) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Adjust the context to support modal layouts. if ($layout = $app->input->get('layout')) @@ -60,7 +60,7 @@ class ###Component###Model###Views### extends ListModel // List state information. parent::populateState($ordering, $direction); } - + /** * Method to get an array of data items. * @@ -70,21 +70,21 @@ class ###Component###Model###Views### extends ListModel {###LICENSE_LOCKED_CHECK######CHECKINCALL### // load parent items $items = parent::getItems();###GET_ITEMS_METHOD_STRING_FIX######SELECTIONTRANSLATIONFIX######GET_ITEMS_METHOD_AFTER_ALL### - + // return items return $items; }###SELECTIONTRANSLATIONFIXFUNC### - + /** * Method to build an SQL query to load the list data. * - * @return string An SQL query + * @return string An SQL query */ protected function getListQuery() {###LICENSE_LOCKED_CHECK### ###LISTQUERY### }###MODELEXPORTMETHOD######LICENSE_LOCKED_SET_BOOL### - + /** * Method to get a store id based on model configuration state. * diff --git a/admin/compiler/joomla_3/ListModelAjax.php b/admin/compiler/joomla_3/ListModelAjax.php index cf9cb916f..18d5f23b7 100644 --- a/admin/compiler/joomla_3/ListModelAjax.php +++ b/admin/compiler/joomla_3/ListModelAjax.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -25,12 +25,12 @@ defined('_JEXEC') or die('Restricted access'); class ###Component###ModelAjax extends ListModel { protected $app_params; - - public function __construct() - { - parent::__construct(); + + public function __construct() + { + parent::__construct(); // get params - $this->app_params = JComponentHelper::getParams('com_###component###'); - + $this->app_params = ComponentHelper::getParams('com_###component###'); + }###AJAX_MODEL_METHODS### } diff --git a/admin/compiler/joomla_3/ListModelAjaxSite.php b/admin/compiler/joomla_3/ListModelAjaxSite.php index 2aacc4948..d02c9bfca 100644 --- a/admin/compiler/joomla_3/ListModelAjaxSite.php +++ b/admin/compiler/joomla_3/ListModelAjaxSite.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -30,7 +30,7 @@ class ###Component###ModelAjax extends ListModel { parent::__construct(); // get params - $this->app_params = JComponentHelper::getParams('com_###component###'); + $this->app_params = ComponentHelper::getParams('com_###component###'); }###AJAX_SITE_MODEL_METHODS### } diff --git a/admin/compiler/joomla_3/ListModelDASH.php b/admin/compiler/joomla_3/ListModelDASH.php index ad8357abb..25f57f5eb 100644 --- a/admin/compiler/joomla_3/ListModelDASH.php +++ b/admin/compiler/joomla_3/ListModelDASH.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -27,9 +27,9 @@ class ###Component###Model###Component### extends ListModel public function getIcons() { // load user for access menus - $user = JFactory::getUser(); + $user = Factory::getUser(); // reset icon array - $icons = array(); + $icons = []; // view groups array $viewGroups = array( 'main' => array(###DASHBOARDICONS###) @@ -38,7 +38,7 @@ class ###Component###Model###Component### extends ListModel foreach($viewGroups as $group => $views) { $i = 0; - if (###Component###Helper::checkArray($views)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($views)) { foreach($views as $view) { @@ -50,11 +50,11 @@ class ###Component###Model###Component### extends ListModel if (count($dwd) == 3) { list($type, $name, $url) = $dwd; - $viewName = $name; - $alt = $name; - $url = $url; - $image = $name . '.' . $type; - $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U'); + $viewName = $name; + $alt = $name; + $url = $url; + $image = $name . '.' . $type; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U'); } } // internal views @@ -76,11 +76,11 @@ class ###Component###Model###Component### extends ListModel switch($action) { case 'add': - $url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit'; - $image = $name . '_' . $action. '.' . $type; - $alt = $name . ' ' . $action; - $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD'; - $add = true; + $url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit'; + $image = $name . '_' . $action. '.' . $type; + $alt = $name . ' ' . $action; + $name = 'COM_###COMPONENT###_DASHBOARD_'.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U').'_ADD'; + $add = true; break; default: // check for new convention (more stable) @@ -93,34 +93,34 @@ class ###Component###Model###Component### extends ListModel { $extension = 'com_###component###.' . $name; } - $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; - $image = $name . '_' . $action . '.' . $type; - $alt = $viewName . ' ' . $action; - $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U') . '_' . ###Component###Helper::safeString($action,'U'); + $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; + $image = $name . '_' . $action . '.' . $type; + $alt = $viewName . ' ' . $action; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U') . '_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($action,'U'); break; } } else { - $viewName = $name; - $alt = $name; - $url = 'index.php?option=com_###component###&view=' . $name; - $image = $name . '.' . $type; - $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U'); - $hover = false; + $viewName = $name; + $alt = $name; + $url = 'index.php?option=com_###component###&view=' . $name; + $image = $name . '.' . $type; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U'); + $hover = false; } } else { - $viewName = $view; - $alt = $view; - $url = 'index.php?option=com_###component###&view=' . $view; - $image = $view . '.png'; - $name = ucwords($view).'

'; - $hover = false; + $viewName = $view; + $alt = $view; + $url = 'index.php?option=com_###component###&view=' . $view; + $image = $view . '.png'; + $name = ucwords($view).'

'; + $hover = false; } // first make sure the view access is set - if (###Component###Helper::checkArray($viewAccess)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($viewAccess)) { // setup some defaults $dashboard_add = false; @@ -128,11 +128,11 @@ class ###Component###Model###Component### extends ListModel $accessTo = ''; $accessAdd = ''; // access checking start - $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false; - $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false; + $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.create']):false; + $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.access']):false; // set main controllers - $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false; - $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false; + $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_add']):false; + $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_list']):false; // check for adding access if ($add && $accessCreate) { @@ -150,64 +150,64 @@ class ###Component###Model###Component### extends ListModel // set main access controllers if ($accessDashboard_add) { - $dashboard_add = $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_###component###'); + $dashboard_add = $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_###component###'); } if ($accessDashboard_list) { $dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###'); } - if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd) && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo)) { // check access if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add) { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } } - elseif (###Component###Helper::checkString($accessTo)) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo)) { // check access if($user->authorise($accessTo, 'com_###component###') && $dashboard_list) { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } } - elseif (###Component###Helper::checkString($accessAdd)) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd)) { // check access if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add) { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } } else { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } } else { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } $i++; } diff --git a/admin/compiler/joomla_3/ListModel_custom_admin.php b/admin/compiler/joomla_3/ListModel_custom_admin.php index d49fcec4a..fd561d58e 100644 --- a/admin/compiler/joomla_3/ListModel_custom_admin.php +++ b/admin/compiler/joomla_3/ListModel_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -46,15 +46,15 @@ class ###Component###Model###SViews### extends ListModel protected function getListQuery() { // Get the current user for authorisation checks - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); $this->groups = $this->user->get('groups'); - $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->levels = $this->user->getAuthorisedViewLevels(); - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; - $this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY### + $this->initSet = true;###CUSTOM_ADMIN_GET_LIST_QUERY### } /** @@ -64,12 +64,12 @@ class ###Component###Model###SViews### extends ListModel */ public function getItems() { - $user = JFactory::getUser(); + $user = Factory::getUser(); // check if this user has permission to access items if (!$user->authorise('###sviews###.access', 'com_###component###')) { - $app = JFactory::getApplication(); - $app->enqueueMessage(JText::_('Not authorised!'), 'error'); + $app = Factory::getApplication(); + $app->enqueueMessage(Text::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) $app->redirect('index.php?option=com_###component###'); return false; @@ -78,7 +78,7 @@ class ###Component###Model###SViews### extends ListModel $items = parent::getItems(); // Get the global params - $globalParams = JComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS### + $globalParams = ComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS### // return items return $items; diff --git a/admin/compiler/joomla_3/ListModel_site.php b/admin/compiler/joomla_3/ListModel_site.php index 441031541..4ccc2f36b 100644 --- a/admin/compiler/joomla_3/ListModel_site.php +++ b/admin/compiler/joomla_3/ListModel_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -46,13 +46,13 @@ class ###Component###Model###SViews### extends ListModel protected function getListQuery() { // Get the current user for authorisation checks - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); $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->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; $this->initSet = true; ###SITE_GET_LIST_QUERY### } @@ -64,12 +64,12 @@ class ###Component###Model###SViews### extends ListModel */ public function getItems() { - $user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS######LICENSE_LOCKED_CHECK######SITE_BEFORE_GET_ITEMS### + $user = Factory::getUser();###USER_PERMISSION_CHECK_ACCESS######LICENSE_LOCKED_CHECK######SITE_BEFORE_GET_ITEMS### // load parent items $items = parent::getItems(); // Get the global params - $globalParams = JComponentHelper::getParams('com_###component###', true);###SITE_GET_ITEMS######SITE_AFTER_GET_ITEMS### + $globalParams = ComponentHelper::getParams('com_###component###', true);###SITE_GET_ITEMS######SITE_AFTER_GET_ITEMS### // return items return $items; diff --git a/admin/compiler/joomla_3/Table.php b/admin/compiler/joomla_3/Table.php index fd286af4b..cacbbf67c 100644 --- a/admin/compiler/joomla_3/Table.php +++ b/admin/compiler/joomla_3/Table.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,10 +17,17 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\Table\Table; +use Joomla\CMS\Access\Access as AccessRules; +use Joomla\CMS\Access\Rules; use Joomla\Registry\Registry; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\String\PunycodeHelper; +use Joomla\CMS\Table\Observer\Tags as TableObserverTags; +use Joomla\CMS\Table\Observer\ContentHistory as TableObserverContenthistory; +use Joomla\CMS\Application\ApplicationHelper; /** * ###Views### Table class @@ -34,60 +41,60 @@ class ###Component###Table###View### extends Table * @since 3.3 */ protected $_jsonEncode = array('params', 'metadata'); - + /** * Constructor * * @param object Database connector object */ - function __construct(&$db) + function __construct(&$db) { parent::__construct('#__###component###_###view###', 'id', $db);###JTABLECONSTRUCTOR######LICENSE_LOCKED_CHECK### - } - + } + public function bind($array, $ignore = '') { - + if (isset($array['params']) && is_array($array['params'])) { - $registry = new JRegistry; + $registry = new Registry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['metadata']) && is_array($array['metadata'])) { - $registry = new JRegistry; + $registry = new Registry; $registry->loadArray($array['metadata']); $array['metadata'] = (string) $registry; } - - // Bind the rules. + + // Bind the rules. if (isset($array['rules']) && is_array($array['rules'])) - { - $rules = new JAccessRules($array['rules']); - $this->setRules($rules); + { + $rules = new AccessRules($array['rules']); + $this->setRules($rules); } return parent::bind($array, $ignore); } - + /** * Overload the store method for the ###View### table. * - * @param boolean Toggle whether null values should be updated. + * @param boolean Toggle whether null values should be updated. * @return boolean True on success, false on failure. * @since 1.6 */ public function store($updateNulls = false) { - $date = JFactory::getDate(); - $user = JFactory::getUser(); + $date = Factory::getDate(); + $user = Factory::getUser(); if ($this->id) { // Existing item - $this->modified = $date->toSql(); - $this->modified_by = $user->get('id'); + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); } else { @@ -102,33 +109,38 @@ class ###Component###Table###View### extends Table $this->created_by = $user->get('id'); } } - + if (isset($this->alias)) { // Verify that the alias is unique - $table = JTable::getInstance('###view###', '###Component###Table'); + $table = Table::getInstance('###view###', '###Component###Table'); if ($table->load(array('alias' => $this->alias###JTABLEALIASCATEGORY###)) && ($table->id != $this->id || $this->id == 0)) { - $this->setError(JText::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS')); + $this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS')); + + if ($table->published === -2) + { + $this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS_TRASHED')); + } return false; } } - + if (isset($this->url)) { // Convert IDN urls to punycode - $this->url = JStringPunycode::urlToPunycode($this->url); + $this->url = PunycodeHelper::urlToPunycode($this->url); } if (isset($this->website)) { // Convert IDN urls to punycode - $this->website = JStringPunycode::urlToPunycode($this->website); + $this->website = PunycodeHelper::urlToPunycode($this->website); } return parent::store($updateNulls); } - + /** * Overloaded check method to ensure data integrity. * @@ -140,20 +152,20 @@ class ###Component###Table###View### extends Table { // Generate a valid alias $this->generateAlias(); - - $table = JTable::getInstance('###view###', '###component###Table'); + + $table = Table::getInstance('###view###', '###component###Table'); while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) { $this->alias = StringHelper::increment($this->alias, 'dash'); } } - + /* * Clean up keywords -- eliminate extra spaces between phrases * and cr (\r) and lf (\n) characters from string. * Only process if not empty. - */ + */ if (!empty($this->metakey)) { // Array of characters to remove. @@ -164,7 +176,7 @@ class ###Component###Table###View### extends Table // Create array using commas as delimiter. $keys = explode(',', $after_clean); - $clean_keys = array(); + $clean_keys = []; foreach ($keys as $key) { @@ -187,13 +199,13 @@ class ###Component###Table###View### extends Table $this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc); } - // If we don't have any access rules set at this point just use an empty JAccessRules class + // If we don't have any access rules set at this point just use an empty AccessRules class if (!$this->getRules()) { $rules = $this->getDefaultAssetValues('com_###component###.###view###.'.$this->id); $this->setRules($rules); } - + // Set ordering if ($this->published < 0) { @@ -209,12 +221,12 @@ class ###Component###Table###View### extends Table * * @param $string $component The component asset name to search for * - * @return JAccessRules The JAccessRules object for the asset + * @return AccessRules The AccessRules object for the asset */ protected function getDefaultAssetValues($component, $try = true) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -225,14 +237,14 @@ class ###Component###Table###View### extends Table { // asset already set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + return AccessRules::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) { $try = explode('.',$component); $result = $this->getDefaultAssetValues($try[0], false); - if ($result instanceof JAccessRules) + if ($result instanceof AccessRules) { if (isset($try[1])) { @@ -249,7 +261,7 @@ class ###Component###Table###View### extends Table else { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -257,8 +269,8 @@ class ###Component###Table###View### extends Table { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules; + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules; $rules->mergeCollection($_result); return $rules; @@ -267,7 +279,7 @@ class ###Component###Table###View### extends Table return $result; } } - return JAccess::getAssetRules(0); + return AccessRules::getAssetRules(0); } /** @@ -275,8 +287,8 @@ class ###Component###Table###View### extends Table * The default name is in the form 'table_name.id' * where id is the value of the primary key of the table. * - * @return string - * @since 2.5 + * @return string + * @since 2.5 */ protected function _getAssetName() { @@ -287,8 +299,8 @@ class ###Component###Table###View### extends Table /** * Method to return the title to use for the asset table. * - * @return string - * @since 2.5 + * @return string + * @since 2.5 */ protected function _getAssetTitle() { @@ -302,12 +314,12 @@ class ###Component###Table###View### extends Table /** * Get the parent asset id for the record * - * @return int - * @since 2.5 + * @return int + * @since 2.5 */ - protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + protected function _getAssetParentId(?Table $table = null, $id = null) { - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName('com_###component###'); return $asset->id; diff --git a/admin/compiler/joomla_3/ajax.json.php b/admin/compiler/joomla_3/ajax.json.php index 6883172ef..54ca2b52a 100644 --- a/admin/compiler/joomla_3/ajax.json.php +++ b/admin/compiler/joomla_3/ajax.json.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,9 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Session\Session; + /** * ###Component### Ajax Controller */ @@ -26,19 +29,19 @@ class ###Component###ControllerAjax extends JControllerLegacy { parent::__construct($config); // make sure all json stuff are set - JFactory::getDocument()->setMimeEncoding( 'application/json' ); - JFactory::getApplication()->setHeader('Content-Disposition','attachment;filename="getajax.json"'); - JFactory::getApplication()->setHeader("Access-Control-Allow-Origin", "*"); + Factory::getDocument()->setMimeEncoding( 'application/json' ); + Factory::getApplication()->setHeader('Content-Disposition','attachment;filename="getajax.json"'); + Factory::getApplication()->setHeader("Access-Control-Allow-Origin", "*"); // load the tasks $this->registerTask('fieldRequired', 'ajax'); } public function ajax() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); + $token = Session::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); if($user->id != 0 && $token == $call_token) { @@ -50,8 +53,8 @@ class ###Component###ControllerAjax extends JControllerLegacy $name = $jinput->get('name', NULL, 'WORD'); $form = $jinput->get('form', NULL, 'WORD'); $status = $jinput->get('status', NULL, 'INT'); - - if (###Component###Helper::checkString($name) && ###Component###Helper::checkString($form)) + + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($name) && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($form)) { $result = $this->getModel('ajax')->setFieldRequired($name,$form,$status); } diff --git a/admin/compiler/joomla_3/ajax.php b/admin/compiler/joomla_3/ajax.php index 198a571f4..9500de486 100644 --- a/admin/compiler/joomla_3/ajax.php +++ b/admin/compiler/joomla_3/ajax.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,27 +17,32 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\Model\ListModel; +use Joomla\CMS\Component\ComponentHelper; + /** * ###Component### Ajax Model */ -class ###Component###ModelAjax extends JModelList +class ###Component###ModelAjax extends ListModel { protected $app_params; public function __construct() - { - parent::__construct(); + { + parent::__construct(); // get params - $this->app_params = JComponentHelper::getParams('com_###component###'); + $this->app_params = ComponentHelper::getParams('com_###component###'); } public function setFieldRequired($name,$form,$status) { // get the session - $session = JFactory::getSession(); + $session = Factory::getSession(); // get this forms set fields $fields = $session->get($form.'_requiredFieldFix'); - if(###Component###Helper::checkArray($fields)) + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($fields)) { if ($status == 1) { @@ -45,7 +50,7 @@ class ###Component###ModelAjax extends JModelList $fields = array_unique($fields); } else - { + { // remove from array if(($key = array_search($name, $fields)) !== false) { @@ -61,7 +66,7 @@ class ###Component###ModelAjax extends JModelList } } // load the remaining values to session - if(###Component###Helper::checkArray($fields)) + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($fields)) { $session->set($form.'_requiredFieldFix', $fields); } diff --git a/admin/compiler/joomla_3/batch_.php b/admin/compiler/joomla_3/batch_.php index 0d8a36c64..ef1abac7f 100644 --- a/admin/compiler/joomla_3/batch_.php +++ b/admin/compiler/joomla_3/batch_.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -30,7 +30,7 @@ abstract class JHtmlBatch_ * @var array * @since 3.0 */ - protected static $ListSelection = array(); + protected static $ListSelection = []; /** * Render the batch selection options. diff --git a/admin/compiler/joomla_3/batchselection.php b/admin/compiler/joomla_3/batchselection.php index 455979edf..d8199d7bb 100644 --- a/admin/compiler/joomla_3/batchselection.php +++ b/admin/compiler/joomla_3/batchselection.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,7 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('JPATH_BASE') or die; +use Joomla\CMS\Language\Text; JHtmlBehavior::core(); $divWrapper = range(1,120,2); $counter = 0; @@ -24,8 +25,8 @@ $counter = 0; ListSelection) : ?>

ListSelection as $ListSelection) : ?> -
-
+
+
-
+
- +
- - -
+ + +
\ No newline at end of file diff --git a/admin/compiler/joomla_3/component_admin.php b/admin/compiler/joomla_3/component_admin.php index 43ddf1f01..cc77f250d 100644 --- a/admin/compiler/joomla_3/component_admin.php +++ b/admin/compiler/joomla_3/component_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -20,25 +20,24 @@ defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### ###ADMIN_COMPONENT_HEADER### // Access check. -if (!JFactory::getUser()->authorise('core.manage', 'com_###component###')) +if (!Factory::getUser()->authorise('core.manage', 'com_###component###')) { - throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); -}; + throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); +} // Add CSS file for all pages -$document = JFactory::getDocument(); -$document->addStyleSheet('components/com_###component###/assets/css/admin.css'); -$document->addScript('components/com_###component###/assets/js/admin.js'); +Html::_('stylesheet', 'components/com_###component###/assets/css/admin.css', ['version' => 'auto']); +Html::_('script', 'components/com_###component###/assets/js/admin.js', ['version' => 'auto']); // require helper files JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL### JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT######ADMIN_GLOBAL_EVENT### // Get an instance of the controller prefixed by ###Component### -$controller = JControllerLegacy::getInstance('###Component###'); +$controller = BaseController::getInstance('###Component###'); // Perform the Request task -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->execute(Factory::getApplication()->input->get('task')); // Redirect if set by the controller $controller->redirect(); diff --git a/admin/compiler/joomla_3/component_site.php b/admin/compiler/joomla_3/component_site.php index 88d3a5de8..cd21c9a13 100644 --- a/admin/compiler/joomla_3/component_site.php +++ b/admin/compiler/joomla_3/component_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -20,19 +20,18 @@ defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### ###SITE_COMPONENT_HEADER### // Set the component css/js -$document = JFactory::getDocument(); -$document->addStyleSheet('components/com_###component###/assets/css/site.css'); -$document->addScript('components/com_###component###/assets/js/site.js'); +Html::_('stylesheet', 'components/com_###component###/assets/css/site.css', ['version' => 'auto']); +Html::_('script', 'components/com_###component###/assets/js/site.js', ['version' => 'auto']); // Require helper files JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL### JLoader::register('###Component###HelperRoute', __DIR__ . '/helpers/route.php');###LICENSE_LOCKED_INT######SITE_GLOBAL_EVENT### // Get an instance of the controller prefixed by ###Component### -$controller = JControllerLegacy::getInstance('###Component###'); +$controller = BaseController::getInstance('###Component###'); // Perform the request task -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->execute(Factory::getApplication()->input->get('task')); // Redirect if set by the controller $controller->redirect(); diff --git a/admin/compiler/joomla_3/dashboard.css b/admin/compiler/joomla_3/dashboard.css index 65aa4e8b2..6502707ff 100644 --- a/admin/compiler/joomla_3/dashboard.css +++ b/admin/compiler/joomla_3/dashboard.css @@ -3,153 +3,153 @@ /* CSS Document */ .dashboard-container { - margin-left: 10px; - margin-top: 10px; - width: 100%; + margin-left: 10px; + margin-top: 10px; + width: 100%; } .dashboard-container [class*="span"] { - display: block; - float: none; - margin-left: 0; - width: auto; + display: block; + float: none; + margin-left: 0; + width: auto; } .dashboard-container:before, .dashboard-container:after { - content: ""; - display: table; + content: ""; + display: table; } .dashboard-container:after { - clear: both; + clear: both; } .dashboard-container [class*="span"] { - box-sizing: border-box; - display: block; - float: left; - min-height: 145px; - min-width: 96px; - width: 100%; + box-sizing: border-box; + display: block; + float: left; + min-height: 145px; + min-width: 96px; + width: 100%; } .dashboard-container [class*="span"]:first-child { - margin-left: 0; + margin-left: 0; } .dashboard-wraper { - background: none repeat scroll 0 0 hsl(0, 0%, 93%); - border-radius: 5px; - float: left; - margin: 1%; - padding: 3px; - width: 17%; - min-height: 194px; - min-width: 96px; + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 5px; + float: left; + margin: 1%; + padding: 3px; + width: 17%; + min-height: 194px; + min-width: 96px; } .dashboard-content a { - background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 85%); - border-radius: 4px; - box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; - color: hsl(0, 0%, 20%); - display: block; - min-height: 89px; - padding: 10px; - text-align: center; - text-decoration: none; + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + min-height: 89px; + padding: 10px; + text-align: center; + text-decoration: none; } .dashboard-content a:hover { - background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - color: hsl(200, 100%, 30%); - text-decoration: none; + background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + color: hsl(200, 100%, 30%); + text-decoration: none; } .dashboard-title { - display: block; - padding-top: 5px; + display: block; + padding-top: 5px; } .dashboard-info { - background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 85%); - border-radius: 4px; - box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; - color: hsl(0, 0%, 20%); - display: block; - font-size: 12px; - padding: 10px; - text-align: center; + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + font-size: 12px; + padding: 10px; + text-align: center; } .dashboard-info span { - display: block; - text-align: center; + display: block; + text-align: center; } .dashboard-info img { - margin: 0 auto; + margin: 0 auto; } .dashboard-table { - border-top: 1px solid hsl(0, 0%, 87%); - margin-top: 5px; - width: 100%; + border-top: 1px solid hsl(0, 0%, 87%); + margin-top: 5px; + width: 100%; } .dashboard-info h5 { - font-size: 11px; - font-weight: bold; + font-size: 11px; + font-weight: bold; } .dashboard-block { - background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 76%); - border-radius: 3px; - box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; - margin-bottom: 20px; + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 76%); + border-radius: 3px; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; + margin-bottom: 20px; } .dashboard-block .dashboard-block-head { - background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border-bottom: 1px solid hsl(0, 0%, 76%); - border-radius: 3px 3px 0 0; - box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); - height: 40px; - position: relative; + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border-bottom: 1px solid hsl(0, 0%, 76%); + border-radius: 3px 3px 0 0; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); + height: 40px; + position: relative; } .dashboard-block .dashboard-block-head h5 { - font-size: 12px; - margin: 0; - padding-left: 10px; - padding-top: 11px; - text-transform: uppercase; + font-size: 12px; + margin: 0; + padding-left: 10px; + padding-top: 11px; + text-transform: uppercase; } .dashboard-block .dashboard-block-content { - background: none repeat scroll 0 0 hsl(0, 0%, 93%); - border-radius: 0 0 3px 3px; + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 0 0 3px 3px; } .dashboard-block .dashboard-block-box { - background: none repeat scroll 0 0 hsl(0, 0%, 100%); - border-top: 1px solid hsl(0, 0%, 82%); - box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; + background: none repeat scroll 0 0 hsl(0, 0%, 100%); + border-top: 1px solid hsl(0, 0%, 82%); + box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; } .dashboard-block .dashboard-block-content .dashboard-block-box { - margin-top: 0 !important; + margin-top: 0 !important; } .dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table { - margin-bottom: 0 !important; + margin-bottom: 0 !important; } .dashboard-block-table { - background-color: hsla(0, 0%, 0%, 0); - border-collapse: collapse; - border-spacing: 0; - margin-bottom: 20px; - max-width: 100%; - width: 100%; + background-color: hsla(0, 0%, 0%, 0); + border-collapse: collapse; + border-spacing: 0; + margin-bottom: 20px; + max-width: 100%; + width: 100%; } .dashboard-block-table th, .dashboard-block-table td { - border-top: 1px solid hsl(0, 0%, 87%); - line-height: 20px; - padding: 5px; - text-align: left; - vertical-align: middle; + border-top: 1px solid hsl(0, 0%, 87%); + line-height: 20px; + padding: 5px; + text-align: left; + vertical-align: middle; } .dashboard-badge { - background-color: hsl(0, 0%, 60%); - border-radius: 9px; - color: hsl(0, 0%, 100%); - font-size: 11.844px; - font-weight: bold; - line-height: 14px; - padding: 1px 9px 2px; - text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); - vertical-align: baseline; - white-space: nowrap; + background-color: hsl(0, 0%, 60%); + border-radius: 9px; + color: hsl(0, 0%, 100%); + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + padding: 1px 9px 2px; + text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); + vertical-align: baseline; + white-space: nowrap; } \ No newline at end of file diff --git a/admin/compiler/joomla_3/default.php b/admin/compiler/joomla_3/default.php index 0166c0fb8..8eecd5d99 100644 --- a/admin/compiler/joomla_3/default.php +++ b/admin/compiler/joomla_3/default.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### ###ADMIN_VIEWS_HEADER### + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_###component###&task=###views###.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', '###view###List', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', '###view###List', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> ###VIEWS_DEFAULT_BODY######VIEWS_FOOTER_SCRIPT### diff --git a/admin/compiler/joomla_3/default_batch_body.php b/admin/compiler/joomla_3/default_batch_body.php index a1fe1378e..ec4f6be38 100644 --- a/admin/compiler/joomla_3/default_batch_body.php +++ b/admin/compiler/joomla_3/default_batch_body.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/compiler/joomla_3/default_batch_footer.php b/admin/compiler/joomla_3/default_batch_footer.php index 7964422a5..73d7824e9 100644 --- a/admin/compiler/joomla_3/default_batch_footer.php +++ b/admin/compiler/joomla_3/default_batch_footer.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,12 +17,14 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/compiler/joomla_3/default_body.php b/admin/compiler/joomla_3/default_body.php index 5db8ffb81..d5c40e434 100644 --- a/admin/compiler/joomla_3/default_body.php +++ b/admin/compiler/joomla_3/default_body.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_###component###&view=###views###&task=###view###.edit"; ?> diff --git a/admin/compiler/joomla_3/default_custom_admin.php b/admin/compiler/joomla_3/default_custom_admin.php index 925f748c9..c68079a4d 100644 --- a/admin/compiler/joomla_3/default_custom_admin.php +++ b/admin/compiler/joomla_3/default_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -18,11 +18,11 @@ defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### ###CUSTOM_ADMIN_VIEW_HEADER######CUSTOM_ADMIN_CODE_BODY### + ?> canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### item->id)) ? '&id='. (int) $this->item->id : ''; ?> ###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM### -

+

- diff --git a/admin/compiler/joomla_3/default_custom_admin_template.php b/admin/compiler/joomla_3/default_custom_admin_template.php index 3b5ea3e22..de8533c69 100644 --- a/admin/compiler/joomla_3/default_custom_admin_template.php +++ b/admin/compiler/joomla_3/default_custom_admin_template.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -15,6 +15,10 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_TEMPLATE_CODE_BODY### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html;###CUSTOM_ADMIN_TEMPLATE_CODE_BODY### ?>###CUSTOM_ADMIN_TEMPLATE_BODY### diff --git a/admin/compiler/joomla_3/default_foot.php b/admin/compiler/joomla_3/default_foot.php index 725eba045..93585b9b7 100644 --- a/admin/compiler/joomla_3/default_foot.php +++ b/admin/compiler/joomla_3/default_foot.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/default_head.php b/admin/compiler/joomla_3/default_head.php index 894d421fe..72243e3e8 100644 --- a/admin/compiler/joomla_3/default_head.php +++ b/admin/compiler/joomla_3/default_head.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,5 +17,8 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> ###LISTHEAD### \ No newline at end of file diff --git a/admin/compiler/joomla_3/default_import.php b/admin/compiler/joomla_3/default_import.php index 1cab7a6c4..ba0519b09 100644 --- a/admin/compiler/joomla_3/default_import.php +++ b/admin/compiler/joomla_3/default_import.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,13 +17,17 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?>
-
+ sidebar)) : ?>
@@ -137,13 +141,13 @@ jQuery(document).ready(function($) {
- hasPackage && ###Component###Helper::checkArray($this->headerList) && ###Component###Helper::checkArray($this->headers)) : ?> + hasPackage && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headerList) && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headers)) : ?>
- +
- +
- +
headerList as $name => $title): ?> @@ -151,72 +155,72 @@ jQuery(document).ready(function($) {
- +
- 'upload')); ?> - - + 'upload')); ?> + +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- - - + + +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- + - +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- - + + - +
\ No newline at end of file diff --git a/admin/compiler/joomla_3/default_import_custom.php b/admin/compiler/joomla_3/default_import_custom.php index 6329fd18b..04bc64bdc 100644 --- a/admin/compiler/joomla_3/default_import_custom.php +++ b/admin/compiler/joomla_3/default_import_custom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,8 +17,13 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?>###IMPORT_DEFAULT_VIEW_CUSTOM### diff --git a/admin/compiler/joomla_3/default_list_custom_admin.php b/admin/compiler/joomla_3/default_list_custom_admin.php index 3f6dd6fb1..a3d41a83f 100644 --- a/admin/compiler/joomla_3/default_list_custom_admin.php +++ b/admin/compiler/joomla_3/default_list_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -22,5 +22,5 @@ defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### ###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM### -

+

diff --git a/admin/compiler/joomla_3/default_list_site.php b/admin/compiler/joomla_3/default_list_site.php index 936804bd2..62479ff87 100644 --- a/admin/compiler/joomla_3/default_list_site.php +++ b/admin/compiler/joomla_3/default_list_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/default_main.php b/admin/compiler/joomla_3/default_main.php index 4bde280d1..5bec37199 100644 --- a/admin/compiler/joomla_3/default_main.php +++ b/admin/compiler/joomla_3/default_main.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,19 +17,21 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> icons['main']) && is_array($this->icons['main'])) :?> icons['main'] as $icon): ?>
-
-

+

\ No newline at end of file diff --git a/admin/compiler/joomla_3/default_site.php b/admin/compiler/joomla_3/default_site.php index 61864331f..6ab8f1a3a 100644 --- a/admin/compiler/joomla_3/default_site.php +++ b/admin/compiler/joomla_3/default_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/default_site_template.php b/admin/compiler/joomla_3/default_site_template.php index 55687f70a..337f5b7ca 100644 --- a/admin/compiler/joomla_3/default_site_template.php +++ b/admin/compiler/joomla_3/default_site_template.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -15,6 +15,10 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_TEMPLATE_CODE_BODY### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper;###SITE_TEMPLATE_CODE_BODY### ?>###SITE_TEMPLATE_BODY### diff --git a/admin/compiler/joomla_3/default_toolbar.php b/admin/compiler/joomla_3/default_toolbar.php index c608f71e0..ba3d37eb1 100644 --- a/admin/compiler/joomla_3/default_toolbar.php +++ b/admin/compiler/joomla_3/default_toolbar.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,34 +17,37 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/compiler/joomla_3/default_vdm.php b/admin/compiler/joomla_3/default_vdm.php index ec4349bd6..4f12c9cab 100644 --- a/admin/compiler/joomla_3/default_vdm.php +++ b/admin/compiler/joomla_3/default_vdm.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,22 +17,24 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> -<?php echo JText::_('COM_###COMPONENT###'); ?> +<?php echo Text::_('COM_###COMPONENT###'); ?>
-contributors)): ?> +contributors)): ?> contributors) > 1): ?> -

+

-

+

    contributors as $contributor): ?> diff --git a/admin/compiler/joomla_3/edit.php b/admin/compiler/joomla_3/edit.php index 86edbead4..fa2f7ff82 100644 --- a/admin/compiler/joomla_3/edit.php +++ b/admin/compiler/joomla_3/edit.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access'); ###ADMIN_VIEW_HEADER### + $componentParams = $this->params; // will be removed just use $this->params instead ?> ###EDITBODYFADEIN### -
    + ###EDITBODY###
###EDITBODYSCRIPT### diff --git a/admin/compiler/joomla_3/edit_site.php b/admin/compiler/joomla_3/edit_site.php index 7a6efb4f7..a398e73e7 100644 --- a/admin/compiler/joomla_3/edit_site.php +++ b/admin/compiler/joomla_3/edit_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access'); ###SITE_ADMIN_VIEW_HEADER### + ?>
toolbar->render(); ?> -
+ ###EDITBODY###
###EDITBODYSCRIPT### diff --git a/admin/compiler/joomla_3/headercheck.php b/admin/compiler/joomla_3/headercheck.php index 6dcee6c35..36d0e0d04 100644 --- a/admin/compiler/joomla_3/headercheck.php +++ b/admin/compiler/joomla_3/headercheck.php @@ -1,24 +1,24 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - + @package Component Builder + @subpackage componentbuilder.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + /-----------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file @@ -29,24 +29,36 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; + class ###component###HeaderCheck { + protected $document = null; + protected $app = null; + function js_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['scripts']) as $script) { if (stristr($script, $script_name)) @@ -57,24 +69,30 @@ class ###component###HeaderCheck return false; } - + function css_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); - + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['styleSheets']) as $script) { if (stristr($script, $script_name)) diff --git a/admin/compiler/joomla_3/headercheck_admin.php b/admin/compiler/joomla_3/headercheck_admin.php index 402101246..7955eb0e0 100644 --- a/admin/compiler/joomla_3/headercheck_admin.php +++ b/admin/compiler/joomla_3/headercheck_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,24 +17,36 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; + class ###component###HeaderCheck { + protected $document = null; + protected $app = null; + function js_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['scripts']) as $script) { if (stristr($script, $script_name)) @@ -45,24 +57,30 @@ class ###component###HeaderCheck return false; } - + function css_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); - + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['styleSheets']) as $script) { if (stristr($script, $script_name)) @@ -73,4 +91,4 @@ class ###component###HeaderCheck return false; } -} \ No newline at end of file +} diff --git a/admin/compiler/joomla_3/import.gif b/admin/compiler/joomla_3/import.gif index 4371cc618..10bcb8569 100644 Binary files a/admin/compiler/joomla_3/import.gif and b/admin/compiler/joomla_3/import.gif differ diff --git a/admin/compiler/joomla_3/layout.php b/admin/compiler/joomla_3/layout.php index 2a1d95ed8..d7af88c11 100644 --- a/admin/compiler/joomla_3/layout.php +++ b/admin/compiler/joomla_3/layout.php @@ -1,24 +1,24 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - + @package Component Builder + @subpackage componentbuilder.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + /-----------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file @@ -46,7 +46,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/layout_admin.php b/admin/compiler/joomla_3/layout_admin.php index c9c13b2cd..5188aec67 100644 --- a/admin/compiler/joomla_3/layout_admin.php +++ b/admin/compiler/joomla_3/layout_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/layout_custom_admin.php b/admin/compiler/joomla_3/layout_custom_admin.php index c26e133cc..12e0c32d7 100644 --- a/admin/compiler/joomla_3/layout_custom_admin.php +++ b/admin/compiler/joomla_3/layout_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/layout_site.php b/admin/compiler/joomla_3/layout_site.php index 31edafa09..cd8bd0548 100644 --- a/admin/compiler/joomla_3/layout_site.php +++ b/admin/compiler/joomla_3/layout_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/layoutfull.php b/admin/compiler/joomla_3/layoutfull.php index e6b6cc02a..bdc3cda15 100644 --- a/admin/compiler/joomla_3/layoutfull.php +++ b/admin/compiler/joomla_3/layoutfull.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/layoutitems.php b/admin/compiler/joomla_3/layoutitems.php index 1314a034e..b58e0dcf4 100644 --- a/admin/compiler/joomla_3/layoutitems.php +++ b/admin/compiler/joomla_3/layoutitems.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/layoutlinkedview.php b/admin/compiler/joomla_3/layoutlinkedview.php index 86c99b879..5ab1010a0 100644 --- a/admin/compiler/joomla_3/layoutlinkedview.php +++ b/admin/compiler/joomla_3/layoutlinkedview.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,9 +17,13 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // set the defaults $items = $displayData->###LAYOUTITEMS###; -$user = JFactory::getUser(); +$user = Factory::getUser(); $id = $displayData->item->id; ###LAYOUTITEMSHEADER### diff --git a/admin/compiler/joomla_3/layoutmetadata.php b/admin/compiler/joomla_3/layoutmetadata.php index d19a24cb1..3c465bddb 100644 --- a/admin/compiler/joomla_3/layoutmetadata.php +++ b/admin/compiler/joomla_3/layoutmetadata.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + $form = $displayData->getForm(); // JLayout for standard handling of metadata fields in the administrator content edit screens. @@ -25,7 +27,7 @@ $fieldSets = $form->getFieldsets('metadata'); $fieldSet) : ?> description) && trim($fieldSet->description)) : ?> -

escape(JText::_($fieldSet->description)); ?>

+

escape(Text::_($fieldSet->description)); ?>

- * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/layoutpublished.php b/admin/compiler/joomla_3/layoutpublished.php index 1314a034e..b58e0dcf4 100644 --- a/admin/compiler/joomla_3/layoutpublished.php +++ b/admin/compiler/joomla_3/layoutpublished.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/layouttitle.php b/admin/compiler/joomla_3/layouttitle.php index 95149e8c8..2afa93ac1 100644 --- a/admin/compiler/joomla_3/layouttitle.php +++ b/admin/compiler/joomla_3/layouttitle.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/module_forms.js b/admin/compiler/joomla_3/module_forms.js index ec598c680..4bf5019bf 100644 --- a/admin/compiler/joomla_3/module_forms.js +++ b/admin/compiler/joomla_3/module_forms.js @@ -1,3 +1,3 @@ ###BOM### -###VIEW_SCRIPT### +###VIEW_SCRIPT### diff --git a/admin/compiler/joomla_3/module_forms.xml b/admin/compiler/joomla_3/module_forms.xml index a31e5d4ac..8028c6880 100644 --- a/admin/compiler/joomla_3/module_forms.xml +++ b/admin/compiler/joomla_3/module_forms.xml @@ -4,6 +4,6 @@ addfieldpath="/administrator/components/com_###component###/models/fields" > ###FIELDSETS### - + ###ACCESSCONTROL### \ No newline at end of file diff --git a/admin/compiler/joomla_3/routeHelper.php b/admin/compiler/joomla_3/routeHelper.php index d28c1c0ec..afa52631f 100644 --- a/admin/compiler/joomla_3/routeHelper.php +++ b/admin/compiler/joomla_3/routeHelper.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,6 +17,13 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Language\Multilanguage; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Categories\CategoryNode; +use Joomla\CMS\Categories\Categories; + /** * ###Component### Route Helper **/ @@ -27,7 +34,7 @@ abstract class ###Component###HelperRoute /** * Get the URL route for ###component### category from a category ID and language * - * @param mixed $catid The id of the items's category either an integer id or a instance of JCategoryNode + * @param mixed $catid The id of the items's category either an integer id or a instance of CategoryNode * @param mixed $language The id of the language being used. * * @return string The link to the contact @@ -36,20 +43,20 @@ abstract class ###Component###HelperRoute */ public static function getCategoryRoute_keep_for_later($catid, $language = 0) { - if ($catid instanceof JCategoryNode) + if ($catid instanceof CategoryNode) { - $id = $catid->id; - $category = $catid; + $id = $catid->id; + $category = $catid; } else - { - throw new Exception('First parameter must be JCategoryNode'); + { + throw new Exception('First parameter must be CategoryNode'); } - + $views = array(###ROUTER_CATEGORY_VIEWS###); $view = $views[$category->extension]; - - if ($id < 1 || !($category instanceof JCategoryNode)) + + if ($id < 1 || !($category instanceof CategoryNode)) { $link = ''; } @@ -57,20 +64,20 @@ abstract class ###Component###HelperRoute { //Create the link $link = 'index.php?option=com_###component###&view='.$view.'&category='.$category->slug; - + $needles = array( $view => array($id), 'category' => array($id) ); - - if ($language && $language != "*" && JLanguageMultilang::isEnabled()) + + if ($language && $language != "*" && Multilanguage::isEnabled()) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) + $db = Factory::getDbo(); + $query = $db->getQuery(true) ->select('a.sef AS sef') ->select('a.lang_code AS lang_code') ->from('#__languages AS a'); - + $db->setQuery($query); $langs = $db->loadObjectList(); foreach ($langs as $lang) @@ -82,11 +89,11 @@ abstract class ###Component###HelperRoute } } } - + if ($item = self::_findItem($needles,'category')) { - $link .= '&Itemid='.$item; + $link .= '&Itemid='.$item; } else { @@ -112,16 +119,16 @@ abstract class ###Component###HelperRoute protected static function _findItem($needles = null,$type = null) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $menus = $app->getMenu('site'); $language = isset($needles['language']) ? $needles['language'] : '*'; // Prepare the reverse lookup array. if (!isset(self::$lookup[$language])) { - self::$lookup[$language] = array(); + self::$lookup[$language] = []; - $component = JComponentHelper::getComponent('com_###component###'); + $component = ComponentHelper::getComponent('com_###component###'); $attributes = array('component_id'); $values = array($component->id); @@ -142,7 +149,7 @@ abstract class ###Component###HelperRoute if (!isset(self::$lookup[$language][$view])) { - self::$lookup[$language][$view] = array(); + self::$lookup[$language][$view] = []; } if (isset($item->query['id'])) @@ -171,7 +178,7 @@ abstract class ###Component###HelperRoute { if (isset(self::$lookup[$language][$view])) { - if (###Component###Helper::checkArray($ids)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($ids)) { foreach ($ids as $id) { @@ -192,7 +199,7 @@ abstract class ###Component###HelperRoute if ($type) { // Check if the global menu item has been set. - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); if ($item = $params->get($type.'_menu', 0)) { return $item; @@ -204,7 +211,7 @@ abstract class ###Component###HelperRoute if ($active && $active->component == 'com_###component###' - && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled())) + && ($language == '*' || in_array($active->language, array('*', $language)) || !Multilanguage::isEnabled())) { return $active->id; } diff --git a/admin/compiler/joomla_3/router.php b/admin/compiler/joomla_3/router.php index 6bd91af36..834ab4e37 100644 --- a/admin/compiler/joomla_3/router.php +++ b/admin/compiler/joomla_3/router.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ @@ -17,13 +17,16 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Component\ComponentHelper; + /** * Routing class from com_###component### * * @since 3.3 */ class ###Component###Router extends JComponentRouterBase -{ +{ /** * Build the route for the com_###component### component * @@ -35,11 +38,11 @@ class ###Component###Router extends JComponentRouterBase */ public function build(&$query) { - $segments = array(); + $segments = []; // Get a menu item based on Itemid or currently active - $params = JComponentHelper::getParams('com_###component###'); - + $params = ComponentHelper::getParams('com_###component###'); + if (empty($query['Itemid'])) { $menuItem = $this->menu->getActive(); @@ -63,7 +66,7 @@ class ###Component###Router extends JComponentRouterBase unset($query['view']); } - + // Are we dealing with a item that is attached to a menu item? if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == (int) $query['id'])) { @@ -93,7 +96,7 @@ class ###Component###Router extends JComponentRouterBase } unset($query['id']); } - + $total = count($segments); for ($i = 0; $i < $total; $i++) @@ -101,8 +104,8 @@ class ###Component###Router extends JComponentRouterBase $segments[$i] = str_replace(':', '-', $segments[$i]); } - return $segments; - + return $segments; + } /** @@ -115,17 +118,17 @@ class ###Component###Router extends JComponentRouterBase * @since 3.3 */ public function parse(&$segments) - { + { $count = count($segments); - $vars = array(); - + $vars = []; + // Handle View and Identifier switch($segments[0]) {###ROUTER_PARSE_SWITCH### } return $vars; - } + } protected function getVar($table, $where = null, $whereString = null, $what = null, $category = false, $operator = '=', $main = '###component###') { @@ -134,7 +137,7 @@ class ###Component###Router extends JComponentRouterBase return false; } // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -150,7 +153,7 @@ class ###Component###Router extends JComponentRouterBase { // we must check if the table exist (TODO not ideal) $tables = $db->getTableList(); - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $prefix = $app->get('dbprefix'); $check = $prefix.$main.'_'.$table; if (in_array($check, $tables)) @@ -192,7 +195,7 @@ class ###Component###Router extends JComponentRouterBase } return false; } - + protected function checkString($string) { if (isset($string) && is_string($string) && strlen($string) > 0) @@ -206,7 +209,7 @@ class ###Component###Router extends JComponentRouterBase function ###Component###BuildRoute(&$query) { $router = new ###Component###Router; - + return $router->build($query); } diff --git a/admin/compiler/joomla_3/router_4.php b/admin/compiler/joomla_3/router_4.php index 72b9168c2..c03d0f2f4 100644 --- a/admin/compiler/joomla_3/router_4.php +++ b/admin/compiler/joomla_3/router_4.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_3/script.php b/admin/compiler/joomla_3/script.php index 7240aed62..2b16ff45d 100644 --- a/admin/compiler/joomla_3/script.php +++ b/admin/compiler/joomla_3/script.php @@ -17,20 +17,24 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Installer\Adapter\ComponentAdapter; -JHTML::_('bootstrap.renderModal'); +use Joomla\CMS\Version; +use Joomla\CMS\HTML\HTMLHelper as Html; +HTML::_('bootstrap.renderModal'); /** * Script File of ###Component### Component */ -class com_###component###InstallerScript +class Com_###Component###InstallerScript { /** * Constructor * - * @param JAdapterInstance $parent The object responsible for running this script + * @param ComponentAdapter $parent The object responsible for running this script */ public function __construct(ComponentAdapter $parent) {} @@ -78,14 +82,14 @@ class com_###component###InstallerScript public function preflight($type, ComponentAdapter $parent) { // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // is redundant or so it seems ...hmmm let me know if it works again if ($type === 'uninstall') { return true; } // the default for both install and update - $jversion = new JVersion(); + $jversion = new Version(); if (!$jversion->isCompatible('3.8.0')) { $app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error'); @@ -121,7 +125,7 @@ class com_###component###InstallerScript public function postflight($type, ComponentAdapter $parent) { // get application - $app = JFactory::getApplication();###MOVEFOLDERSSCRIPT### + $app = Factory::getApplication();###MOVEFOLDERSSCRIPT### // set the default component settings if ($type === 'install') {###POSTINSTALLSCRIPT### @@ -135,12 +139,12 @@ class com_###component###InstallerScript /** * Remove folders with files - * + * * @param string $dir The path to folder to remove * @param boolean $ignore The folders and files to ignore and not remove * * @return boolean True in all is removed - * + * */ protected function removeFolder($dir, $ignore = false) { @@ -209,7 +213,7 @@ class com_###component###InstallerScript /** * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * * @returns bool/int number of items in array on success */ diff --git a/admin/compiler/joomla_3/settings_componentbuilder.json b/admin/compiler/joomla_3/settings_componentbuilder.json deleted file mode 100644 index 79cbabbfa..000000000 --- a/admin/compiler/joomla_3/settings_componentbuilder.json +++ /dev/null @@ -1,790 +0,0 @@ -{ - "create": { - "admin": { - "assets": { - "css": "css", - "images": { - "icons": "icons" - }, - "js": "js" - }, - "controllers": "controllers", - "helpers": { - "html": "html" - }, - "language": { - "en-GB": "en-GB" - }, - "layouts": "layouts", - "models": { - "fields": "fields", - "forms": "forms", - "rules": "rules" - }, - "sql": { - "updates": { - "mysql": "mysql" - } - }, - "tables": "tables", - "views": "views" - }, - "site": { - "assets": { - "css": "css", - "images": "images", - "js": "js" - }, - "controllers": "controllers", - "helpers": "helpers", - "language": { - "en-GB": "en-GB" - }, - "layouts": "layouts", - "models": "models", - "views": "views" - }, - "media": { - "css": "css", - "images": "images", - "js": "js" - } - }, - "move": { - "static": { - "access.xml": { - "naam": "access.xml", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "config.xml": { - "naam": "config.xml", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "BaseController.php": { - "naam": "BaseController.php", - "path": "c0mp0n3nt/admin", - "rename": "new", - "newName": "controller.php", - "type": "file" - }, - "component.xml": { - "naam": "component.xml", - "path": "c0mp0n3nt/", - "rename": "component", - "type": "file" - }, - "component_admin.php": { - "naam": "component_admin.php", - "path": "c0mp0n3nt/admin", - "rename": "component_admin", - "type": "file" - }, - "admin.css": { - "naam": "admin.css", - "path": "c0mp0n3nt/admin/assets/css", - "rename": false, - "type": "file" - }, - "admin.js": { - "naam": "admin.js", - "path": "c0mp0n3nt/admin/assets/js", - "rename": false, - "type": "file" - }, - "site.css": { - "naam": "site.css", - "path": "c0mp0n3nt/site/assets/css", - "rename": false, - "type": "file" - }, - "site.js": { - "naam": "site.js", - "path": "c0mp0n3nt/site/assets/js", - "rename": false, - "type": "file" - }, - "batch_.php": { - "naam": "batch_.php", - "path": "c0mp0n3nt/admin/helpers/html", - "rename": false, - "type": "file" - }, - "batchselection.php": { - "naam": "batchselection.php", - "path": "c0mp0n3nt/admin/layouts", - "rename": false, - "type": "file" - }, - "component_site.php": { - "naam": "component_site.php", - "path": "c0mp0n3nt/site", - "rename": "component_site", - "type": "file" - }, - "router.php": { - "naam": "router.php", - "path": "c0mp0n3nt/site", - "rename": false, - "type": "file" - }, - "routeHelper.php": { - "naam": "routeHelper.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "new", - "newName": "route.php", - "type": "file" - }, - "BaseControllerSITE.php": { - "naam": "BaseControllerSITE.php", - "path": "c0mp0n3nt/site", - "rename": "new", - "newName": "controller.php", - "type": "file" - }, - "Helper.php": { - "naam": "JCB_Helper.php", - "path": "c0mp0n3nt/admin/helpers", - "rename": "JCB_Helper", - "type": "file" - }, - "Helper_site.php": { - "naam": "JCB_Helper_site.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "JCB_Helper_site", - "type": "file" - }, - "Helper_category.php": { - "naam": "Helper_category.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "new", - "newName": "category.php", - "type": "file" - }, - "script.php": { - "naam": "script.php", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "install.mysql.utf8.sql": { - "naam": "install.mysql.utf8.sql", - "path": "c0mp0n3nt/admin/sql", - "rename": false, - "type": "file" - }, - "uninstall.mysql.utf8.sql": { - "naam": "uninstall.mysql.utf8.sql", - "path": "c0mp0n3nt/admin/sql", - "rename": false, - "type": "file" - }, - "headercheck_admin.php": { - "naam": "headercheck_admin.php", - "path": "c0mp0n3nt/admin/helpers", - "rename": "new", - "newName": "headercheck.php", - "type": "file" - }, - "LICENSE.txt": { - "naam": "LICENSE.txt", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "README.txt": { - "naam": "README.txt", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "README.md": { - "naam": "README.md", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "CHANGELOG.md": { - "naam": "CHANGELOG.md", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "headercheck.php": { - "naam": "headercheck.php", - "path": "c0mp0n3nt/site/helpers", - "rename": false, - "type": "file" - }, - "import.gif": { - "naam": "import.gif", - "path": "c0mp0n3nt/admin/assets/images", - "rename": false, - "type": "file" - } - }, - "dynamic": { - "admin": { - "whmcs.php": { - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "whmcs" - }, - "Helper_email.php": { - "path": "c0mp0n3nt/admin/helpers", - "rename": "Helper_", - "type": "emailer" - }, - "AdminControllerDashboard.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "AdminControllerDashboard", - "type": "dashboard" - }, - "ListModelDASH.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "ListModelDASH", - "type": "dashboard" - }, - "DASHJViewLagacy.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "dashboard" - }, - "default_vdm.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "dashboard" - }, - "default_main.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "dashboard" - }, - "DASHdefault.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "dashboard" - }, - "dashboard.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": false, - "type": "dashboard" - }, - "filter_forms.xml": { - "path": "c0mp0n3nt/admin/models/forms", - "rename": "filter_forms", - "type": "filter" - }, - "module_forms.xml": { - "path": "c0mp0n3nt/admin/models/forms", - "rename": "module_forms", - "type": "single" - }, - "module_forms.js": { - "path": "c0mp0n3nt/media/js", - "rename": "module_forms", - "type": "single" - }, - "edit.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "single" - }, - "AdminModel.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "AdminModel", - "type": "single" - }, - "FormController.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "FormController", - "type": "single" - }, - "Table.php": { - "path": "c0mp0n3nt/admin/tables", - "rename": "Table", - "type": "single" - }, - "submitbutton.js": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": false, - "type": "single" - }, - "HtmlView_edit.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "view.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "view", - "type": "single" - }, - "AdminController.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "AdminController", - "type": "list" - }, - "ListModel.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "ListModel", - "type": "list" - }, - "views.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "views", - "type": "list" - }, - "HtmlView_list.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "default.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_batch_body.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_batch_footer.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_toolbar.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_head.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_body.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_foot.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "JFormRule.php": { - "path": "c0mp0n3nt/admin/models/rules", - "rename": "JFormRule", - "type": "rule" - }, - "layout_admin.php": { - "path": "c0mp0n3nt/admin/layouts", - "rename": "layout_admin", - "type": "layout" - }, - "layoutoverride.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutoverride", - "type": "layoutoverride" - }, - "layoutitems.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutitems", - "type": "layoutitems" - }, - "layoutfull.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutfull", - "type": "layoutfull" - }, - "layoutlinkedview.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutlinkedview", - "type": "layoutlinkedview" - }, - "layouttitle.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layouttitle", - "type": "layouttitle" - }, - "layoutpublished.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutpublished", - "type": "layoutpublished" - }, - "layoutmetadata.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutmetadata", - "type": "layoutmetadata" - }, - "JFormFieldCustom.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldCustom", - "type": "fieldcustom" - }, - "JFormFieldList.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldList", - "type": "fieldlist" - }, - "JFormFieldRadio.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldRadio", - "type": "fieldradio" - }, - "JFormFieldCheckboxes.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldCheckboxes", - "type": "fieldcheckboxes" - }, - "JFormFieldUser.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldUser", - "type": "fielduser" - }, - "BaseControllerAjax.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "ajax.json.php", - "type": "ajax" - }, - "ListModelAjax.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "new", - "newName": "ajax.php", - "type": "ajax" - }, - "BaseController_import.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "import.php", - "type": "import" - }, - "BaseDatabaseModel_import.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "new", - "newName": "import.php", - "type": "import" - }, - "HtmlView_import.php": { - "path": "c0mp0n3nt/admin/views/import", - "rename": "new", - "newName": "view.html.php", - "type": "import" - }, - "default_import.php": { - "path": "c0mp0n3nt/admin/views/import/tmpl", - "rename": "new", - "newName": "default.php", - "type": "import" - }, - "BaseController_import_custom.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "BaseController_import_custom", - "type": "customimport" - }, - "BaseDatabaseModel_import_custom.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "BaseDatabaseModel_import_custom", - "type": "customimport" - }, - "HtmlView_import_custom.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "customimport" - }, - "default_import_custom.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "customimport" - }, - "BaseControllerHelp.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "help.php", - "type": "help" - }, - "1.0.0.sql": { - "path": "c0mp0n3nt/admin/sql/updates/mysql", - "rename": "1.0.0", - "type": "sql_update" - }, - "update_server.xml": { - "path": "c0mp0n3nt/", - "rename": "update_server", - "type": "update_server" - }, - "viewFile.js": { - "path": "c0mp0n3nt/admin/assets/js", - "rename": "viewFile", - "type": "javascript_file" - } - }, - "site": { - "HtmlView_list_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "ListModel_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "ListModel_site", - "type": "list" - }, - "views_site.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "views_site", - "type": "list" - }, - "default_list_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "list" - }, - "HtmlView_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "view_site.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "view_site", - "type": "single" - }, - "ItemModel_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "ItemModel_site", - "type": "single" - }, - "default_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "single" - }, - "default_site_template.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "site_template", - "type": "template" - }, - "layout_site.php": { - "path": "c0mp0n3nt/site/layouts", - "rename": "layout_site", - "type": "layout" - }, - "layoutoverride.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutoverride", - "type": "layoutoverride" - }, - "layoutitems.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutitems", - "type": "layoutitems" - }, - "layoutfull.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutfull", - "type": "layoutfull" - }, - "layoutlinkedview.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutlinkedview", - "type": "layoutlinkedview" - }, - "layouttitle.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layouttitle", - "type": "layouttitle" - }, - "layoutpublished.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutpublished", - "type": "layoutpublished" - }, - "layoutmetadata.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutmetadata", - "type": "layoutmetadata" - }, - "default.xml": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": false, - "type": "menu" - }, - "edit.xml": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": false, - "type": "admin_menu" - }, - "module_forms.xml": { - "path": "c0mp0n3nt/site/models/forms", - "rename": "module_forms", - "type": "edit" - }, - "module_forms.js": { - "path": "c0mp0n3nt/site/models/forms", - "rename": "module_forms", - "type": "edit" - }, - "edit_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "edit.php", - "type": "edit" - }, - "AdminModel_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "AdminModel_site", - "type": "edit" - }, - "FormController_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "FormController_site", - "type": "edit" - }, - "submitbutton.js": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": false, - "type": "edit" - }, - "HtmlView_edit_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "edit" - }, - "view_site_edit.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "view_site_edit", - "type": "edit" - }, - "BaseControllerAjaxSite.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "new", - "newName": "ajax.json.php", - "type": "ajax" - }, - "ListModelAjaxSite.php": { - "path": "c0mp0n3nt/site/models", - "rename": "new", - "newName": "ajax.php", - "type": "ajax" - }, - "BaseControllerHelp_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "new", - "newName": "help.php", - "type": "help" - }, - "FormController_custom_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "FormController_custom_site", - "type": "custom_form" - }, - "submitbutton_site.js": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "submitbutton.js", - "type": "custom_form" - }, - "Helper_category_view.php": { - "path": "c0mp0n3nt/site/helpers", - "rename": "Helper_category_view", - "type": "category" - }, - "viewFileSite.js": { - "path": "c0mp0n3nt/site/assets/js", - "rename": "viewFileSite", - "type": "javascript_file" - } - }, - "custom_admin": { - "HtmlView_list_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "ListModel_custom_admin.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "ListModel_custom_admin", - "type": "list" - }, - "default_list_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "list" - }, - "AdminController_custom_admin.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "AdminController_custom_admin", - "type": "list" - }, - "views_custom_admin.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "views_custom_admin", - "type": "list" - }, - "view_custom_admin.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "view_custom_admin", - "type": "single" - }, - "HtmlView_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "ItemModel_custom_admin.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "ItemModel_custom_admin", - "type": "single" - }, - "default_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "single" - }, - "BaseController_custom_admin.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "BaseController_custom_admin", - "type": "single" - }, - "default_custom_admin_template.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "custom_admin_template", - "type": "template" - }, - "layout_custom_admin.php": { - "path": "c0mp0n3nt/admin/layouts", - "rename": "layout_custom_admin", - "type": "layout" - }, - "viewFileCustomAdmin.js": { - "path": "c0mp0n3nt/admin/assets/js", - "rename": "viewFileCustomAdmin", - "type": "javascript_file" - } - } - } - } -} \ No newline at end of file diff --git a/admin/compiler/joomla_3/submitbutton.js b/admin/compiler/joomla_3/submitbutton.js index e459e897e..cd10493cd 100644 --- a/admin/compiler/joomla_3/submitbutton.js +++ b/admin/compiler/joomla_3/submitbutton.js @@ -4,7 +4,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/compiler/joomla_3/submitbutton_site.js b/admin/compiler/joomla_3/submitbutton_site.js index ed4feb712..40938b445 100644 --- a/admin/compiler/joomla_3/submitbutton_site.js +++ b/admin/compiler/joomla_3/submitbutton_site.js @@ -4,7 +4,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/compiler/joomla_3/whmcs.php b/admin/compiler/joomla_3/whmcs.php index 06e6cc3af..2bf15a8ff 100644 --- a/admin/compiler/joomla_3/whmcs.php +++ b/admin/compiler/joomla_3/whmcs.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @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 */ diff --git a/admin/compiler/joomla_4/1.0.0.sql b/admin/compiler/joomla_4/1.0.0.sql new file mode 100644 index 000000000..2e5802f84 --- /dev/null +++ b/admin/compiler/joomla_4/1.0.0.sql @@ -0,0 +1 @@ +###UPDATE_VERSION_MYSQL### diff --git a/admin/compiler/joomla_4/ADMIN_AJAX_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_AJAX_CONTROLLER.php new file mode 100644 index 000000000..64690b202 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_AJAX_CONTROLLER.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use Joomla\CMS\Session\Session; +use Joomla\Input\Input; +use Joomla\Utilities\ArrayHelper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Ajax Base Controller + * + * @since 1.6 + */ +class AjaxController extends BaseController +{ + /** + * Constructor. + * + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input + * + * @since 3.0 + */ + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) + { + parent::__construct($config, $factory, $app, $input); + + // make sure all json stuff are set + $this->app->getDocument()->setMimeEncoding( 'application/json' ); + $this->app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); + $this->app->setHeader('Access-Control-Allow-Origin', '*'); + // load the tasks###REGISTER_AJAX_TASK### + } + + /** + * The ajax function + * + * @since 3.10 + */ + public function ajax() + { + // get the user for later use + $user = $this->app->getIdentity(); + // get the input values + $jinput = $this->input ?? $this->app->input; + // check if we should return raw (DEFAULT TRUE SINCE J4) + $returnRaw = $jinput->get('raw', true, 'BOOLEAN'); + // return to a callback function + $callback = $jinput->get('callback', null, 'CMD'); + // Check Token! + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) + { + // get the task + $task = $this->getTask(); + switch($task) + {###AJAX_INPUT_RETURN### + } + } + else + { + // return to a callback function + if($callback) + { + echo $callback."(".json_encode(['error' => 'There was an error! [129]']).");"; + } + elseif($returnRaw) + { + echo json_encode(['error' => 'There was an error! [129]']); + } + else + { + echo "(".json_encode(['error' => 'There was an error! [129]']).");"; + } + } + } +} diff --git a/admin/compiler/joomla_4/ADMIN_AJAX_MODEL.php b/admin/compiler/joomla_4/ADMIN_AJAX_MODEL.php new file mode 100644 index 000000000..43d6a8d19 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_AJAX_MODEL.php @@ -0,0 +1,62 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; + +###AJAX_ADMIN_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Ajax List Model + * + * @since 1.6 + */ +class AjaxModel extends ListModel +{ + /** + * The component params. + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $app_params; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app_params = ComponentHelper::getParams('com_###component###'); + $this->app ??= Factory::getApplication(); + }###AJAX_MODEL_METHODS### +} diff --git a/admin/compiler/joomla_4/ADMIN_DISPLAY_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_DISPLAY_CONTROLLER.php new file mode 100644 index 000000000..21f59aafa --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_DISPLAY_CONTROLLER.php @@ -0,0 +1,50 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### master admin display controller. + * + * @since 4.0 + */ +class DisplayController extends BaseController +{ + /** + * The default view. + * + * @var string + * @since 1.0.0 + */ + protected $default_view = '###DASHBOARDVIEW###'; + + /** + * display task + * + * @return void + */ + function display($cachable = false, $urlparams = false) + { + return parent::display($cachable, $urlparams); + } +} diff --git a/admin/compiler/joomla_4/ADMIN_EXTENSION_COMPONENT.php b/admin/compiler/joomla_4/ADMIN_EXTENSION_COMPONENT.php new file mode 100644 index 000000000..a3de713ee --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_EXTENSION_COMPONENT.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Extension; + +use Joomla\CMS\Association\AssociationServiceInterface; +use Joomla\CMS\Association\AssociationServiceTrait; +use Joomla\CMS\Categories\CategoryServiceInterface; +use Joomla\CMS\Categories\CategoryServiceTrait; +use Joomla\CMS\Component\Router\RouterServiceInterface; +use Joomla\CMS\Component\Router\RouterServiceTrait; +use Joomla\CMS\Extension\BootableExtensionInterface; +use Joomla\CMS\Extension\MVCComponent; +use Joomla\CMS\Factory; +use Joomla\CMS\Fields\FieldsServiceInterface; +use Joomla\CMS\Form\Form; +use Joomla\CMS\HTML\HTMLRegistryAwareTrait; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Tag\TagServiceInterface; +use Joomla\CMS\Tag\TagServiceTrait; +use Joomla\CMS\User\UserFactoryInterface; +// (soon) use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Service\HTML\AdministratorService; +use Psr\Container\ContainerInterface; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * Component class for com_###component### + * + * @since 4.0 + */ +class ###Component###Component extends MVCComponent implements + BootableExtensionInterface, + CategoryServiceInterface, + RouterServiceInterface +{ + use AssociationServiceTrait; + use HTMLRegistryAwareTrait; + use RouterServiceTrait; + use CategoryServiceTrait, TagServiceTrait { + CategoryServiceTrait::getTableNameForSection insteadof TagServiceTrait; + CategoryServiceTrait::getStateColumnForSection insteadof TagServiceTrait; + } + + /** + * Booting the extension. This is the function to set up the environment of the extension like + * registering new class loaders, etc. + * + * If required, some initial set up can be done from services of the container, eg. + * registering HTML services. + * + * @param ContainerInterface $container The container + * + * @return void + * + * @since 4.0.0 + */ + public function boot(ContainerInterface $container) + { + // (soon) $this->getRegistry()->register('###component###administrator', new AdministratorService()); + } + + // will fix these soon + protected function getTableNameForSection(string $section = null){} + public function countItems(array $items, string $section){} + +} diff --git a/admin/compiler/joomla_4/ADMIN_HEADERCHECK.php b/admin/compiler/joomla_4/ADMIN_HEADERCHECK.php new file mode 100644 index 000000000..6e94886ee --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_HEADERCHECK.php @@ -0,0 +1,135 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Document\Document; +use Joomla\CMS\Application\CMSApplication; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * Helper class for checking loaded scripts and styles in the document header. + * + * @since 3.2.0 + */ +class HeaderCheck +{ + /** + * @var CMSApplication Application object + * + * @since 3.2.0 + */ + protected CMSApplication $app; + + /** + * @var Document object + * + * @since 3.2.0 + */ + protected Document $document; + + /** + * Construct the app and document + * + * @since 3.2.0 + */ + public function __construct() + { + // Initializes the application object. + $this->app ??= Factory::getApplication(); + + // Initializes the document object. + $this->document = $this->app->getDocument(); + } + + /** + * Check if a JavaScript file is loaded in the document head. + * + * @param string $scriptName Name of the script to check. + * + * @return bool True if the script is loaded, false otherwise. + * @since 3.2.0 + */ + public function js_loaded(string $scriptName): bool + { + return $this->isLoaded($scriptName, 'scripts'); + } + + /** + * Check if a CSS file is loaded in the document head. + * + * @param string $scriptName Name of the stylesheet to check. + * + * @return bool True if the stylesheet is loaded, false otherwise. + * @since 3.2.0 + */ + public function css_loaded(string $scriptName): bool + { + return $this->isLoaded($scriptName, 'styleSheets'); + } + + /** + * Abstract method to check if a given script or stylesheet is loaded. + * + * @param string $scriptName Name of the script or stylesheet. + * @param string $type Type of asset to check ('scripts' or 'styleSheets'). + * + * @return bool True if the asset is loaded, false otherwise. + * @since 3.2.0 + */ + private function isLoaded(string $scriptName, string $type): bool + { + // UIkit specific check + if ($this->isUIkit($scriptName)) + { + return true; + } + + $head_data = $this->document->getHeadData(); + foreach (array_keys($head_data[$type]) as $script) + { + if (stristr($script, $scriptName)) + { + return true; + } + } + + return false; + } + + /** + * Check for UIkit framework specific conditions. + * + * @param string $scriptName Name of the script or stylesheet. + * + * @return bool True if UIkit specific conditions are met, false otherwise. + * @since 3.2.0 + */ + private function isUIkit(string $scriptName): bool + { + if (strpos($scriptName, 'uikit') !== false) + { + $get_template_name = $this->app->getTemplate('template')->template; + if (strpos($get_template_name, 'yoo') !== false) + { + return true; + } + } + return false; + } +} diff --git a/admin/compiler/joomla_3/JCB_Helper.php b/admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php similarity index 55% rename from admin/compiler/joomla_3/JCB_Helper.php rename to admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php index 1819d2ba2..f7b123bd7 100644 --- a/admin/compiler/joomla_3/JCB_Helper.php +++ b/admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php @@ -2,46 +2,46 @@ /** * @package Joomla.Component.Builder * - * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @created 4th September 2022 + * @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 */ -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; ?> ###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper; -// No direct access to this file -defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### +###ADMIN_POWER_HELPER### ###ADMIN_HELPER_CLASS_HEADER### +// No direct access to this file +\defined('_JEXEC') or die; + /** * ###Component### component helper. + * + * @since 3.0 */ abstract class ###Component###Helper { - /** - * Adding the utilities trait to this class - * - * @deprecated 4.0 - Check the trait methods for details, a legacy implementation - */ - use Utilities; - - /** - * get the Component Code Name - */ - public static $ComponentCodeName = '###component###'; - /** * Composer Switch - * + * * @var array */ - protected static $composer = array();###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### + protected static $composer = []; + + /** + * The Main Active Language + * + * @var string + */ + public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### /** * Load the Composer Vendors @@ -52,7 +52,7 @@ abstract class ###Component###Helper if (!isset(self::$composer[$target])) { // get the function name - $functionName = self::safeString('compose' . $target); + $functionName = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe('compose' . $target); // check if method exist if (method_exists(__CLASS__, $functionName)) { @@ -74,7 +74,7 @@ abstract class ###Component###Helper /** * Joomla version object - */ + */ protected static $JVersion; /** @@ -83,9 +83,9 @@ abstract class ###Component###Helper public static function jVersion() { // check if set - if (!self::checkObject(self::$JVersion)) + if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -96,18 +96,18 @@ abstract class ###Component###Helper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) - { + { if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } @@ -121,8 +121,8 @@ abstract class ###Component###Helper $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; @@ -134,18 +134,89 @@ abstract class ###Component###Helper public static function addSubmenu($submenu) { // load user for access menus - $user = JFactory::getUser(); + $user = Factory::getApplication()->getIdentity(); // load the submenus to sidebar ###SUBMENU### }###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL### + /** + * 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 + * + * @return mix string/int/float + * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(...); + */ + public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###') + { + return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var( + $table, + $where, + $whereString, + $what, + $operator, + $main + ); + } + + /** + * 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 + * + * @return array + * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(...); + */ + public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true) + { + return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars( + $table, + $where, + $whereString, + $what, + $operator, + $main, + $unique + ); + } + + /** + * Convert a json object to a string + * + * @input string $value The json string to convert + * + * @returns a string + * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(...); + */ + public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') + { + return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string( + $value, + $sperator, + $table, + $id, + $name + ); + } + public static function isPublished($id,$type) { if ($type == 'raw') { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__###component###_'.$type.' AS a'); @@ -163,7 +234,7 @@ abstract class ###Component###Helper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -172,7 +243,7 @@ abstract class ###Component###Helper $db->execute(); $found = $db->getNumRows(); if($found) - { + { return $db->loadResult(); } return $id; @@ -188,39 +259,39 @@ abstract class ###Component###Helper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions - * + * @return object The CMSObject of permission/authorised actions + * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') { // load the user if not given - if (!self::checkObject($user)) + if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getApplication()->getIdentity(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) - $view = self::safeString($view); - if (self::checkString($views)) + $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views)) { - $views = self::safeString($views); - } + $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views); + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; } // get created by if not found - if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && !isset($record->created_by) && isset($record->id)) { - $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + $record->created_by = Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var($view, $record->id, 'id', 'created_by', '=', $component); } // set actions only set in component settings $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); @@ -229,12 +300,12 @@ abstract class ###Component###Helper if ($target) { // convert to an array - if (self::checkString($target)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($target)) { $target = array($target); } // check if we are good to go - if (self::checkArray($target)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($target)) { $checkTarget = true; } @@ -255,7 +326,7 @@ abstract class ###Component###Helper // set area $area = 'comp'; // check if the record has an ID and the action is item related (not a component action) - if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) { // we are in item @@ -288,7 +359,7 @@ abstract class ###Component###Helper } } } - elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views) && isset($record->catid) && $record->catid > 0) { // we are in item $area = 'category'; @@ -360,7 +431,7 @@ abstract class ###Component###Helper * @param array $targets The array of target actions * * @return boolean true if action should be filtered out - * + * */ protected static function filterActions(&$view, &$action, &$targets) { @@ -377,51 +448,55 @@ abstract class ###Component###Helper } /** - * Get any component's model + * Returns any Model object. + * + * @param string $type The model type to instantiate + * @param string $prefix Prefix for the model class name. Optional. + * @param string $component Component name the model belongs to. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel + * @throws \Exception + * @since 4.4 */ - public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array()) + public static function getModel(string $type, string $prefix = 'Administrator', + string $component = '###component###', array $config = []) { - // fix the name - $name = self::safeString($name); - // full path to models - $fullPathModels = $path . '/models'; - // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); - // make sure the table path is loaded - if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + // make sure the name is correct + $type = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($type, 'F'); + $component = strtolower($component); + + if ($prefix !== 'Site' && $prefix !== 'Administrator') { - // This is the JCB default path to tables in Joomla 3.x - $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + $prefix = self::getPrefixFromModelPath($prefix); } - // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); - // if model not found (strange) - if ($model == false) + + // Get the model through the MVCFactory + return Factory::getApplication()->bootComponent('com_' . $component)->getMVCFactory()->createModel($type, $prefix, $config); + } + + /** + * Get the prefix from the model path + * + * @param string $path The model path + * + * @return string The prefix value + * @since 4.4 + */ + protected static function getPrefixFromModelPath(string $path): string + { + // Check if $path starts with JPATH_ADMINISTRATOR path + if (str_starts_with($path, JPATH_ADMINISTRATOR . '/components/')) { - jimport('joomla.filesystem.file'); - // get file path - $filePath = $path . '/' . $name . '.php'; - $fullPathModel = $fullPathModels . '/' . $name . '.php'; - // check if it exists - if (File::exists($filePath)) - { - // get the file - require_once $filePath; - } - elseif (File::exists($fullPathModel)) - { - // get the file - require_once $fullPathModel; - } - // build class names - $modelClass = $Component . 'Model' . $name; - if (class_exists($modelClass)) - { - // initialize the model - return new $modelClass($config); - } + return 'Administrator'; } - return $model; + // Check if $path starts with JPATH_SITE path + elseif (str_starts_with($path, JPATH_SITE . '/components/')) + { + return 'Site'; + } + + return 'Administrator'; } /** @@ -429,14 +504,14 @@ abstract class ###Component###Helper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_###component###'); - + $parentId = $parent->id; $name = 'com_###component###.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -460,27 +535,27 @@ abstract class ###Component###Helper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else { // Create an asset_id or heal one that is corrupted. - $object = new stdClass(); + $object = new \StdClass(); // Must be a valid primary key value. $object->id = $id; $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); } } return false; @@ -497,7 +572,7 @@ abstract class ###Component###Helper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -512,8 +587,8 @@ abstract class ###Component###Helper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -528,7 +603,7 @@ abstract class ###Component###Helper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -536,8 +611,8 @@ abstract class ###Component###Helper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -582,7 +657,7 @@ abstract class ###Component###Helper * @return null * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); } @@ -596,7 +671,7 @@ abstract class ###Component###Helper * @return void * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); } @@ -651,17 +726,69 @@ abstract class ###Component###Helper // button attributes $buttonAttributes = array( 'type' => 'radio', - 'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', - 'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway + 'name' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]) : 'bool_button', + 'label' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); // set the button options $buttonOptions = array( - '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', - '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); + '1' => isset($args[3]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[3]) : 'JYES', + '0' => isset($args[4]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[4]) : 'JNO'); // return the input - return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + } + + /** + * Check if have an json string + * + * @input string The json string to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); + */ + public static function checkJson($string) + { + return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); + } + + /** + * Check if have an object with a length + * + * @input object The object to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); + */ + public static function checkObject($object) + { + return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); + } + + /** + * Check if have an array with a length + * + * @input array The array to check + * + * @returns bool/int number of items in array on success + * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); + */ + public static function checkArray($array, $removeEmptyString = false) + { + return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); + } + + /** + * Check if have a string with a length + * + * @input string The string to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); + */ + public static function checkString($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); } /** @@ -673,8 +800,8 @@ abstract class ###Component###Helper public static function isConnected() { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? - $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + $connected = @fsockopen("www.example.com", 80); + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -689,9 +816,122 @@ abstract class ###Component###Helper return $is_conn; } + /** + * Merge an array of array's + * + * @input array The arrays you would like to merge + * + * @returns array on success + * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); + */ + public static function mergeArrays($arrays) + { + return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); + } + // typo sorry! public static function sorten($string, $length = 40, $addTip = true) { return self::shorten($string, $length, $addTip); - }###HELPER_LICENSE_LOCK######GET_CRYPT_KEY### + } + + /** + * Shorten a string + * + * @input string The you would like to shorten + * + * @returns string on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...); + */ + public static function shorten($string, $length = 40, $addTip = true) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten($string, $length, $addTip); + } + + /** + * Making strings safe (various ways) + * + * @input string The you would like to make safe + * + * @returns string on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...); + */ + public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe( + $string, + $type, + $spacer, + $replaceNumbers, + $keepOnlyCharacters + ); + } + + /** + * Convert none English strings to code usable string + * + * @input an string + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); + */ + public static function transliterate($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); + } + + /** + * make sure a string is HTML save + * + * @input an html string + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...); + */ + public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html( + $var, + $charset, + $shorten, + $length + ); + }###HELPER_LICENSE_LOCK### + + /** + * Convert all int in a string to an English word string + * + * @input an string with numbers + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); + */ + public static function replaceNumbers($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); + } + + /** + * Convert an integer into an English word string + * Thanks to Tom Nicholson + * + * @input an int + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); + */ + public static function numberToString($x) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); + } + + /** + * Random Key + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size); + */ + public static function randomkey($size) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size); + }###GET_CRYPT_KEY### } diff --git a/admin/compiler/joomla_4/ADMIN_HELPER_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_HELPER_CONTROLLER.php new file mode 100644 index 000000000..215d4a778 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_HELPER_CONTROLLER.php @@ -0,0 +1,128 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\Database\DatabaseInterface; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; +use Joomla\Utilities\ArrayHelper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Help Base Controller + * + * @since 1.6 + */ +class HelpController extends BaseController +{ + public function __construct($config) + { + parent::__construct($config); + // load the tasks + $this->registerTask('getText', 'help'); + } + + public function help() + { + $user = Factory::getApplication()->getIdentity(); + $jinput = Factory::getApplication()->input; + // Check Token! + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) + { + $task = $this->getTask(); + switch($task){ + case 'getText': + try + { + $idValue = $jinput->get('id', 0, 'INT'); + if($idValue) + { + $result = $this->getHelpDocumentText($idValue); + } + else + { + $result = ''; + } + echo $result; + // stop execution gracefully + jexit(); + } + catch(Exception $e) + { + // stop execution gracefully + jexit(); + } + break; + } + } + else + { + // stop execution gracefully + jexit(); + } + } + + protected function getHelpDocumentText($id) + { + $db = Factory::getContainer()->get(DatabaseInterface::class); + $query = $db->getQuery(true); + $query->select(array('a.title','a.content')); + $query->from('#__###component###_help_document AS a'); + $query->where('a.id = '.(int) $id); + $query->where('a.published = 1'); + $db->setQuery($query); + $db->execute(); + if($db->getNumRows()) + { + $text = []; + $document = $db->loadObject(); + // fix image issue + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; + // set document template + $text[] = ""; + $text[] = ''; + $text[] = ""; + $text[] = ''; + $text[] = "".$document->title.""; + $text[] = ''; + $text[] = ''; + $text[] = ""; + $text[] = '
'; + $text[] = '
'; + $text[] = '
'; + // build the help text + $text[] = '

'.$document->title."

"; + $text[] = str_replace(array_keys($images),array_values($images),$document->content); + // end template + $text[] = '


'; + $text[] = '
'; + $text[] = ""; + $text[] = ""; + + return implode("\n",$text); + } + return false; + } +} diff --git a/admin/compiler/joomla_4/ADMIN_HELPER_EMAIL.php b/admin/compiler/joomla_4/ADMIN_HELPER_EMAIL.php new file mode 100644 index 000000000..4810aa03d --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_HELPER_EMAIL.php @@ -0,0 +1,474 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Mail\Mail; +use Joomla\Registry\Registry; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### component email helper + * + * @since 3.0 + */ +abstract class ###Component###Email +{ + /** + * The active recipient + * + * @var activeRecipient (array) + */ + public static $active = []; + + /** + * Configuraiton object + * + * @var Registry + */ + public static ?Registry $config = null; + + /** + * Mailer object + * + * @var Mail + */ + public static ?Mail $mailer = null; + + /** + * Custom Headers + * + * @var array + */ + protected static array $header = []; + + /** + * Get a configuration object + * + */ + public static function getConfig() + { + if (!self::$config) + { + self::$config = ComponentHelper::getParams('com_###component###'); + } + + return self::$config; + } + + /** + * Returns the global mailer object, only creating it if it doesn't already exist. + * + */ + public static function getMailerInstance() + { + if (!self::$mailer) + { + self::$mailer = self::createMailer(); + } + + return self::$mailer; + } + + /** + * Check that a string looks like an email address. + * @param string $address The email address to check + * @param string|callable $patternselect A selector for the validation pattern to use : + * * `auto` Pick best pattern automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. + * Alternatively you may pass in a callable to inject your own validator, for example: + * PHPMailer::validateAddress('user@example.com', function($address) { + * return (strpos($address, '@') !== false); + * }); + * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. + * @return boolean + * @static + * @access public + */ + public static function validateAddress($address, $patternselect = null): bool + { + return self::getMailerInstance()->validateAddress($address, $patternselect); + } + + /** + * Get a mailer object. + * + * Returns the global {@link Mail} object, only creating it if it doesn't already exist. + * + * @return Mail object + * + * @see Mail + */ + public static function getMailer(): Mail + { + if (!self::$mailer) + { + self::$mailer = self::createMailer(); + } + + $copy = clone self::$mailer; + + return $copy; + } + + /** + * Create a mailer object + * + * @return Mail object + * + * @see Mail + */ + protected static function createMailer(): Mail + { + // set component params + $conf = self::getConfig(); + + // now load the mailer + $mailer = $conf->get('mailer', 'global'); + + // Create a Mail object + $mail = Mail::getInstance(); + + // check if set to global + if ('global' == $mailer) + { + // get the global details + $globalConf = Factory::getConfig(); + + $mailer = $globalConf->get('mailer'); + $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $globalConf->get('smtpuser'); + $smtppass = $globalConf->get('smtppass'); + $smtphost = $globalConf->get('smtphost'); + $smtpsecure = $globalConf->get('smtpsecure'); + $smtpport = $globalConf->get('smtpport'); + $sendmail = $globalConf->get('sendmail'); + $mailfrom = $globalConf->get('mailfrom'); + $fromname = $globalConf->get('fromname'); + $replyto = $globalConf->get('replyto'); + $replytoname = $globalConf->get('replytoname'); + } + else + { + $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $conf->get('smtpuser'); + $smtppass = $conf->get('smtppass'); + $smtphost = $conf->get('smtphost'); + $smtpsecure = $conf->get('smtpsecure'); + $smtpport = $conf->get('smtpport'); + $sendmail = $conf->get('sendmail'); + $mailfrom = $conf->get('emailfrom'); + $fromname = $conf->get('fromname'); + $replyto = $conf->get('replyto'); + $replytoname = $conf->get('replytoname'); + } + + // Set global sender + $mail->setSender(array($mailfrom, $fromname)); + + // set the global reply-to if found + if ($replyto && $replytoname) + { + $mail->ClearReplyTos(); + $mail->addReplyTo($replyto, $replytoname); + } + + // Default mailer is to use PHP's mail function + switch ($mailer) + { + case 'smtp': + // set the SMTP option + $mail->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport); + break; + + case 'sendmail': + // set the sendmail option + $mail->useSendmail($sendmail); + $mail->IsSendmail(); + break; + + default: + $mail->IsMail(); + break; + } + + return $mail; + } + + /** + * Set a Mail custom header. + * + * @return void + */ + public static function setHeader($target, $value) + { + // set the header + self::$header[$target] = $value; + } + + /** + * Send an email + * + * @return bool on success + * + */ + public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null) + { + // Get a Mail instance + $mail = self::getMailer(); + + // set component params + $conf = self::getConfig(); + + // set if we have override + if ($mailfrom && $fromname) + { + $mail->setSender(array($mailfrom, $fromname)); + } + + // load the bounce email as sender if set + if (!is_null($bounce_email)) + { + $mail->Sender = $bounce_email; + } + + // Add tag to email to identify it + if (!is_null($idsession)) + { + $mail->addCustomHeader('X-VDMmethodID:'.$idsession); + } + + // set headers if found + if (isset(self::$header) && is_array(self::$header) && count((array)self::$header) > 0) + { + foreach (self::$header as $_target => $_value) + { + $mail->addCustomHeader($_target.':'.$_value); + } + } + + // set the subject & Body + $mail->setSubject($subject); + $mail->setBody($body); + + // Are we sending the email as HTML? + if ($mode) + { + $mail->IsHTML(true); + $mail->AltBody = $textonly; + } + + //embed images + if ($embeded) + { + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($embeds)) + { + foreach($embeds as $embed) + { + $mail->AddEmbeddedImage($embed->Path,$embed->FileName); + } + } + } + + $mail->addRecipient($recipient); + $mail->addCC($cc); + $mail->addBCC($bcc); + $mail->addAttachment($attachment); + + // Take care of reply email addresses + if (is_array($mailreply)) + { + $mail->ClearReplyTos(); + $numReplyTo = count((array)$mailreply); + for ($i=0; $i < $numReplyTo; $i++) + { + $mail->addReplyTo($mailreply[$i], $replyname[$i]); + } + } + elseif (!empty($mailreply)) + { + $mail->ClearReplyTos(); + $mail->addReplyTo($mailreply, $replyname); + } + + // check if we can add the DKIM to email + if ($conf->get('enable_dkim')) + { + if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) + { + $mail->DKIM_domain = $conf->get('dkim_domain'); + $mail->DKIM_selector = $conf->get('dkim_selector'); + $mail->DKIM_identity = $conf->get('dkim_identity'); + $mail->DKIM_passphrase = $conf->get('dkim_passphrase'); + + $tmp = tempnam(sys_get_temp_dir(), 'VDM'); + $h = fopen($tmp, 'w'); + fwrite($h, $conf->get('dkim_private')); + fclose($h); + $mail->DKIM_private = $tmp; + } + } + + $sendmail = $mail->Send(); + + if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) + { + @unlink($tmp); + } + + if (method_exists('###Component###Helper','storeMessage')) + { + // if we have active recipient details + if (isset(self::$active[$recipient])) + { + // store the massage if the method is set + ###Component###Helper::storeMessage($sendmail, self::$active[$recipient], $subject, $body, $textonly, $mode, 'email'); + // clear memory + unset(self::$active[$recipient]); + } + else + { + // store the massage if the method is set + ###Component###Helper::storeMessage($sendmail, $recipient, $subject, $body, $textonly, $mode, 'email'); + } + } + + return $sendmail; + } + + /** + * Set html text (in a row) and subject (as title) to a email table. + * do not use

instead use
+ * in your html that you pass to this method + * since it is a table row it does not + * work well with paragraphs + * + * @return string on success + * + */ + public static function setBasicBody($html, $subject) + { + $body = []; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "" . $subject . ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = $html; + $body[] = ""; + $body[] = ""; + + return implode("\n", $body); + } + + /** + * Set html text (in a row) and subject (as title) to a email table. + * do not use

instead use
+ * in your html that you pass to this method + * since it is a table row it does not + * work well with paragraphs + * + * @return string on success + * + */ + public static function setTableBody($html, $subject) + { + $body = []; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "" . $subject . ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "\n"; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "
"; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "
"; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "
"; + $body[] = $html; + $body[] = "
"; + $body[] = ""; + $body[] = "
"; + $body[] = ""; + $body[] = "
"; + $body[] = ""; + $body[] = ""; + $body[] = ""; + + return implode("\n", $body); + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER.php new file mode 100644 index 000000000..dff0372db --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +###IMPORT_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Import Base Controller + * + * @since 1.6 + */ +class ImportController extends BaseController +{ + /** + * Import an spreadsheet. + * + * @return void + */ + public function import() + { + // Check for request forgeries + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + $model = $this->getModel('import'); + if ($model->import()) + { + $cache = Factory::getCache('mod_menu'); + $cache->clean(); + // TODO: Reset the users acl here as well to kill off any missing bits + } + + $app = Factory::getApplication(); + $redirect_url = $app->getUserState('com_###component###.redirect_url'); + if (empty($redirect_url)) + { + $redirect_url = Route::_('index.php?option=com_###component###&view=import', false); + } + else + { + // wipe out the user state when we're going to redirect + $app->setUserState('com_###component###.redirect_url', ''); + $app->setUserState('com_###component###.message', ''); + $app->setUserState('com_###component###.extension_message', ''); + } + $this->setRedirect($redirect_url); + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER_CUSTOM.php b/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER_CUSTOM.php new file mode 100644 index 000000000..516800bda --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER_CUSTOM.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +###IMPORT_CUSTOM_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###View### Base Controller + * + * @since 1.6 + */ +class ###View###importController extends BaseController +{ + /** + * Import an spreadsheet. + * + * @return void + */ + public function import() + { + // Check for request forgeries + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + $model = $this->getModel('###View###'); + if ($model->import()) + { + $cache = Factory::getCache('mod_menu'); + $cache->clean(); + // TODO: Reset the users acl here as well to kill off any missing bits + } + + $app = Factory::getApplication(); + $redirect_url = $app->getUserState('com_###component###.redirect_url'); + if (empty($redirect_url)) + { + $redirect_url = Route::_('index.php?option=com_###component###&view=###view###', false); + } + else + { + // wipe out the user state when we're going to redirect + $app->setUserState('com_###component###.redirect_url', ''); + $app->setUserState('com_###component###.message', ''); + $app->setUserState('com_###component###.extension_message', ''); + } + $this->setRedirect($redirect_url); + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_HTML.php b/admin/compiler/joomla_4/ADMIN_IMPORT_HTML.php new file mode 100644 index 000000000..bafc18095 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_HTML.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\Import; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Import Html View + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + protected $headerList; + protected $hasPackage = false; + protected $headers; + protected $hasHeader = 0; + protected $dataType; + + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + $paths = new \StdClass; + $paths->first = ''; + $state = $this->get('state'); + + $this->paths = &$paths; + $this->state = &$state; + // get global action permissions + $this->canDo = ###Component###Helper::getActions('import'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + } + + // get the session object + $session = Factory::getSession(); + // check if it has package + $this->hasPackage = $session->get('hasPackage', false); + $this->dataType = $session->get('dataType', false); + if($this->hasPackage && $this->dataType) + { + $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); + $this->headers = ###Component###Helper::getFileHeaders($this->dataType); + // clear the data type + $session->clear('dataType'); + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); + + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('import'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_HTML_CUSTOM.php b/admin/compiler/joomla_4/ADMIN_IMPORT_HTML_CUSTOM.php new file mode 100644 index 000000000..3fad91b86 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_HTML_CUSTOM.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###View###Import; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### ###View### Html View + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{###IMPORT_DISPLAY_METHOD_CUSTOM### + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); + + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###view###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL.php b/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL.php new file mode 100644 index 000000000..f1f5f6575 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL.php @@ -0,0 +1,460 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; + +###IMPORT_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/*** + * ###Component### Import Base Database Model + * + * @since 1.6 + */ +class ImportModel extends BaseDatabaseModel +{ + // set uploading values + protected $use_streams = false; + protected $allow_unsafe = false; + protected $safeFileOptions = []; + + /** + * @var object JTable object + */ + protected $_table = null; + + /** + * @var object JTable object + */ + protected $_url = null; + + /** + * Model context string. + * + * @var string + */ + protected $_context = 'com_###component###.import'; + + /** + * Import Settings + */ + protected $getType = NULL; + protected $dataType = NULL; + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @return void + * + */ + protected function populateState() + { + $app = Factory::getApplication('administrator'); + + $this->setState('message', $app->getUserState('com_###component###.message')); + $app->setUserState('com_###component###.message', ''); + + // Recall the 'Import from Directory' path. + $path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path')); + $this->setState('import.directory', $path); + parent::populateState(); + } + + /** + * Import an spreadsheet from either folder, url or upload. + * + * @return boolean result of import + * + */ + public function import() + { + $this->setState('action', 'import'); + $app = Factory::getApplication(); + $session = Factory::getSession(); + $package = null; + $continue = false; + // get import type + $this->getType = $app->input->getString('gettype', NULL); + // get import type + $this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL); + + if ($package === null) + { + switch ($this->getType) + { + case 'folder': + // Remember the 'Import from Directory' path. + $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory'); + $package = $this->_getPackageFromFolder(); + break; + + case 'upload': + $package = $this->_getPackageFromUpload(); + break; + + case 'url': + $package = $this->_getPackageFromUrl(); + break; + + case 'continue': + $continue = true; + $package = $session->get('package', null); + $package = json_decode($package, true); + // clear session + $session->clear('package'); + $session->clear('dataType'); + $session->clear('hasPackage'); + break; + + default: + $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND')); + + return false; + break; + } + } + // Was the package valid? + if (!$package || !$package['type']) + { + if (in_array($this->getType, array('upload', 'url'))) + { + $this->remove($package['packagename']); + } + + $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE')); + return false; + } + + // first link data to table headers + if(!$continue){ + $package = json_encode($package); + $session->set('package', $package); + $session->set('dataType', $this->dataType); + $session->set('hasPackage', true); + return true; + } + + // set the data + $headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false), true); + if (!$this->setData($package,$this->dataType,$headerList)) + { + // There was an error importing the package + $msg = Text::_('COM_###COMPONENT###_IMPORT_ERROR'); + $back = $session->get('backto_VDM_IMPORT', NULL); + if ($back) + { + $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back); + $session->clear('backto_VDM_IMPORT'); + } + $result = false; + } + else + { + // Package imported sucessfully + $msg = Text::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']); + $back = $session->get('backto_VDM_IMPORT', NULL); + if ($back) + { + $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back); + $session->clear('backto_VDM_IMPORT'); + } + $result = true; + } + + // Set some model state values + $app->enqueueMessage($msg); + + // remove file after import + $this->remove($package['packagename']); + $session->clear($this->getType.'_VDM_IMPORTHEADERS'); + + return $result; + } + + /** + * Works out an importation spreadsheet from a HTTP upload + * + * @return spreadsheet definition or false on failure + */ + protected function _getPackageFromUpload() + { + // Get the uploaded file information + $app = Factory::getApplication(); + $input = $app->input; + + // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. + $userfile = $input->files->get('import_package', null, 'raw'); + + // Make sure that file uploads are enabled in php + if (!(bool) ini_get('file_uploads')) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); + return false; + } + + // If there is no uploaded file, we have a problem... + if (!is_array($userfile)) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); + return false; + } + + // Check if there was a problem uploading the file. + if ($userfile['error'] || $userfile['size'] < 1) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); + return false; + } + + // Build the appropriate paths + $config = Factory::getConfig(); + $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; + $tmp_src = $userfile['tmp_name']; + + // Move uploaded file + $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions); + + // Was the package downloaded? + if (!$p_file) + { + $session = Factory::getSession(); + $session->clear('package'); + $session->clear('dataType'); + $session->clear('hasPackage'); + // was not uploaded + return false; + } + + // check that this is a valid spreadsheet + $package = $this->check($userfile['name']); + + return $package; + } + + /** + * Import an spreadsheet from a directory + * + * @return array Spreadsheet details or false on failure + * + */ + protected function _getPackageFromFolder() + { + $app = Factory::getApplication(); + $input = $app->input; + + // Get the path to the package to import + $p_dir = $input->getString('import_directory'); + $p_dir = Path::clean($p_dir); + // Did you give us a valid path? + if (!file_exists($p_dir)) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); + return false; + } + + // Detect the package type + $type = $this->getType; + + // Did you give us a valid package? + if (!$type) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); + } + + // check the extention + if(!$this->checkExtension($p_dir)) + { + // set error message + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + return false; + } + + $package['packagename'] = null; + $package['dir'] = $p_dir; + $package['type'] = $type; + + return $package; + } + + /** + * Import an spreadsheet from a URL + * + * @return Package details or false on failure + * + */ + protected function _getPackageFromUrl() + { + $app = Factory::getApplication(); + $input = $app->input; + + // Get the URL of the package to import + $url = $input->getString('import_url'); + + // Did you give us a URL? + if (!$url) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); + return false; + } + + // Download the package at the URL given + $p_file = InstallerHelper::downloadPackage($url); + + // Was the package downloaded? + if (!$p_file) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); + return false; + } + + // check that this is a valid spreadsheet + $package = $this->check($p_file); + + return $package; + } + + /** + * Check a file and verifies it as a spreadsheet file + * Supports .csv .xlsx .xls and .ods + * + * @param string $p_filename The uploaded package filename or import directory + * + * @return array of elements + * + */ + protected function check($archivename) + { + $app = Factory::getApplication(); + // Clean the name + $archivename = Path::clean($archivename); + + // check the extention + if(!$this->checkExtension($archivename)) + { + // Cleanup the import files + $this->remove($archivename); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + return false; + } + + $config = Factory::getConfig(); + // set Package Name + $check['packagename'] = $archivename; + + // set directory + $check['dir'] = $config->get('tmp_path'). '/' .$archivename; + + // set type + $check['type'] = $this->getType; + + return $check; + }###IMPORT_EXT_METHOD### + + /** + * Clean up temporary uploaded spreadsheet + * + * @param string $package Name of the uploaded spreadsheet file + * + * @return boolean True on success + * + */ + protected function remove($package) + { + jimport('joomla.filesystem.file'); + + $config = Factory::getConfig(); + $package = $config->get('tmp_path'). '/' .$package; + + // Is the package file a valid file? + if (is_file($package)) + { + File::delete($package); + } + elseif (is_file(Path::clean($package))) + { + // It might also be just a base filename + File::delete(Path::clean($package)); + } + }###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD### + + protected function getAlias($name,$type = false) + { + // sanitize the name to an alias + if (Factory::getConfig()->get('unicodeslugs') == 1) + { + $alias = OutputFilter::stringURLUnicodeSlug($name); + } + else + { + $alias = OutputFilter::stringURLSafe($name); + } + // must be a uniqe alias + if ($type) + { + return $this->getUniqe($alias,'alias',$type); + } + return $alias; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * @param string $type table. + * + * @return string New value. + */ + protected function getUniqe($value,$field,$type) + { + // insure the filed is always uniqe + while (isset($this->uniqeValueArray[$type][$field][$value])) + { + $value = StringHelper::increment($value, 'dash'); + } + $this->uniqeValueArray[$type][$field][$value] = $value; + return $value; + } + + protected function getAliasesUsed($table) + { + // Get a db connection. + $db = $this->getDatabase(); + // first we check if there is a alias column + $columns = $db->getTableColumns('#__###component###_'.$table); + if(isset($columns['alias'])){ + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('alias'))); + $query->from($db->quoteName('#__###component###_'.$table)); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $aliases = $db->loadColumn(); + foreach($aliases as $alias) + { + $this->uniqeValueArray[$table]['alias'][$alias] = $alias; + } + } + return true; + } + return false; + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL_CUSTOM.php b/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL_CUSTOM.php new file mode 100644 index 000000000..b30e5846e --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL_CUSTOM.php @@ -0,0 +1,351 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; + +###IMPORT_CUSTOM_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###View### Base Database Model + * + * @since 1.6 + */ +class ###View###importModel extends BaseDatabaseModel +{ + // set uploading values + protected $use_streams = false; + protected $allow_unsafe = false; + protected $safeFileOptions = []; + + /** + * @var object JTable object + */ + protected $_table = null; + + /** + * @var object JTable object + */ + protected $_url = null; + + /** + * Model context string. + * + * @var string + */ + protected $_context = 'com_###component###.###view###'; + + /** + * Import Settings + */ + protected $getType = NULL; + protected $dataType = NULL; + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @return void + * + */ + protected function populateState() + { + $app = Factory::getApplication('administrator'); + + $this->setState('message', $app->getUserState('com_###component###.message')); + $app->setUserState('com_###component###.message', ''); + + // Recall the 'Import from Directory' path. + $path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path')); + $this->setState('import.directory', $path); + parent::populateState(); + } + ###IMPORT_METHOD_CUSTOM### + + /** + * Works out an importation spreadsheet from a HTTP upload + * + * @return spreadsheet definition or false on failure + */ + protected function _getPackageFromUpload() + { + // Get the uploaded file information + $app = Factory::getApplication(); + $input = $app->input; + + // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. + $userfile = $input->files->get('import_package', null, 'raw'); + + // Make sure that file uploads are enabled in php + if (!(bool) ini_get('file_uploads')) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); + return false; + } + + // If there is no uploaded file, we have a problem... + if (!is_array($userfile)) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); + return false; + } + + // Check if there was a problem uploading the file. + if ($userfile['error'] || $userfile['size'] < 1) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); + return false; + } + + // Build the appropriate paths + $config = Factory::getConfig(); + $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; + $tmp_src = $userfile['tmp_name']; + + // Move uploaded file + $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions); + + // Was the package downloaded? + if (!$p_file) + { + $session = Factory::getSession(); + $session->clear('package'); + $session->clear('dataType'); + $session->clear('hasPackage'); + // was not uploaded + return false; + } + + // check that this is a valid spreadsheet + $package = $this->check($userfile['name']); + + return $package; + } + + /** + * Import an spreadsheet from a directory + * + * @return array Spreadsheet details or false on failure + * + */ + protected function _getPackageFromFolder() + { + $app = Factory::getApplication(); + $input = $app->input; + + // Get the path to the package to import + $p_dir = $input->getString('import_directory'); + $p_dir = Path::clean($p_dir); + // Did you give us a valid path? + if (!file_exists($p_dir)) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); + return false; + } + + // Detect the package type + $type = $this->getType; + + // Did you give us a valid package? + if (!$type) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); + } + + // check the extention + if(!$this->checkExtension($p_dir)) + { + // set error message + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + return false; + } + + $package['packagename'] = null; + $package['dir'] = $p_dir; + $package['type'] = $type; + + return $package; + } + + /** + * Import an spreadsheet from a URL + * + * @return Package details or false on failure + * + */ + protected function _getPackageFromUrl() + { + $app = Factory::getApplication(); + $input = $app->input; + + // Get the URL of the package to import + $url = $input->getString('import_url'); + + // Did you give us a URL? + if (!$url) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); + return false; + } + + // Download the package at the URL given + $p_file = InstallerHelper::downloadPackage($url); + + // Was the package downloaded? + if (!$p_file) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); + return false; + } + + // check that this is a valid spreadsheet + $package = $this->check($p_file); + + return $package; + } + + /** + * Check a file and verifies it as a spreadsheet file + * Supports .csv .xlsx .xls and .ods + * + * @param string $p_filename The uploaded package filename or import directory + * + * @return array of elements + * + */ + protected function check($archivename) + { + $app = Factory::getApplication(); + // Clean the name + $archivename = Path::clean($archivename); + + // check the extention + if(!$this->checkExtension($archivename)) + { + // Cleanup the import files + $this->remove($archivename); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + return false; + } + + $config = Factory::getConfig(); + // set Package Name + $check['packagename'] = $archivename; + + // set directory + $check['dir'] = $config->get('tmp_path'). '/' .$archivename; + + // set type + $check['type'] = $this->getType; + + return $check; + } + ###IMPORT_EXT_METHOD### + + /** + * Clean up temporary uploaded spreadsheet + * + * @param string $package Name of the uploaded spreadsheet file + * + * @return boolean True on success + * + */ + protected function remove($package) + { + $config = Factory::getConfig(); + $package = $config->get('tmp_path'). '/' .$package; + + // Is the package file a valid file? + if (is_file($package)) + { + File::delete($package); + } + elseif (is_file(Path::clean($package))) + { + // It might also be just a base filename + File::delete(Path::clean($package)); + } + } + ###IMPORT_SETDATA_METHOD### + ###IMPORT_SAVE_METHOD### + + protected function getAlias($name,$type = false) + { + // sanitize the name to an alias + if (Factory::getConfig()->get('unicodeslugs') == 1) + { + $alias = OutputFilter::stringURLUnicodeSlug($name); + } + else + { + $alias = OutputFilter::stringURLSafe($name); + } + // must be a uniqe alias + if ($type) + { + return $this->getUniqe($alias,'alias',$type); + } + return $alias; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * @param string $type table. + * + * @return string New value. + */ + protected function getUniqe($value,$field,$type) + { + // insure the filed is always uniqe + while (isset($this->uniqeValueArray[$type][$field][$value])) + { + $value = StringHelper::increment($value, 'dash'); + } + $this->uniqeValueArray[$type][$field][$value] = $value; + return $value; + } + + protected function getAliasesUsed($table) + { + // Get a db connection. + $db = $this->getDatabase(); + // first we check if there is a alias column + $columns = $db->getTableColumns('#__###component###_'.$table); + if(isset($columns['alias'])){ + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('alias'))); + $query->from($db->quoteName('#__###component###_'.$table)); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $aliases = $db->loadColumn(); + foreach($aliases as $alias) + { + $this->uniqeValueArray[$table]['alias'][$alias] = $alias; + } + } + return true; + } + return false; + } +} diff --git a/admin/compiler/joomla_4/ADMIN_LAYOUT.php b/admin/compiler/joomla_4/ADMIN_LAYOUT.php new file mode 100644 index 000000000..857ae2766 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_LAYOUT.php @@ -0,0 +1,22 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###ADMIN_LAYOUT_HEADER### + +// No direct access to this file +defined('JPATH_BASE') or die;###ADMIN_LAYOUT_CODE### + +?>###ADMIN_LAYOUT_BODY### diff --git a/admin/compiler/joomla_4/ADMIN_PROVIDER.php b/admin/compiler/joomla_4/ADMIN_PROVIDER.php new file mode 100644 index 000000000..23696fa3f --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_PROVIDER.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###ADMIN_POWER_HELPER### + +// (soon) use Joomla\CMS\Association\AssociationExtensionInterface; +use Joomla\CMS\Categories\CategoryFactoryInterface; +use Joomla\CMS\Component\Router\RouterFactoryInterface; +use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; +use Joomla\CMS\Extension\ComponentInterface; +use Joomla\CMS\Extension\Service\Provider\CategoryFactory; +use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory; +use Joomla\CMS\Extension\Service\Provider\MVCFactory; +use Joomla\CMS\Extension\Service\Provider\RouterFactory; +use Joomla\CMS\HTML\Registry; +use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Extension\###Component###Component; +// (soon) use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\AssociationsHelper; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * The ###NAMESPACEPREFIX### ###Component### service provider. + * + * @since 4.0.0 + */ +return new class () implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * + * @since 4.0.0 + */ + public function register(Container $container) + { + // (soon) $container->set(AssociationExtensionInterface::class, new AssociationsHelper()); + + $container->registerServiceProvider(new CategoryFactory('\\###NAMESPACEPREFIX###\\Component\\###Component###')); + $container->registerServiceProvider(new MVCFactory('\\###NAMESPACEPREFIX###\\Component\\###Component###')); + $container->registerServiceProvider(new ComponentDispatcherFactory('\\###NAMESPACEPREFIX###\\Component\\###Component###')); + $container->registerServiceProvider(new RouterFactory('\\###NAMESPACEPREFIX###\\Component\\###Component###')); + + $container->set( + ComponentInterface::class, + function (Container $container) { + $component = new ###Component###Component($container->get(ComponentDispatcherFactoryInterface::class)); + + $component->setRegistry($container->get(Registry::class)); + $component->setMVCFactory($container->get(MVCFactoryInterface::class)); + $component->setCategoryFactory($container->get(CategoryFactoryInterface::class)); + // (soon) $component->setAssociationExtension($container->get(AssociationExtensionInterface::class)); + $component->setRouterFactory($container->get(RouterFactoryInterface::class)); + + return $component; + } + ); + } +}; diff --git a/admin/compiler/joomla_4/ADMIN_VIEW.php b/admin/compiler/joomla_4/ADMIN_VIEW.php new file mode 100644 index 000000000..1790e1989 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW.php @@ -0,0 +1,27 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###ADMIN_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die; + +?> +###EDITBODYFADEIN### +

+###EDITBODY### +
+
###EDITBODYSCRIPT### diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS.php b/admin/compiler/joomla_4/ADMIN_VIEWS.php new file mode 100644 index 000000000..90dd4a345 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS.php @@ -0,0 +1,28 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###ADMIN_VIEWS_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_###component###&task=###views###.saveOrderAjax&tmpl=component'; + Html::_('sortablelist.sortable', '###view###List', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} +?> +###VIEWS_DEFAULT_BODY######VIEWS_FOOTER_SCRIPT### diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_VIEWS_CONTROLLER.php new file mode 100644 index 000000000..f2c68be9b --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS_CONTROLLER.php @@ -0,0 +1,53 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +###ADMIN_VIEWS_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Views### Admin Controller + * + * @since 1.6 + */ +class ###Views###Controller extends AdminController +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###_###VIEWS###'; + + /** + * Proxy for getModel. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel + * + * @since 1.6 + */ + public function getModel($name = '###View###', $prefix = 'Administrator', $config = ['ignore_request' => true]) + { + return parent::getModel($name, $prefix, $config); + }###CONTROLLEREXIMPORTMETHOD######CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER######ADMIN_CUSTOM_BUTTONS_CONTROLLER_LIST### +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS_EMPTYSTATE.php b/admin/compiler/joomla_4/ADMIN_VIEWS_EMPTYSTATE.php new file mode 100644 index 000000000..7169372a0 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS_EMPTYSTATE.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Layout\LayoutHelper; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +$displayData = [ + 'textPrefix' => 'COM_###COMPONENT###_###VIEWS###', + 'formURL' => 'index.php?option=com_###component###&view=###views###', + 'icon' => 'icon-###ICOMOON###', +]; + +if ($this->user->authorise('###view###.create', 'com_###component###')) +{ + $displayData['createURL'] = 'index.php?option=com_###component###&task=###view###.add'; +} + +echo LayoutHelper::render('joomla.content.emptystate', $displayData); diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS_HTML.php b/admin/compiler/joomla_4/ADMIN_VIEWS_HTML.php new file mode 100644 index 000000000..e22861b20 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS_HTML.php @@ -0,0 +1,188 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###Views###; + +###ADMIN_VIEWS_HTML_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###Views### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * ###Views### view display method + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + $this->user ??= Factory::getApplication()->getIdentity();###ADMIN_DIPLAY_METHOD### + $this->saveOrder = $this->listOrder == 'a.ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); + // get global action permissions + $this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO### + + // If we don't have items we load the empty state + if (is_array($this->items) && !count((array) $this->items) && $this->isEmptyState = $this->get('IsEmptyState')) + { + $this->setLayout('emptystate'); + } + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Set the html view document stuff + $this->_prepareDocument(); + + // Display the template + parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ToolbarHelper::title(Text::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###'); + + if ($this->canCreate) + { + ToolbarHelper::addNew('###view###.add'); + } + + // Only load if there are items + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->items)) + { + if ($this->canEdit) + { + ToolbarHelper::editList('###view###.edit'); + } + + if ($this->canState) + { + ToolbarHelper::publishList('###views###.publish'); + ToolbarHelper::unpublishList('###views###.unpublish'); + ToolbarHelper::archiveList('###views###.archive'); + + if ($this->canDo->get('core.admin')) + { + ToolbarHelper::checkin('###views###.checkin'); + } + }###CUSTOM_ADMIN_DYNAMIC_BUTTONS######ADMIN_CUSTOM_BUTTONS_LIST### + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + ToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + ToolbarHelper::trash('###views###.trash'); + }###EXPORTBUTTON### + }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST######IMPORTBUTTON### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###views###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + }###FILTERFIELDDISPLAYHELPER######BATCHDISPLAYHELPER### + } + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + { + $this->getDocument()->setTitle(Text::_('COM_###COMPONENT###_###VIEWS###')); + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + } + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###ADMIN_ADD_JAVASCRIPT_FILE### + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = true, int $length = 50) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array containing the field name to sort by as the key and display text as value + * @since 1.6 + */ + protected function getSortFields() + { + ###SORTFIELDS### + }###FILTERFUNCTIONS### +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS_MODEL.php b/admin/compiler/joomla_4/ADMIN_VIEWS_MODEL.php new file mode 100644 index 000000000..3297824df --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS_MODEL.php @@ -0,0 +1,189 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; + +###ADMIN_VIEWS_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Views### List Model + * + * @since 1.6 + */ +class ###Views###Model extends ListModel +{ + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_###component###/assets/css/admin.css', + 'administrator/components/com_###component###/assets/css/###views###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_###component###/assets/js/admin.js' + ]; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + ###FILTER_FIELDS### + ); + } + + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + }###ADMIN_CUSTOM_BUTTONS_METHOD_LIST### + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * + * @return void + * @since 1.7.0 + */ + protected function populateState($ordering = null, $direction = null) + { + $app = $this->app; + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + }###POPULATESTATE### + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + * @since 1.6 + */ + public function getItems() + {###LICENSE_LOCKED_CHECK######CHECKINCALL### + // load parent items + $items = parent::getItems();###GET_ITEMS_METHOD_STRING_FIX######SELECTIONTRANSLATIONFIX######GET_ITEMS_METHOD_AFTER_ALL### + + // return items + return $items; + }###SELECTIONTRANSLATIONFIXFUNC### + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + * @since 1.6 + */ + protected function getListQuery() + {###LICENSE_LOCKED_CHECK### + ###LISTQUERY### + }###MODELEXPORTMETHOD######LICENSE_LOCKED_SET_BOOL### + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * @since 1.6 + */ + protected function getStoreId($id = '') + { + ###STOREDID### + + return parent::getStoreId($id); + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###AUTOCHECKIN### +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php new file mode 100644 index 000000000..aab67b639 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php @@ -0,0 +1,274 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +###ADMIN_VIEW_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###View### Form Controller + * + * @since 1.6 + */ +class ###View###Controller extends FormController +{ + use VersionableControllerTrait; + + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###_###VIEW###'; + + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * The URL view list variable. + * + * @var string + * @since 1.6 + */ + protected $view_list = '###views###';###ADMIN_CUSTOM_BUTTONS_CONTROLLER### + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = []) + {###JCONTROLLERFORM_ALLOWADD### + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = [], $key = 'id') + {###JCONTROLLERFORM_ALLOWEDIT### + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 1.6 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); + + // set the referral options + if ($refid && $ref) + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; + } + elseif ($ref) + { + $append = '&ref='. (string) $ref . $append; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('###View###', '', []); + + // Preset the redirect + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64');###JCONTROLLERFORM_BEFORECANCEL### + + $cancel = parent::cancel($key); + + if (!is_null($return) && Uri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + Route::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + }###JCONTROLLERFORM_AFTERCANCEL### + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + Route::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; + + // Redirect to the item screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string) $this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) + {###POSTSAVEHOOK### + } +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_HTML.php b/admin/compiler/joomla_4/ADMIN_VIEW_HTML.php new file mode 100644 index 000000000..648861428 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_HTML.php @@ -0,0 +1,143 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###View###; + +###ADMIN_VIEW_HTML_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###View### Html View class + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * ###View### view display method + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // set params + $this->params = ComponentHelper::getParams('com_###component###'); + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ###Component###Helper::getActions('###view###', $this->item); + // get input + $jinput = Factory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string) $this->ref . '&refid=' . (int) $this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string) $this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string) $return; + }###LINKEDVIEWITEMS### + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Set the html view document stuff + $this->_prepareDocument(); + + // Display the template + parent::display($tpl); + } + + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ###ADDTOOLBAR### + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = true, int $length = 30) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + { + $isNew = ($this->item->id < 1); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###DOCUMENT_CUSTOM_PHP### + } +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_MODEL.php b/admin/compiler/joomla_4/ADMIN_VIEW_MODEL.php new file mode 100644 index 000000000..86d77aa8f --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_MODEL.php @@ -0,0 +1,491 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; + +###ADMIN_VIEW_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###View### Admin Model + * + * @since 1.6 + */ +class ###View###Model extends AdminModel +{ + use VersionableModelTrait; + + /** + * The tab layout fields array. + * + * @var array + * @since 3.0.0 + */ + protected $tabLayoutFields = ###TABLAYOUTFIELDSARRAY###; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_###component###/assets/css/admin.css', + 'administrator/components/com_###component###/assets/css/###view###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_###component###/assets/js/admin.js', + 'media/com_###component###/js/###view###.js' + ]; + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_###component###.###view###'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return Table A database object + * @since 3.0 + * @throws \Exception + */ + public function getTable($type = '###view###', $prefix = 'Administrator', $config = []) + { + // get instance of the table + return parent::getTable($type, $prefix, $config); + }###ADMIN_CUSTOM_BUTTONS_METHOD### + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * @since 1.6 + */ + public function getItem($pk = null) + {###LICENSE_LOCKED_CHECK### + if ($item = parent::getItem($pk)) + { + if (!empty($item->params) && !is_array($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + }###METHOD_GET_ITEM### + }###LINKEDVIEWGLOBAL### + + return $item; + }###LINKEDVIEWMETHODS######LICENSE_LOCKED_SET_BOOL### + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. + * + * @return Form|boolean A Form object on success, false on failure + * @since 1.6 + */ + public function getForm($data = [], $loadData = true, $options = ['control' => 'jform']) + { + // set load data option + $options['load_data'] = $loadData;###JMODELADMIN_GETFORM### + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * @since 1.6 + */ + protected function canDelete($record) + {###JMODELADMIN_CANDELETE### + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * @since 1.6 + */ + protected function canEditState($record) + {###JMODELADMIN_CANEDITSTATE### + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = [], $key = 'id') + {###JMODELADMIN_ALLOWEDIT### + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param Table $table A Table object. + * + * @return void + * @since 1.6 + */ + protected function prepareTable($table) + {###LICENSE_TABLE_LOCKED_CHECK### + $date = Factory::getDate(); + $user = $this->getCurrentUser(); + + if (isset($table->name)) + { + $table->name = \htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = $this->getDatabase(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__###component###_###view###')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []); + + if (empty($data)) + { + $data = $this->getItem(); + } + + // run the perprocess of the data + $this->preprocessData('com_###component###.###view###', $data); + + return $data; + }###VALIDATIONFIX######UNIQUEFIELDS### + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs + * @since 12.2 + */ + public function delete(&$pks) + {###JMODELADMIN_BEFORE_DELETE### + if (!parent::delete($pks)) + { + return false; + }###JMODELADMIN_AFTER_DELETE### + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + {###JMODELADMIN_BEFORE_PUBLISH### + if (!parent::publish($pks, $value)) + { + return false; + }###JMODELADMIN_AFTER_PUBLISH### + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + ArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(Text::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user ??= $this->getCurrentUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new UCMType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ###Component###Helper::getActions('###view###'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new UCMType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = ArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + }###MODEL_BATCH_COPY######MODEL_BATCH_MOVE### + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * @since 1.6 + */ + public function save($data) + { + $input = Factory::getApplication()->getInput(); + $filter = InputFilter::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new Registry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + }###CHECKBOX_SAVE######METHOD_ITEM_SAVE### + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new Registry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + }###TITLEALIASFIX### + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a unique value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * @since 3.0 + */ + protected function generateUnique($field, $value) + { + // set field value unique + $table = $this->getTable(); + + while ($table->load([$field => $value])) + { + $value = StringHelper::increment($value); + } + + return $value; + }###GENERATENEWTITLE### +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_TABLE.php b/admin/compiler/joomla_4/ADMIN_VIEW_TABLE.php new file mode 100644 index 000000000..6dfae6f66 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_TABLE.php @@ -0,0 +1,372 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Table; + +use Joomla\CMS\Factory; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Language\Text; +use Joomla\CMS\String\PunycodeHelper; +use Joomla\CMS\Access\Access as AccessRules; +use Joomla\CMS\Access\Rules; +use Joomla\CMS\Tag\TaggableTableInterface; +use Joomla\CMS\Tag\TaggableTableTrait; +use Joomla\CMS\User\CurrentUserInterface; +use Joomla\CMS\User\CurrentUserTrait; +use Joomla\CMS\Versioning\VersionableTableInterface; +use Joomla\CMS\Application\ApplicationHelper; +use Joomla\Database\DatabaseInterface; +use Joomla\Registry\Registry; +use Joomla\Database\DatabaseDriver; +use Joomla\Event\DispatcherInterface; +use Joomla\String\StringHelper; +use Joomla\Utilities\ArrayHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Views### Table class + * + * @since 1.6 + */ +class ###View###Table extends Table implements VersionableTableInterface, TaggableTableInterface, CurrentUserInterface +{ + use TaggableTableTrait; + use CurrentUserTrait; + + /** + * Constructor + * + * @param DatabaseDriver $db Database connector object + * @param ?DispatcherInterface $dispatcher Event dispatcher for this table + * + * @param object Database connector object + * @since 4.0 + */ + function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) + { + // The type alias generally is the internal component name with the + // content type. Ex.: com_content.article + $this->typeAlias = 'com_###component###.###view###'; + + // Ensure the params and metadata in json encoded in the bind method + $this->_jsonEncode = ['params', 'metadata']; + + // Indicates that columns fully support the NULL value in the database + // $this->_supportNullValue = true; // hmmm will keep an eye on this ;) + + parent::__construct('#__###component###_###view###', 'id', $db, $dispatcher);###LICENSE_LOCKED_CHECK### + } + + /** + * Method to bind an associative array or object to the Table instance.This + * method only binds properties that are publicly accessible and optionally + * takes an array of properties to ignore when binding. + * + * @param array|object $src An associative array or object to bind to the Table instance. + * @param array|string $ignore An optional array or space separated list of properties to ignore while binding. + * + * @return boolean True on success. + * + * @since 1.7.0 + * @throws \InvalidArgumentException + */ + public function bind($array, $ignore = '') + { + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new AccessRules($array['rules']); + $this->setRules($rules); + } + + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the ###View### table. + * + * @param boolean Toggle whether null values should be updated. + * + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = Factory::getDate()->toSql(); + $userId = $this->getCurrentUser()->id; + + if ($this->id) + { + // Existing item + $this->modified = $date; + $this->modified_by = $userId; + } + else + { + // New ###view###. A ###view### created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date; + } + if (empty($this->created_by)) + { + $this->created_by = $userId; + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = new self($this->getDbo(), $this->getDispatcher()); + + if ($table->load(['alias' => $this->alias###JTABLEALIASCATEGORY###]) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS')); + + if ($table->published === -2) + { + $this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS_TRASHED')); + } + + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = PunycodeHelper::urlToPunycode($this->url); + } + + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = PunycodeHelper::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + * + * @see \Joomla\CMS\Table\Table::check + * @since 1.5 + */ + public function check() + { + try { + parent::check(); + } catch (\Exception $e) { + $this->setError($e->getMessage()); + return false; + } + + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = new self($this->getDbo(), $this->getDispatcher()); + + while ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = StringHelper::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = StringHelper::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = []; + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty AccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_###component###.###view###.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + }###LICENSE_LOCKED_SET_BOOL### + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return AccessRules The AccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = Factory::getContainer()->get(DatabaseInterface::class); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset already set so use saved rules + $assetId = (int) $db->loadResult(); + return AccessRules::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof AccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = []; + } + } + // check if there are any view values remaining + if (count( (array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return AccessRules::getAssetRules(0); + } + + /** + * Get the type alias for the history table + * + * The type alias generally is the internal component name with the + * content type. Ex.: com_content.article + * + * @return string The alias as described above + * + * @since 3.10.0 + */ + public function getTypeAlias() + { + return $this->typeAlias; + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form table_name.id + * where id is the value of the primary key of the table. + * + * @return string + * + * @since 1.7.0 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + + return $this->getTypeAlias() . '.' . (int) $this->$k; + } + + /** + * Method to get the parent asset under which to register this one. + * + * By default, all assets are registered to the ROOT node with ID, which will default to 1 if none exists. + * An extended class can define a table and ID to lookup. If the asset does not exist it will be created. + * + * @param Table $table A Table object for the asset parent. + * @param integer $id Id to look up + * + * @return integer + * + * @since 1.7.0 + */ + protected function _getAssetParentId(Table $table = null, $id = null) + { + /** @var Asset $assets */ + $assets = self::getInstance('Asset', 'JTable', ['dbo' => $this->getDbo()]); + $rootId = $assets->getRootId(); + + // load the ###component### asset + $assets->loadByName('com_###component###'); + + return $assets->id ?? $rootId ?? 1; + }###GENERATENEWALIAS### +} diff --git a/admin/compiler/joomla_4/CHANGELOG.md b/admin/compiler/joomla_4/CHANGELOG.md new file mode 100644 index 000000000..def8704dd --- /dev/null +++ b/admin/compiler/joomla_4/CHANGELOG.md @@ -0,0 +1 @@ +###CHANGELOG### \ No newline at end of file diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_LAYOUT.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_LAYOUT.php new file mode 100644 index 000000000..c3981e98e --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_LAYOUT.php @@ -0,0 +1,22 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###CUSTOM_ADMIN_LAYOUT_HEADER### + +// No direct access to this file +defined('JPATH_BASE') or die;###CUSTOM_ADMIN_LAYOUT_CODE### + +?>###CUSTOM_ADMIN_LAYOUT_BODY### diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW.php new file mode 100644 index 000000000..47e384fe5 --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW.php @@ -0,0 +1,28 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###CUSTOM_ADMIN_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_CODE_BODY### + +?> +canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### +item->id)) ? '&id='. (int) $this->item->id : ''; ?> +###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM### + +

+ diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS.php new file mode 100644 index 000000000..6b23540da --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS.php @@ -0,0 +1,27 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###CUSTOM_ADMIN_VIEWS_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_CODE_BODY### + +?> +canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### +###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM### + +

+ diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_CONTROLLER.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_CONTROLLER.php new file mode 100644 index 000000000..fb2e2468d --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_CONTROLLER.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +###CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###SViews### Admin Controller + * + * @since 1.6 + */ +class ###SViews###Controller extends AdminController +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###_###SVIEWS###'; + + /** + * Proxy for getModel. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel + * + * @since 1.6 + */ + public function getModel($name = '###View###', $prefix = 'Administrator', $config = ['ignore_request' => true]) + { + return parent::getModel($name, $prefix, $config); + } + + /** + * Adds option to redirect back to the dashboard. + * + * @return void + * + * @since 3.0 + */ + public function dashboard(): void + { + $this->setRedirect(Route::_('index.php?option=com_###component###', false)); + }###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER### +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_HTML.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_HTML.php new file mode 100644 index 000000000..b6a3ab8e3 --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_HTML.php @@ -0,0 +1,119 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###SViews###; + +###CUSTOM_ADMIN_VIEWS_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###SViews### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // get component params + $this->params = ComponentHelper::getParams('com_###component###'); + // get the application + $this->app ??= Factory::getApplication(); + // get the user object + $this->user ??= $this->app->getIdentity(); + // get global action permissions + $this->canDo = ###Component###Helper::getActions('###sview###'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts');###CUSTOM_ADMIN_DIPLAY_METHOD### + + // Set the html view document stuff + $this->_prepareDocument(); + }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###HIDEMAINMENU### + // add title to the page + ToolbarHelper::title(Text::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + }###CUSTOM_ADMIN_GET_MODULE### + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = false, int $length = 40) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_MODEL.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_MODEL.php new file mode 100644 index 000000000..21260e2cc --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_MODEL.php @@ -0,0 +1,220 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; + +###CUSTOM_ADMIN_VIEWS_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### List Model for ###SViews### + * + * @since 1.6 + */ +class ###SViews###Model extends ListModel +{ + /** + * Represents the current user object. + * + * @var User The user object representing the current user. + * @since 3.2.0 + */ + protected User $user; + + /** + * The unique identifier of the current user. + * + * @var int|null The ID of the current user. + * @since 3.2.0 + */ + protected ?int $userId; + + /** + * Flag indicating whether the current user is a guest. + * + * @var int 1 if the user is a guest, 0 otherwise. + * @since 3.2.0 + */ + protected int $guest; + + /** + * An array of groups that the current user belongs to. + * + * @var array|null An array of user group IDs. + * @since 3.2.0 + */ + protected ?array $groups; + + /** + * An array of view access levels for the current user. + * + * @var array|null An array of access level IDs. + * @since 3.2.0 + */ + protected ?array $levels; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The input object, providing access to the request data. + * + * @var Input The input object. + * @since 3.2.0 + */ + protected Input $input; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_###component###/assets/css/admin.css', + 'administrator/components/com_###component###/assets/css/###sviews###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_###component###/assets/js/admin.js' + ]; + + /** + * A custom property for UIKit components. (not used unless you load v2) + */ + protected $uikitComp; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + $this->input ??= $this->app->getInput(); + + // Set the current user for authorisation checks (for those calling this model directly) + $this->user ??= $this->getCurrentUser(); + $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(); + + // will be removed + $this->initSet = true; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + * @since 1.6 + */ + protected function getListQuery() + {###CUSTOM_ADMIN_GET_LIST_QUERY### + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + * @since 1.6 + */ + public function getItems() + { + $user = $this->user; + // check if this user has permission to access items + if (!$user->authorise('###sviews###.access', 'com_###component###')) + { + $this->app->enqueueMessage(Text::_('Not authorised!'), 'error'); + // redirect away if not a correct to default view + $this->app->redirect('index.php?option=com_###component###'); + return false; + }###LICENSE_LOCKED_CHECK######CUSTOM_ADMIN_BEFORE_GET_ITEMS### + // load parent items + $items = parent::getItems(); + + // Get the global params + $globalParams = ComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS### + + // return items + return $items; + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###CUSTOM_ADMIN_CUSTOM_METHODS######LICENSE_LOCKED_SET_BOOL######CUSTOM_ADMIN_CUSTOM_BUTTONS_METHOD### +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_CONTROLLER.php new file mode 100644 index 000000000..6618a2b2f --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_CONTROLLER.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +###CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###SView### Base Controller + * + * @since 1.6 + */ +class ###SView###Controller extends BaseController +{ + /** + * The context for storing internal data, e.g. record. + * + * @var string + * @since 1.6 + */ + protected $context = '###sview###'; + + /** + * The URL view item variable. + * + * @var string + * @since 1.6 + */ + protected $view_item = '###sview###'; + + /** + * Adds option to redirect back to the dashboard. + * + * @return void + * @since 3.0 + */ + public function dashboard(): void + { + $this->setRedirect(Route::_('index.php?option=com_###component###', false)); + }###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER### +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_HTML.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_HTML.php new file mode 100644 index 000000000..de896a019 --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_HTML.php @@ -0,0 +1,129 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###SView###; + +###CUSTOM_ADMIN_VIEW_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### + +// No direct access to this file +\defined('_JEXEC') or die; ###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###SView### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // get component params + $this->params = ComponentHelper::getParams('com_###component###'); + // get the application + $this->app ??= Factory::getApplication(); + // get the user object + $this->user ??= Factory::getApplication()->getIdentity(); + // get global action permissions + $this->canDo = ###Component###Helper::getActions('###sview###'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts');###CUSTOM_ADMIN_DIPLAY_METHOD### + + // Set the html view document stuff + $this->_prepareDocument(); + }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###HIDEMAINMENU### + // 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 = Text::_('COM_###COMPONENT###_###SVIEW###'); + } + // add title to the page + ToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + }###CUSTOM_ADMIN_GET_MODULE### + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = false, int $length = 40) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_MODEL.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_MODEL.php new file mode 100644 index 000000000..fc43c158c --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_MODEL.php @@ -0,0 +1,267 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; + +###CUSTOM_ADMIN_VIEW_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###SView### Item Model + * + * @since 1.6 + */ +class ###SView###Model extends ItemModel +{ + /** + * Model context string. + * + * @var string + * @since 1.6 + */ + protected $_context = 'com_###component###.###sview###'; + + /** + * Represents the current user object. + * + * @var User The user object representing the current user. + * @since 3.2.0 + */ + protected User $user; + + /** + * The unique identifier of the current user. + * + * @var int|null The ID of the current user. + * @since 3.2.0 + */ + protected ?int $userId; + + /** + * Flag indicating whether the current user is a guest. + * + * @var int 1 if the user is a guest, 0 otherwise. + * @since 3.2.0 + */ + protected int $guest; + + /** + * An array of groups that the current user belongs to. + * + * @var array|null An array of user group IDs. + * @since 3.2.0 + */ + protected ?array $groups; + + /** + * An array of view access levels for the current user. + * + * @var array|null An array of access level IDs. + * @since 3.2.0 + */ + protected ?array $levels; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The input object, providing access to the request data. + * + * @var Input The input object. + * @since 3.2.0 + */ + protected Input $input; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_###component###/assets/css/admin.css', + 'administrator/components/com_###component###/assets/css/###sview###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_###component###/assets/js/admin.js' + ]; + + /** + * A custom property for UI Kit components. + * + * @var array|null Property for storing UI Kit component-related data or objects. + * @since 3.2.0 + */ + protected ?array $uikitComp; + + /** + * @var object item + * @since 1.6 + */ + protected $item; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 3.0 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + $this->input ??= $this->app->getInput(); + + // Set the current user for authorisation checks (for those calling this model directly) + $this->user ??= $this->getCurrentUser(); + $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(); + + // will be removed + $this->initSet = true; + } + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @return void + * @since 1.6 + */ + protected function populateState() + { + // Get the item main id + $id = $this->input->getInt('id', null); + $this->setState('###sview###.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. + * @since 1.6 + */ + public function getItem($pk = null) + { + // check if this user has permission to access item + if (!$this->user->authorise('###sview###.access', 'com_###component###')) + { + $this->app->enqueueMessage(Text::_('Not authorised!'), 'error'); + // redirect away if not a correct to cPanel/default view + $this->app->redirect('index.php?option=com_###component###'); + return false; + } + + $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM### + + if ($this->_item === null) + { + $this->_item = []; + }###LICENSE_LOCKED_CHECK### + + if (!isset($this->_item[$pk])) + { + try + {###CUSTOM_ADMIN_GET_ITEM### + } + catch (\Exception $e) + { + if ($e->getCode() == 404) + { + // Need to go thru the error handler to allow Redirect to work. + throw $e; + } + else + { + $this->setError($e); + $this->_item[$pk] = false; + } + } + }###CUSTOM_ADMIN_AFTER_GET_ITEM### + + return $this->_item[$pk]; + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###CUSTOM_ADMIN_CUSTOM_METHODS######LICENSE_LOCKED_SET_BOOL######CUSTOM_ADMIN_CUSTOM_BUTTONS_METHOD### +} diff --git a/admin/compiler/joomla_4/DASH_CONTROLLER.php b/admin/compiler/joomla_4/DASH_CONTROLLER.php new file mode 100644 index 000000000..5a2268dac --- /dev/null +++ b/admin/compiler/joomla_4/DASH_CONTROLLER.php @@ -0,0 +1,31 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; + +###DASH_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Admin Controller + * + * @since 1.6 + */ +class ###Component###Controller extends AdminController +{ + +} diff --git a/admin/compiler/joomla_4/DASH_MODEL.php b/admin/compiler/joomla_4/DASH_MODEL.php new file mode 100644 index 000000000..610e08ba9 --- /dev/null +++ b/admin/compiler/joomla_4/DASH_MODEL.php @@ -0,0 +1,225 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; + +###DASH_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### List Model + * + * @since 1.6 + */ +class ###Component###Model extends ListModel +{ + public function getIcons() + { + // load user for access menus + $user = Factory::getApplication()->getIdentity(); + // reset icon array + $icons = []; + // view groups array + $viewGroups = array( + 'main' => array(###DASHBOARDICONS###) + );###DASHBOARDICONACCESS### + // loop over the $views + foreach($viewGroups as $group => $views) + { + $i = 0; + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($views)) + { + foreach($views as $view) + { + $add = false; + // external views (links) + if (strpos($view,'||') !== false) + { + $dwd = explode('||', $view); + if (count($dwd) == 3) + { + list($type, $name, $url) = $dwd; + $viewName = $name; + $alt = $name; + $url = $url; + $image = $name . '.' . $type; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U'); + } + } + // internal views + elseif (strpos($view,'.') !== false) + { + $dwd = explode('.', $view); + if (count($dwd) == 3) + { + list($type, $name, $action) = $dwd; + } + elseif (count($dwd) == 2) + { + list($type, $name) = $dwd; + $action = false; + } + if ($action) + { + $viewName = $name; + switch($action) + { + case 'add': + $url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit'; + $image = $name . '_' . $action. '.' . $type; + $alt = $name . ' ' . $action; + $name = 'COM_###COMPONENT###_DASHBOARD_'.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U').'_ADD'; + $add = true; + break; + default: + // check for new convention (more stable) + if (strpos($action, '_qpo0O0oqp_') !== false) + { + list($action, $extension) = (array) explode('_qpo0O0oqp_', $action); + $extension = str_replace('_po0O0oq_', '.', $extension); + } + else + { + $extension = 'com_###component###.' . $name; + } + $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; + $image = $name . '_' . $action . '.' . $type; + $alt = $viewName . ' ' . $action; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U') . '_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($action,'U'); + break; + } + } + else + { + $viewName = $name; + $alt = $name; + $url = 'index.php?option=com_###component###&view=' . $name; + $image = $name . '.' . $type; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U'); + $hover = false; + } + } + else + { + $viewName = $view; + $alt = $view; + $url = 'index.php?option=com_###component###&view=' . $view; + $image = $view . '.png'; + $name = ucwords($view).'

'; + $hover = false; + } + // first make sure the view access is set + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($viewAccess)) + { + // setup some defaults + $dashboard_add = false; + $dashboard_list = false; + $accessTo = ''; + $accessAdd = ''; + // access checking start + $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.create']):false; + $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.access']):false; + // set main controllers + $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_add']):false; + $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_list']):false; + // check for adding access + if ($add && $accessCreate) + { + $accessAdd = $viewAccess[$viewName.'.create']; + } + elseif ($add) + { + $accessAdd = 'core.create'; + } + // check if access to view is set + if ($accessAccess) + { + $accessTo = $viewAccess[$viewName.'.access']; + } + // set main access controllers + if ($accessDashboard_add) + { + $dashboard_add = $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_###component###'); + } + if ($accessDashboard_list) + { + $dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###'); + } + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd) && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo)) + { + // check access + if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add) + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + } + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo)) + { + // check access + if($user->authorise($accessTo, 'com_###component###') && $dashboard_list) + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + } + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd)) + { + // check access + if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add) + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + } + else + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + } + else + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + $i++; + } + } + else + { + $icons[$group][$i] = false; + } + } + return $icons; + }###DASH_MODEL_METHODS### +} diff --git a/admin/compiler/joomla_4/DASH_VIEW.php b/admin/compiler/joomla_4/DASH_VIEW.php new file mode 100644 index 000000000..c95d6aeb6 --- /dev/null +++ b/admin/compiler/joomla_4/DASH_VIEW.php @@ -0,0 +1,22 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###DASH_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die; + +?>###DASH_DISPLAY_DATA### \ No newline at end of file diff --git a/admin/compiler/joomla_4/DASH_VIEW_HTML.php b/admin/compiler/joomla_4/DASH_VIEW_HTML.php new file mode 100644 index 000000000..31e294e46 --- /dev/null +++ b/admin/compiler/joomla_4/DASH_VIEW_HTML.php @@ -0,0 +1,100 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###Component###; + +###DASH_VIEW_HTML_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### View class + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * View display method + * @return void + */ + function display($tpl = null) + { + // Assign data to the view + $this->icons = $this->get('Icons'); + $this->contributors = ###Component###Helper::getContributors(); + + // get the manifest details of the component + $this->manifest = ###Component###Helper::manifest();###DASH_GET_CUSTOM_DATA### + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Set the html view document stuff + $this->_prepareDocument(); + + // Display the template + parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + $canDo = ###Component###Helper::getActions('###component###'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###component###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + + if ($canDo->get('core.admin') || $canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + } + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + { + // set page title + $this->getDocument()->setTitle(Text::_('COM_###COMPONENT###_DASHBOARD')); + + // add manifest to page JavaScript + $this->getDocument()->addScriptDeclaration("var manifest = JSON.parse('" . json_encode($this->manifest) . "');", "text/javascript"); + + // add dashboard style sheets + Html::_('stylesheet', "administrator/components/com_###component###/assets/css/dashboard.css", ['version' => 'auto']); + } +} diff --git a/admin/compiler/joomla_4/FORM_CHECKBOXES_FIELD.php b/admin/compiler/joomla_4/FORM_CHECKBOXES_FIELD.php new file mode 100644 index 000000000..3bda6475e --- /dev/null +++ b/admin/compiler/joomla_4/FORM_CHECKBOXES_FIELD.php @@ -0,0 +1,51 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\CheckboxesField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends CheckboxesField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/FORM_CUSTOM_FIELD.php b/admin/compiler/joomla_4/FORM_CUSTOM_FIELD.php new file mode 100644 index 000000000..c6d1f3c5d --- /dev/null +++ b/admin/compiler/joomla_4/FORM_CUSTOM_FIELD.php @@ -0,0 +1,36 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; + +###FORM_CUSTOM_FIELD_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends ###FORM_EXTENDS### +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###';###FORM_CUSTOM_FIELD_PHP### +} diff --git a/admin/compiler/joomla_4/FORM_LIST_FIELD.php b/admin/compiler/joomla_4/FORM_LIST_FIELD.php new file mode 100644 index 000000000..cb70ab37d --- /dev/null +++ b/admin/compiler/joomla_4/FORM_LIST_FIELD.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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\ListField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends ListField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###';###ADD_BUTTON### + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + * @since 1.6 + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/FORM_RADIO_FIELD.php b/admin/compiler/joomla_4/FORM_RADIO_FIELD.php new file mode 100644 index 000000000..4b11f1865 --- /dev/null +++ b/admin/compiler/joomla_4/FORM_RADIO_FIELD.php @@ -0,0 +1,51 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\RadioField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends RadioField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/FORM_RULE.php b/admin/compiler/joomla_4/FORM_RULE.php new file mode 100644 index 000000000..a31ce624a --- /dev/null +++ b/admin/compiler/joomla_4/FORM_RULE.php @@ -0,0 +1,37 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Rule; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\Form; +use Joomla\CMS\Form\FormRule; +use Joomla\Registry\Registry; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('JPATH_PLATFORM') or die; + +/** + * Form Rule (###Name###) class for the Joomla Platform. + * + * @since 3.5 + */ +class ###Name###Rule extends FormRule +{###VALIDATION_RULE_METHODS### +} diff --git a/admin/compiler/joomla_4/FORM_USER_FIELD.php b/admin/compiler/joomla_4/FORM_USER_FIELD.php new file mode 100644 index 000000000..3327f5a6d --- /dev/null +++ b/admin/compiler/joomla_4/FORM_USER_FIELD.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\UserField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends UserField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get the filtering groups (null means no filtering) + * + * @return mixed array of filtering groups or null. + * + * @since 1.6 + */ + protected function getGroups() + { + ###JFORM_GETGROUPS_PHP### + } + + /** + * Method to get the users to exclude from the list of users + * + * @return mixed Array of users to exclude or null to not exclude them + * + * @since 1.6 + */ + protected function getExcluded() + { + ###JFORM_GETEXCLUDED_PHP### + } +} diff --git a/admin/compiler/joomla_4/INSTALLER_SCRIPT.php b/admin/compiler/joomla_4/INSTALLER_SCRIPT.php new file mode 100644 index 000000000..c147a8e72 --- /dev/null +++ b/admin/compiler/joomla_4/INSTALLER_SCRIPT.php @@ -0,0 +1,1099 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Filesystem\File; +use Joomla\CMS\Installer\InstallerAdapter; +use Joomla\CMS\Installer\InstallerScriptInterface; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Log\Log; +use Joomla\CMS\Version; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\Filesystem\Folder; +use Joomla\Database\DatabaseInterface; + +// No direct access to this file +defined('_JEXEC') or die; + +/** + * Script File of ###Component### Component + * + * @since 3.6 + */ +class Com_###Component###InstallerScript implements InstallerScriptInterface +{ + /** + * The CMS Application. + * + * @var CMSApplication + * @since 4.4.2 + */ + protected CMSApplication $app; + + /** + * The database class. + * + * @since 4.4.2 + */ + protected $db; + + /** + * The version number of the extension. + * + * @var string + * @since 3.6 + */ + protected $release; + + /** + * The table the parameters are stored in. + * + * @var string + * @since 3.6 + */ + protected $paramTable; + + /** + * The extension name. This should be set in the installer script. + * + * @var string + * @since 3.6 + */ + protected $extension; + + /** + * A list of files to be deleted + * + * @var array + * @since 3.6 + */ + protected $deleteFiles = []; + + /** + * A list of folders to be deleted + * + * @var array + * @since 3.6 + */ + protected $deleteFolders = []; + + /** + * A list of CLI script files to be copied to the cli directory + * + * @var array + * @since 3.6 + */ + protected $cliScriptFiles = []; + + /** + * Minimum PHP version required to install the extension + * + * @var string + * @since 3.6 + */ + protected $minimumPhp; + + /** + * Minimum Joomla! version required to install the extension + * + * @var string + * @since 3.6 + */ + protected $minimumJoomla; + + /** + * Extension script constructor. + * + * @since 3.0.0 + */ + public function __construct() + { + $this->minimumJoomla = '4.3'; + $this->minimumPhp = JOOMLA_MINIMUM_PHP; + $this->app ??= Factory::getApplication(); + $this->db = Factory::getContainer()->get(DatabaseInterface::class); + + // check if the files exist + if (is_file(JPATH_ROOT . '/administrator/components/com_###component###/###component###.php')) + { + // remove Joomla 3 files + $this->deleteFiles = [ + '/administrator/components/com_###component###/###component###.php', + '/administrator/components/com_###component###/controller.php', + '/components/com_###component###/###component###.php', + '/components/com_###component###/controller.php', + '/components/com_###component###/router.php', + ]; + } + + // check if the Folders exist + if (is_dir(JPATH_ROOT . '/administrator/components/com_###component###/modules')) + { + // remove Joomla 3 folder + $this->deleteFolders = [ + '/administrator/components/com_###component###/controllers', + '/administrator/components/com_###component###/helpers', + '/administrator/components/com_###component###/modules', + '/administrator/components/com_###component###/tables', + '/administrator/components/com_###component###/views', + '/components/com_###component###/controllers', + '/components/com_###component###/helpers', + '/components/com_###component###/modules', + '/components/com_###component###/views', + ]; + } + } + + /** + * Function called after the extension is installed. + * + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function install(InstallerAdapter $adapter): bool {return true;} + + /** + * Function called after the extension is updated. + * + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function update(InstallerAdapter $adapter): bool {return true;} + + /** + * Function called after the extension is uninstalled. + * + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function uninstall(InstallerAdapter $adapter): bool + {###UNINSTALLSCRIPT### + // little notice as after service, in case of bad experience with component. + echo '
+

Did something go wrong? Are you disappointed?

+

Please let me know at ###AUTHOREMAIL###. +
We at ###COMPANYNAME### are committed to building extensions that performs proficiently! You can help us, really! +
Send me your thoughts on improvements that is needed, trust me, I will be very grateful! +
Visit us at ###AUTHORWEBSITE### today!

'; + + return true; + } + + /** + * Function called before extension installation/update/removal procedure commences. + * + * @param string $type The type of change (install or discover_install, update, uninstall) + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function preflight(string $type, InstallerAdapter $adapter): bool + { + // Check for the minimum PHP version before continuing + if (!empty($this->minimumPhp) && version_compare(PHP_VERSION, $this->minimumPhp, '<')) + { + Log::add(Text::sprintf('JLIB_INSTALLER_MINIMUM_PHP', $this->minimumPhp), Log::WARNING, 'jerror'); + + return false; + } + + // Check for the minimum Joomla version before continuing + if (!empty($this->minimumJoomla) && version_compare(JVERSION, $this->minimumJoomla, '<')) + { + Log::add(Text::sprintf('JLIB_INSTALLER_MINIMUM_JOOMLA', $this->minimumJoomla), Log::WARNING, 'jerror'); + + return false; + } + + // Extension manifest file version + $this->extension = $adapter->getName(); + $this->release = $adapter->getManifest()->version; + + // do any updates needed + if ($type === 'update') + {###PREUPDATESCRIPT### + } + + // do any install needed + if ($type === 'install') + {###PREINSTALLSCRIPT### + } + + return true; + } + + /** + * Function called after extension installation/update/removal procedure commences. + * + * @param string $type The type of change (install or discover_install, update, uninstall) + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function postflight(string $type, InstallerAdapter $adapter): bool + {###MOVEFOLDERSSCRIPT### + + // set the default component settings + if ($type === 'install') + {###POSTINSTALLSCRIPT### + } + + // do any updates needed + if ($type === 'update') + {###POSTUPDATESCRIPT### + } + + // move CLI files + $this->moveCliFiles(); + + // remove old files and folders + $this->removeFiles(); + + return true; + } + + /** + * Remove the files and folders in the given array from + * + * @return void + * + * @since 3.6 + */ + protected function removeFiles() + { + if (!empty($this->deleteFiles)) + { + foreach ($this->deleteFiles as $file) + { + if (is_file(JPATH_ROOT . $file) && !File::delete(JPATH_ROOT . $file)) + { + echo Text::sprintf('JLIB_INSTALLER_ERROR_FILE_FOLDER', $file) . '
'; + } + } + } + + if (!empty($this->deleteFolders)) + { + foreach ($this->deleteFolders as $folder) + { + if (is_dir(JPATH_ROOT . $folder) && !Folder::delete(JPATH_ROOT . $folder)) + { + echo Text::sprintf('JLIB_INSTALLER_ERROR_FILE_FOLDER', $folder) . '
'; + } + } + } + } + + /** + * Moves the CLI scripts into the CLI folder in the CMS + * + * @return void + * + * @since 3.6 + */ + protected function moveCliFiles() + { + if (!empty($this->cliScriptFiles)) + { + foreach ($this->cliScriptFiles as $file) + { + $name = basename($file); + + if (file_exists(JPATH_ROOT . $file) && !File::move(JPATH_ROOT . $file, JPATH_ROOT . '/cli/' . $name)) + { + echo Text::sprintf('JLIB_INSTALLER_FILE_ERROR_MOVE', $name); + } + } + } + } + + /** + * Set content type integration + * + * @param string $typeTitle + * @param string $typeAlias + * @param string $table + * @param string $rules + * @param string $fieldMappings + * @param string $router + * @param string $contentHistoryOptions + * + * @return void + * @since 4.4.2 + */ + protected function setContentType( + string $typeTitle, + string $typeAlias, + string $table, + string $rules, + string $fieldMappings, + string $router, + string $contentHistoryOptions): void + { + // Create the content type object. + $content = new stdClass(); + $content->type_title = $typeTitle; + $content->type_alias = $typeAlias; + $content->table = $table; + $content->rules = $rules; + $content->field_mappings = $fieldMappings; + $content->router = $router; + $content->content_history_options = $contentHistoryOptions; + + // Check if content type is already in content_type DB. + $query = $this->db->getQuery(true); + $query->select($this->db->quoteName(array('type_id'))); + $query->from($this->db->quoteName('#__content_types')); + $query->where($this->db->quoteName('type_alias') . ' LIKE '. $this->db->quote($content->type_alias)); + + $this->db->setQuery($query); + $this->db->execute(); + + // Check if the type alias is already in the content types table. + if ($this->db->getNumRows()) + { + $content->type_id = $this->db->loadResult(); + if ($this->db->updateObject('#__content_types', $content, 'type_id')) + { + // If its successfully update. + $this->app->enqueueMessage( + Text::sprintf('The (%s) was found in the #__content_types table, and updated.', $content->type_alias) + ); + } + } + elseif ($this->db->insertObject('#__content_types', $content)) + { + // If its successfully added. + $this->app->enqueueMessage( + Text::sprintf('The (%s) was added to the #__content_types table.', $content->type_alias) + ); + } + } + + /** + * Set action log config integration + * + * @param string $typeTitle + * @param string $typeAlias + * @param string $idHolder + * @param string $titleHolder + * @param string $tableName + * @param string $textPrefix + * + * @return void + * @since 4.4.2 + */ + protected function setActionLogConfig( + string $typeTitle, + string $typeAlias, + string $idHolder, + string $titleHolder, + string $tableName, + string $textPrefix): void + { + // Create the content action log config object. + $content = new stdClass(); + $content->type_title = $typeTitle; + $content->type_alias = $typeAlias; + $content->id_holder = $idHolder; + $content->title_holder = $titleHolder; + $content->table_name = $tableName; + $content->text_prefix = $textPrefix; + + // Check if the action log config is already in action_log_config DB. + $query = $this->db->getQuery(true); + $query->select($this->db->quoteName(['id'])); + $query->from($this->db->quoteName('#__action_log_config')); + $query->where($this->db->quoteName('type_alias') . ' LIKE '. $this->db->quote($content->type_alias)); + + $this->db->setQuery($query); + $this->db->execute(); + + // Check if the type alias is already in the action log config table. + if ($this->db->getNumRows()) + { + $content->id = $this->db->loadResult(); + if ($this->db->updateObject('#__action_log_config', $content, 'id')) + { + // If its successfully update. + $this->app->enqueueMessage( + Text::sprintf('The (%s) was found in the #__action_log_config table, and updated.', $content->type_alias) + ); + } + } + elseif ($this->db->insertObject('#__action_log_config', $content)) + { + // If its successfully added. + $this->app->enqueueMessage( + Text::sprintf('The (%s) was added to the #__action_log_config table.', $content->type_alias) + ); + } + } + + /** + * Set action logs extensions integration + * + * @return void + * @since 4.4.2 + */ + protected function setActionLogsExtensions(): void + { + // Create the extension action logs object. + $data = new stdClass(); + $data->extension = 'com_###component###'; + + // Check if ###component### action log extension is already in action logs extensions DB. + $query = $this->db->getQuery(true); + $query->select($this->db->quoteName(['id'])); + $query->from($this->db->quoteName('#__action_logs_extensions')); + $query->where($this->db->quoteName('extension') . ' = '. $this->db->quote($data->extension)); + + $this->db->setQuery($query); + $this->db->execute(); + + // Set the object into the action logs extensions table if not found. + if ($this->db->getNumRows()) + { + // If its already set don't set it again. + $this->app->enqueueMessage( + Text::_('The (com_###component###) is already in the #__action_logs_extensions table.') + ); + } + elseif ($this->db->insertObject('#__action_logs_extensions', $data)) + { + // give a success message + $this->app->enqueueMessage( + Text::_('The (com_###component###) was successfully added to the #__action_logs_extensions table.') + ); + } + } + + /** + * Set global extension assets permission of this component + * (on install only) + * + * @param string $rules The component rules + * + * @return void + * @since 4.4.2 + */ + protected function setAssetsRules(string $rules): void + { + // Condition. + $conditions = [ + $this->db->quoteName('name') . ' = ' . $this->db->quote('com_###component###') + ]; + + // Field to update. + $fields = [ + $this->db->quoteName('rules') . ' = ' . $this->db->quote($rules), + ]; + + $query = $this->db->getQuery(true); + $query->update( + $this->db->quoteName('#__assets') + )->set($fields)->where($conditions); + + $this->db->setQuery($query); + + $done = $this->db->execute(); + if ($done) + { + // give a success message + $this->app->enqueueMessage( + Text::_('The (com_###component###) rules was successfully added to the #__assets table.') + ); + } + } + + /** + * Set global extension params of this component + * (on install only) + * + * @param string $params The component rules + * + * @return void + * @since 4.4.2 + */ + protected function setExtensionsParams(string $params): void + { + // Condition. + $conditions = [ + $this->db->quoteName('element') . ' = ' . $this->db->quote('com_###component###') + ]; + + // Field to update. + $fields = [ + $this->db->quoteName('params') . ' = ' . $this->db->quote($params), + ]; + + $query = $this->db->getQuery(true); + $query->update( + $this->db->quoteName('#__extensions') + )->set($fields)->where($conditions); + + $this->db->setQuery($query); + + $done = $this->db->execute(); + if ($done) + { + // give a success message + $this->app->enqueueMessage( + Text::_('The (com_###component###) params was successfully added to the #__extensions table.') + ); + } + } + + /** + * Set database fix (if needed) + * => WHY DO WE NEED AN ASSET TABLE FIX? + * https://git.vdm.dev/joomla/Component-Builder/issues/616#issuecomment-12085 + * https://www.mysqltutorial.org/mysql-varchar/ + * https://stackoverflow.com/a/15227917/1429677 + * https://forums.mysql.com/read.php?24,105964,105964 + * + * @param int $accessWorseCase This is the max rules column size com_###component### would needs. + * @param string $dataType This datatype we will change the rules column to if it to small. + * + * @return void + * @since 4.4.2 + */ + protected function setDatabaseAssetsRulesFix(int $accessWorseCase, string $dataType): void + { + // Get the biggest rule column in the assets table at this point. + $length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $this->db->setQuery($length); + if ($this->db->execute()) + { + $rule_length = $this->db->loadResult(); + // Check the size of the rules column + if ($rule_length <= $accessWorseCase) + { + // Fix the assets table rules column size + $fix = "ALTER TABLE `#__assets` CHANGE `rules` `rules` {$dataType} NOT NULL COMMENT 'JSON encoded access control. Enlarged to {$dataType} by ###Component###';"; + $this->db->setQuery($fix); + + $done = $this->db->execute(); + if ($done) + { + $this->app->enqueueMessage( + Text::sprintf('The #__assets table rules column was resized to the %s datatype for the components possible large permission rules.', $dataType) + ); + } + } + } + } + + /** + * Remove remnant data related to this view + * + * @param string $context The view context + * @param bool $fields The switch to also remove related field data + * + * @return void + * @since 4.4.2 + */ + protected function removeViewData(string $context, bool $fields = false): void + { + $this->removeContentTypes($context); + $this->removeViewHistory($context); + $this->removeUcmContent($context); // this might be obsolete... + $this->removeContentItemTagMap($context); + $this->removeActionLogConfig($context); + + if ($fields) + { + $this->removeFields($context); + $this->removeFieldsGroups($context); + } + } + + /** + * Remove content types related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeContentTypes(string $context): void + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Select id from content type table + $query->select($this->db->quoteName('type_id')); + $query->from($this->db->quoteName('#__content_types')); + + // Where Item alias is found + $query->where($this->db->quoteName('type_alias') . ' = '. $this->db->quote($context)); + $this->db->setQuery($query); + + // Execute query to see if alias is found + $this->db->execute(); + $found = $this->db->getNumRows(); + + // Now check if there were any rows + if ($found) + { + // Since there are load the needed item type ids + $ids = $this->db->loadColumn(); + + // Remove Item from the content type table + $condition = [ + $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context) + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__content_types')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $done = $this->db->execute(); + if ($done) + { + // If successfully remove Item add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) type alias was removed from the #__content_type table.', $context) + ); + } + + // Make sure that all the items are cleared from DB + $this->removeUcmBase($ids); + } + } + + /** + * Remove fields related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeFields(string $context): void + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Select ids from fields + $query->select($this->db->quoteName('id')); + $query->from($this->db->quoteName('#__fields')); + + // Where context is found + $query->where( + $this->db->quoteName('context') . ' = '. $this->db->quote($context) + ); + $this->db->setQuery($query); + + // Execute query to see if context is found + $this->db->execute(); + $found = $this->db->getNumRows(); + + // Now check if there were any rows + if ($found) + { + // Since there are load the needed release_check field ids + $ids = $this->db->loadColumn(); + + // Create a new query object. + $query = $this->db->getQuery(true); + + // Remove context from the field table + $condition = [ + $this->db->quoteName('context') . ' = '. $this->db->quote($context) + ]; + + $query->delete($this->db->quoteName('#__fields')); + $query->where($condition); + + $this->db->setQuery($query); + + // Execute the query to remove release_check items + $done = $this->db->execute(); + if ($done) + { + // If successfully remove context add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The fields with context (%s) was removed from the #__fields table.', $context) + ); + } + + // Make sure that all the field values are cleared from DB + $this->removeFieldsValues($context, $ids); + } + } + + /** + * Remove fields values related to fields + * + * @param string $context The view context + * @param array $ids The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeFieldsValues(string $context, array $ids): void + { + $condition = [ + $this->db->quoteName('field_id') . ' IN ('. implode(',', $ids) .')' + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__fields_values')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove field values + $done = $this->db->execute(); + if ($done) + { + // If successfully remove release_check add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The fields values for (%s) was removed from the #__fields_values table.', $context) + ); + } + } + + /** + * Remove fields groups related to fields + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeFieldsGroups(string $context): void + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Select ids from fields + $query->select($this->db->quoteName('id')); + $query->from($this->db->quoteName('#__fields_groups')); + + // Where context is found + $query->where( + $this->db->quoteName('context') . ' = '. $this->db->quote($context) + ); + $this->db->setQuery($query); + + // Execute query to see if context is found + $this->db->execute(); + $found = $this->db->getNumRows(); + + // Now check if there were any rows + if ($found) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Remove context from the field table + $condition = [ + $this->db->quoteName('context') . ' = '. $this->db->quote($context) + ]; + + $query->delete($this->db->quoteName('#__fields_groups')); + $query->where($condition); + + $this->db->setQuery($query); + + // Execute the query to remove release_check items + $done = $this->db->execute(); + if ($done) + { + // If successfully remove context add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The fields with context (%s) was removed from the #__fields_groups table.', $context) + ); + } + } + } + + /** + * Remove history related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeViewHistory(string $context): void + { + // Remove Item items from the ucm content table + $condition = [ + $this->db->quoteName('item_id') . ' LIKE ' . $this->db->quote($context . '.%') + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__history')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $done = $this->db->execute(); + if ($done) + { + // If successfully removed Items add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) items were removed from the #__history table.', $context) + ); + } + } + + /** + * Remove ucm base values related to these IDs + * + * @param array $ids The type ids + * + * @return void + * @since 4.4.2 + */ + protected function removeUcmBase(array $ids): void + { + // Make sure that all the items are cleared from DB + foreach ($ids as $type_id) + { + // Remove Item items from the ucm base table + $condition = [ + $this->db->quoteName('ucm_type_id') . ' = ' . $type_id + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__ucm_base')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $this->db->execute(); + } + + $this->app->enqueueMessage( + Text::_('All related items was removed from the #__ucm_base table.') + ); + } + + /** + * Remove ucm content values related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeUcmContent(string $context): void + { + // Remove Item items from the ucm content table + $condition = [ + $this->db->quoteName('core_type_alias') . ' = ' . $this->db->quote($context) + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__ucm_content')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $done = $this->db->execute(); + if ($done) + { + // If successfully removed Item add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) type alias was removed from the #__ucm_content table.', $context) + ); + } + } + + /** + * Remove content item tag map related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeContentItemTagMap(string $context): void + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Remove Item items from the contentitem tag map table + $condition = [ + $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context) + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__contentitem_tag_map')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $done = $this->db->execute(); + if ($done) + { + // If successfully remove Item add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) type alias was removed from the #__contentitem_tag_map table.', $context) + ); + } + } + + /** + * Remove action log config related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeActionLogConfig(string $context): void + { + // Remove ###component### view from the action_log_config table + $condition = [ + $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context) + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__action_log_config')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove com_###component###.view + $done = $this->db->execute(); + if ($done) + { + // If successfully removed ###component### view add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) type alias was removed from the #__action_log_config table.', $context) + ); + } + } + + /** + * Remove Asset Table Integrated + * + * @return void + * @since 4.4.2 + */ + protected function removeAssetData(): void + { + // Remove ###component### assets from the assets table + $condition = [ + $this->db->quoteName('name') . ' LIKE ' . $this->db->quote('com_###component###.%') + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__assets')); + $query->where($condition); + $this->db->setQuery($query); + $done = $this->db->execute(); + if ($done) + { + // If successfully removed ###component### add queued success message. + $this->app->enqueueMessage( + Text::_('All related (com_###component###) items was removed from the #__assets table.') + ); + } + } + + /** + * Remove action logs extensions integrated + * + * @return void + * @since 4.4.2 + */ + protected function removeActionLogsExtensions(): void + { + // Remove ###component### from the action_logs_extensions table + $extension = [ + $this->db->quoteName('extension') . ' = ' . $this->db->quote('com_###component###') + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__action_logs_extensions')); + $query->where($extension); + $this->db->setQuery($query); + + // Execute the query to remove ###component### + $done = $this->db->execute(); + if ($done) + { + // If successfully remove ###component### add queued success message. + $this->app->enqueueMessage( + Text::_('The (com_###component###) extension was removed from the #__action_logs_extensions table.') + ); + } + } + + /** + * Remove remove database fix (if possible) + * + * @return void + * @since 4.4.2 + */ + protected function removeDatabaseAssetsRulesFix(): void + { + // Get the biggest rule column in the assets table at this point. + $length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $this->db->setQuery($length); + if ($this->db->execute()) + { + $rule_length = $this->db->loadResult(); + // Check the size of the rules column + if ($rule_length < 5120) + { + // Revert the assets table rules column back to the default + $revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';"; + $this->db->setQuery($revert_rule); + $this->db->execute(); + + $this->app->enqueueMessage( + Text::_('Reverted the #__assets table rules column back to its default size of varchar(5120).') + ); + } + else + { + $this->app->enqueueMessage( + Text::_('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.') + ); + } + } + }###MOVEFOLDERSMETHOD### +} diff --git a/admin/compiler/joomla_4/LAYOUT_OVERRIDE.php b/admin/compiler/joomla_4/LAYOUT_OVERRIDE.php new file mode 100644 index 000000000..1db124be7 --- /dev/null +++ b/admin/compiler/joomla_4/LAYOUT_OVERRIDE.php @@ -0,0 +1,22 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###OVERRIDE_LAYOUT_HEADER### + +// No direct access to this file +defined('JPATH_BASE') or die;###OVERRIDE_LAYOUT_CODE### + +?>###OVERRIDE_LAYOUT_BODY### diff --git a/admin/compiler/joomla_4/LICENSE.txt b/admin/compiler/joomla_4/LICENSE.txt new file mode 100644 index 000000000..df50810b8 --- /dev/null +++ b/admin/compiler/joomla_4/LICENSE.txt @@ -0,0 +1,340 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/admin/compiler/joomla_4/README.md b/admin/compiler/joomla_4/README.md new file mode 100644 index 000000000..dbb7b6a53 --- /dev/null +++ b/admin/compiler/joomla_4/README.md @@ -0,0 +1 @@ +###README### \ No newline at end of file diff --git a/admin/compiler/joomla_4/README.txt b/admin/compiler/joomla_4/README.txt new file mode 100644 index 000000000..dbb7b6a53 --- /dev/null +++ b/admin/compiler/joomla_4/README.txt @@ -0,0 +1 @@ +###README### \ No newline at end of file diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW.php new file mode 100644 index 000000000..285eb38ee --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW.php @@ -0,0 +1,28 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###SITE_ADMIN_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die; + +?> +
+toolbar->render(); ?> +
+###EDITBODY### +
+
###EDITBODYSCRIPT### diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_CONTROLLER.php new file mode 100644 index 000000000..9379d7327 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_CONTROLLER.php @@ -0,0 +1,291 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; + +###SITE_ADMIN_VIEW_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###View### Form Controller + * + * @since 1.6 + */ +class ###View###Controller extends FormController +{ + use VersionableControllerTrait; + + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###_###VIEW###'; + + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * The context for storing internal data, e.g. record. + * + * @var string + * @since 1.6 + */ + protected $context = '###view###'; + + /** + * The URL view item variable. + * + * @var string + * @since 1.6 + */ + protected $view_item = '###view###'; + + /** + * The URL view list variable. + * + * @var string + * @since 1.6 + */ + protected $view_list = '###SITE_DEFAULT_VIEW###';###ADMIN_CUSTOM_BUTTONS_CONTROLLER### + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = []) + {###JCONTROLLERFORM_ALLOWADD### + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = [], $key = 'id') + {###JCONTROLLERFORM_ALLOWEDIT### + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 1.6 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); + + // set the referral options + if ($refid && $ref) + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; + } + elseif ($ref) + { + $append = '&ref='. (string) $ref . $append; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('###View###', '', []); + + // Preset the redirect + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64');###JCONTROLLERFORM_BEFORECANCEL### + + $cancel = parent::cancel($key); + + if (!is_null($return) && Uri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + Route::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; + + // Redirect to the item screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string) $this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + }###JCONTROLLERFORM_AFTERCANCEL### + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + Route::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; + + // Redirect to the item screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string) $this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) + {###POSTSAVEHOOK### + } + +} diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW_HTML.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_HTML.php new file mode 100644 index 000000000..0c4cc095d --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_HTML.php @@ -0,0 +1,138 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\View\###View###; + +###SITE_ADMIN_VIEW_HTML_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###View### Html View class + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // set params + $this->params = ComponentHelper::getParams('com_###component###'); + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ###Component###Helper::getActions('###view###', $this->item); + // get input + $jinput = Factory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string)$this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string)$return; + }###LINKEDVIEWITEMS### + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Set the html view document stuff + $this->_prepareDocument(); + + // Display the template + parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###ADDTOOLBAR### + // now initiate the toolbar + $this->toolbar = Toolbar::getInstance(); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = true, int $length = 30) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + { + $isNew = ($this->item->id < 1); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); + // the default style of this view + Html::_('stylesheet', "components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### + // default javascript of this view + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP### + Text::script('view not acceptable. Error'); + } +} diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODEL.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODEL.php new file mode 100644 index 000000000..51bf65ed8 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODEL.php @@ -0,0 +1,446 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Model; + +###SITE_ADMIN_VIEW_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###View### Admin Model + * + * @since 1.6 + */ +class ###View###Model extends AdminModel +{ + use VersionableModelTrait; + + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = ###TABLAYOUTFIELDSARRAY###; + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_###component###.###view###'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return Table A database object + * + * @since 3.0 + * @throws \Exception + */ + public function getTable($type = '###view###', $prefix = 'Administrator', $config = []) + { + // get instance of the table + return parent::getTable($type, $prefix, $config); + }###ADMIN_CUSTOM_BUTTONS_METHOD### + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + {###LICENSE_LOCKED_CHECK### + if ($item = parent::getItem($pk)) + { + if (!empty($item->params) && !is_array($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + }###METHOD_GET_ITEM### + }###LINKEDVIEWGLOBAL### + + return $item; + }###LINKEDVIEWMETHODS######LICENSE_LOCKED_SET_BOOL### + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = [], $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData;###JMODELADMIN_GETFORM### + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'media/com_###component###/js/###view###.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + {###JMODELADMIN_CANDELETE### + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + {###JMODELADMIN_CANEDITSTATE### + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = [], $key = 'id') + {###JMODELADMIN_ALLOWEDIT### + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param Table $table A Table object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + {###LICENSE_TABLE_LOCKED_CHECK### + $date = $this->getDatabase(); + $user = $this->getCurrentUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = $this->getDatabase(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__###component###_###view###')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []); + + if (empty($data)) + { + $data = $this->getItem(); + } + + // run the perprocess of the data + $this->preprocessData('com_###component###.###view###', $data); + + return $data; + }###VALIDATIONFIX######UNIQUEFIELDS### + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + {###JMODELADMIN_BEFORE_DELETE### + if (!parent::delete($pks)) + { + return false; + }###JMODELADMIN_AFTER_DELETE### + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + {###JMODELADMIN_BEFORE_PUBLISH### + if (!parent::publish($pks, $value)) + { + return false; + }###JMODELADMIN_AFTER_PUBLISH### + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + ArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(Text::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user ??= $this->getCurrentUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new UCMType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ###Component###Helper::getActions('###view###'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new UCMType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = ArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + }###MODEL_BATCH_COPY######MODEL_BATCH_MOVE### + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = Factory::getApplication()->input; + $filter = InputFilter::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new Registry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + }###CHECKBOX_SAVE######METHOD_ITEM_SAVE### + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new Registry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + }###TITLEALIASFIX### + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a unique value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUnique($field, $value) + { + // set field value unique + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = StringHelper::increment($value); + } + + return $value; + }###GENERATENEWTITLE### +} diff --git a/admin/compiler/joomla_4/SITE_AJAX_CONTROLLER.php b/admin/compiler/joomla_4/SITE_AJAX_CONTROLLER.php new file mode 100644 index 000000000..f69ef0234 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_AJAX_CONTROLLER.php @@ -0,0 +1,97 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use Joomla\CMS\Session\Session; +use Joomla\Input\Input; +use Joomla\Utilities\ArrayHelper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Ajax Base Controller + * + * @since 1.6 + */ +class AjaxController extends BaseController +{ + /** + * Constructor. + * + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input + * + * @since 3.0 + */ + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) + { + parent::__construct($config, $factory, $app, $input); + + // make sure all json stuff are set + $this->app->getDocument()->setMimeEncoding( 'application/json' ); + $this->app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); + $this->app->setHeader('Access-Control-Allow-Origin', '*'); + // load the tasks ###REGISTER_SITE_AJAX_TASK### + } + + public function ajax() + { + // get the user for later use + $user = $this->app->getIdentity(); + // get the input values + $jinput = $this->input ?? $this->app->input; + // check if we should return raw (DEFAULT TRUE SINCE J4) + $returnRaw = $jinput->get('raw', true, 'BOOLEAN'); + // return to a callback function + $callback = $jinput->get('callback', null, 'CMD'); + // Check Token! + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) + { + // get the task + $task = $this->getTask(); + switch($task) + {###AJAX_SITE_INPUT_RETURN### + } + } + else + { + // return to a callback function + if($callback) + { + echo $callback."(".json_encode(['error' => 'There was an error! [139]']).");"; + } + elseif($returnRaw) + { + echo json_encode(['error' => 'There was an error! [139]']); + } + else + { + echo "(".json_encode(['error' => 'There was an error! [139]']).");"; + } + } + } +} diff --git a/admin/compiler/joomla_4/SITE_AJAX_MODEL.php b/admin/compiler/joomla_4/SITE_AJAX_MODEL.php new file mode 100644 index 000000000..1cec88644 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_AJAX_MODEL.php @@ -0,0 +1,62 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Model; + +###AJAX_SITE_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Ajax List Model + * + * @since 1.6 + */ +class AjaxModel extends ListModel +{ + /** + * The component params. + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $app_params; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app_params = ComponentHelper::getParams('com_###component###'); + $this->app ??= Factory::getApplication(); + }###AJAX_SITE_MODEL_METHODS### +} diff --git a/admin/compiler/joomla_4/SITE_DISPATCHER.php b/admin/compiler/joomla_4/SITE_DISPATCHER.php new file mode 100644 index 000000000..c86e55ee1 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_DISPATCHER.php @@ -0,0 +1,41 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Dispatcher; + +use Joomla\CMS\Dispatcher\ComponentDispatcher; + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ComponentDispatcher class for com_###component### + * + * @since 4.0.0 + */ +class Dispatcher extends ComponentDispatcher +{ + /** + * Dispatch a controller task. Redirecting the user if appropriate. + * + * @return void + * + * @since 4.0.0 + */ + public function dispatch() + { + parent::dispatch(); + } +} diff --git a/admin/compiler/joomla_4/SITE_DISPLAY_CONTROLLER.php b/admin/compiler/joomla_4/SITE_DISPLAY_CONTROLLER.php new file mode 100644 index 000000000..93767574c --- /dev/null +++ b/admin/compiler/joomla_4/SITE_DISPLAY_CONTROLLER.php @@ -0,0 +1,132 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; +use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### master site display controller. + * + * @since 4.0 + */ +class DisplayController extends BaseController +{ + /** + * Method to display a view. + * + * @param boolean $cachable If true, the view output will be cached. + * @param boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link InputFilter::clean()}. + * + * @return DisplayController This object to support chaining. + * @since 1.5 + */ + function display($cachable = false, $urlparams = false) + { + // set default view if not set + $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###'); + $this->input->set('view', $view); + $isEdit = $this->checkEditView($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); + $cachable = true; + + // ensure that the view is not cashable if edit view or if user is logged in + $user = $this->app->getIdentity(); + if ($user->get('id') || $this->input->getMethod() === 'POST' || $isEdit) + { + $cachable = false; + } + + // Check for edit form. + if ($isEdit && !$this->checkEditId('com_###component###.edit.'.$view, $id)) + { + // check if item was opened from other than its own list view + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); + + // set redirect + if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) + { + // redirect to item of ref + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + } + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) + { + // redirect to ref + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false)); + } + else + { + // normal redirect back to the list default site view + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false)); + } + + // Somehow the person just went to the form - we don't allow that. + throw new \Exception(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 403); + } + + // we may need to make this more dynamic in the future. (TODO) + $safeurlparams = array( + 'catid' => 'INT', + 'id' => 'INT', + 'cid' => 'ARRAY', + 'year' => 'INT', + 'month' => 'INT', + 'limit' => 'UINT', + 'limitstart' => 'UINT', + 'showall' => 'INT', + 'return' => 'BASE64', + 'filter' => 'STRING', + 'filter_order' => 'CMD', + 'filter_order_Dir' => 'CMD', + 'filter-search' => 'STRING', + 'print' => 'BOOLEAN', + 'lang' => 'CMD', + 'Itemid' => 'INT'); + + // should these not merge? + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($urlparams)) + { + $safeurlparams = Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge(array($urlparams, $safeurlparams)); + } + + parent::display($cachable, $safeurlparams); + + return $this; + } + + protected function checkEditView($view) + { + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view)) + { + $views = [###SITE_EDIT_VIEW_ARRAY### + ]; + // check if this is a edit view + if (in_array($view,$views)) + { + return true; + } + } + return false; + } +} diff --git a/admin/compiler/joomla_4/SITE_FORM_CHECKBOXES_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_CHECKBOXES_FIELD.php new file mode 100644 index 000000000..bdc5586de --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_CHECKBOXES_FIELD.php @@ -0,0 +1,51 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\CheckboxesField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends CheckboxesField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_FORM_CUSTOM_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_CUSTOM_FIELD.php new file mode 100644 index 000000000..6feabb598 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_CUSTOM_FIELD.php @@ -0,0 +1,36 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; + +###SITE_FORM_CUSTOM_FIELD_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends ###FORM_EXTENDS### +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###';###FORM_CUSTOM_FIELD_PHP### +} diff --git a/admin/compiler/joomla_4/SITE_FORM_LIST_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_LIST_FIELD.php new file mode 100644 index 000000000..94dd388be --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_LIST_FIELD.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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\ListField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends ListField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###';###ADD_BUTTON### + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + * @since 1.6 + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_FORM_RADIO_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_RADIO_FIELD.php new file mode 100644 index 000000000..635a592ca --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_RADIO_FIELD.php @@ -0,0 +1,51 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\RadioField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends RadioField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_FORM_RULE.php b/admin/compiler/joomla_4/SITE_FORM_RULE.php new file mode 100644 index 000000000..533bd4f38 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_RULE.php @@ -0,0 +1,37 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Rule; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\Form; +use Joomla\CMS\Form\FormRule; +use Joomla\Registry\Registry; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('JPATH_PLATFORM') or die; + +/** + * Form Rule (###Name###) class for the Joomla Platform. + * + * @since 3.5 + */ +class ###Name###Rule extends FormRule +{###VALIDATION_RULE_METHODS### +} diff --git a/admin/compiler/joomla_4/SITE_FORM_USER_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_USER_FIELD.php new file mode 100644 index 000000000..4911b111a --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_USER_FIELD.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\UserField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends UserField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get the filtering groups (null means no filtering) + * + * @return mixed array of filtering groups or null. + * + * @since 1.6 + */ + protected function getGroups() + { + ###JFORM_GETGROUPS_PHP### + } + + /** + * Method to get the users to exclude from the list of users + * + * @return mixed Array of users to exclude or null to not exclude them + * + * @since 1.6 + */ + protected function getExcluded() + { + ###JFORM_GETEXCLUDED_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_HEADERCHECK.php b/admin/compiler/joomla_4/SITE_HEADERCHECK.php new file mode 100644 index 000000000..574f45eda --- /dev/null +++ b/admin/compiler/joomla_4/SITE_HEADERCHECK.php @@ -0,0 +1,135 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Document\Document; +use Joomla\CMS\Application\CMSApplication; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * Helper class for checking loaded scripts and styles in the document header. + * + * @since 3.2.0 + */ +class HeaderCheck +{ + /** + * @var CMSApplication Application object + * + * @since 3.2.0 + */ + protected CMSApplication $app; + + /** + * @var Document object + * + * @since 3.2.0 + */ + protected Document $document; + + /** + * Construct the app and document + * + * @since 3.2.0 + */ + public function __construct() + { + // Initializes the application object. + $this->app ??= Factory::getApplication(); + + // Initializes the document object. + $this->document = $this->app->getDocument(); + } + + /** + * Check if a JavaScript file is loaded in the document head. + * + * @param string $scriptName Name of the script to check. + * + * @return bool True if the script is loaded, false otherwise. + * @since 3.2.0 + */ + public function js_loaded(string $scriptName): bool + { + return $this->isLoaded($scriptName, 'scripts'); + } + + /** + * Check if a CSS file is loaded in the document head. + * + * @param string $scriptName Name of the stylesheet to check. + * + * @return bool True if the stylesheet is loaded, false otherwise. + * @since 3.2.0 + */ + public function css_loaded(string $scriptName): bool + { + return $this->isLoaded($scriptName, 'styleSheets'); + } + + /** + * Abstract method to check if a given script or stylesheet is loaded. + * + * @param string $scriptName Name of the script or stylesheet. + * @param string $type Type of asset to check ('scripts' or 'styleSheets'). + * + * @return bool True if the asset is loaded, false otherwise. + * @since 3.2.0 + */ + private function isLoaded(string $scriptName, string $type): bool + { + // UIkit specific check + if ($this->isUIkit($scriptName)) + { + return true; + } + + $head_data = $this->document->getHeadData(); + foreach (array_keys($head_data[$type]) as $script) + { + if (stristr($script, $scriptName)) + { + return true; + } + } + + return false; + } + + /** + * Check for UIkit framework specific conditions. + * + * @param string $scriptName Name of the script or stylesheet. + * + * @return bool True if UIkit specific conditions are met, false otherwise. + * @since 3.2.0 + */ + private function isUIkit(string $scriptName): bool + { + if (strpos($scriptName, 'uikit') !== false) + { + $get_template_name = $this->app->getTemplate('template')->template; + if (strpos($get_template_name, 'yoo') !== false) + { + return true; + } + } + return false; + } +} diff --git a/admin/compiler/joomla_3/JCB_Helper_site.php b/admin/compiler/joomla_4/SITE_HELPER_CLASS.php similarity index 55% rename from admin/compiler/joomla_3/JCB_Helper_site.php rename to admin/compiler/joomla_4/SITE_HELPER_CLASS.php index 2d37461ba..9b2cba942 100644 --- a/admin/compiler/joomla_3/JCB_Helper_site.php +++ b/admin/compiler/joomla_4/SITE_HELPER_CLASS.php @@ -2,46 +2,46 @@ /** * @package Joomla.Component.Builder * - * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @created 4th September 2022 + * @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 */ -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; ?> ###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper; -// No direct access to this file -defined('_JEXEC') or die('Restricted access');###SITE_POWER_HELPER### +###SITE_POWER_HELPER### ###SITE_HELPER_CLASS_HEADER### +// No direct access to this file +\defined('_JEXEC') or die; + /** * ###Component### component helper + * + * @since 3.0 */ abstract class ###Component###Helper { - /** - * Adding the utilities trait to this class - * - * @deprecated 4.0 - Check the trait methods for details, a legacy implementation - */ - use Utilities; - - /** - * get the Component Code Name - */ - public static $ComponentCodeName = '###component###'; - /** * Composer Switch - * + * * @var array */ - protected static $composer = array();###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### + protected static $composer = []; + + /** + * The Main Active Language + * + * @var string + */ + public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### /** * Load the Composer Vendors @@ -52,7 +52,7 @@ abstract class ###Component###Helper if (!isset(self::$composer[$target])) { // get the function name - $functionName = self::safeString('compose' . $target); + $functionName = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe('compose' . $target); // check if method exist if (method_exists(__CLASS__, $functionName)) { @@ -63,6 +63,25 @@ abstract class ###Component###Helper return self::$composer[$target]; } + /** + * Convert a json object to a string + * + * @input string $value The json string to convert + * + * @returns a string + * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(...); + */ + public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') + { + return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string( + $value, + $sperator, + $table, + $id, + $name + ); + } + /** * Load the Component xml manifest. */ @@ -74,7 +93,7 @@ abstract class ###Component###Helper /** * Joomla version object - */ + */ protected static $JVersion; /** @@ -83,9 +102,9 @@ abstract class ###Component###Helper public static function jVersion() { // check if set - if (!self::checkObject(self::$JVersion)) + if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -96,9 +115,9 @@ abstract class ###Component###Helper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) @@ -107,73 +126,77 @@ abstract class ###Component###Helper { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } - elseif($params->get("useContributor".$nr) == 2) - { + elseif($params->get("useContributor".$nr) == 2) + { $link_front = ''; $link_back = ''; } - else - { + else + { $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; }###HELP_SITE### /** - * Get any component's model + * Returns any Model object. + * + * @param string $type The model type to instantiate + * @param string $prefix Prefix for the model class name. Optional. + * @param string $component Component name the model belongs to. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel + * @throws \Exception + * @since 4.4 */ - public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array()) + public static function getModel(string $type, string $prefix = 'Site', + string $component = '###component###', array $config = []) { - // fix the name - $name = self::safeString($name); - // full path to models - $fullPathModels = $path . '/models'; - // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); - // make sure the table path is loaded - if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + // make sure the name is correct + $type = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($type, 'F'); + $component = strtolower($component); + + if ($prefix !== 'Site' && $prefix !== 'Administrator') { - // This is the JCB default path to tables in Joomla 3.x - $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + $prefix = self::getPrefixFromModelPath($prefix); } - // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); - // if model not found (strange) - if ($model == false) + + // Get the model through the MVCFactory + return Factory::getApplication()->bootComponent('com_' . $component)->getMVCFactory()->createModel($type, $prefix, $config); + } + + /** + * Get the prefix from the model path + * + * @param string $path The model path + * + * @return string The prefix value + * @since 4.4 + */ + protected static function getPrefixFromModelPath(string $path): string + { + // Check if $path starts with JPATH_ADMINISTRATOR path + if (str_starts_with($path, JPATH_ADMINISTRATOR . '/components/')) { - jimport('joomla.filesystem.file'); - // get file path - $filePath = $path . '/' . $name . '.php'; - $fullPathModel = $fullPathModels . '/' . $name . '.php'; - // check if it exists - if (File::exists($filePath)) - { - // get the file - require_once $filePath; - } - elseif (File::exists($fullPathModel)) - { - // get the file - require_once $fullPathModel; - } - // build class names - $modelClass = $Component . 'Model' . $name; - if (class_exists($modelClass)) - { - // initialize the model - return new $modelClass($config); - } + return 'Administrator'; } - return $model; + // Check if $path starts with JPATH_SITE path + elseif (str_starts_with($path, JPATH_SITE . '/components/')) + { + return 'Site'; + } + + return 'Site'; } /** @@ -181,14 +204,14 @@ abstract class ###Component###Helper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_###component###'); - + $parentId = $parent->id; $name = 'com_###component###.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -212,27 +235,27 @@ abstract class ###Component###Helper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else { // Create an asset_id or heal one that is corrupted. - $object = new stdClass(); + $object = new \StdClass(); // Must be a valid primary key value. $object->id = $id; $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); } } return false; @@ -249,7 +272,7 @@ abstract class ###Component###Helper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -264,8 +287,8 @@ abstract class ###Component###Helper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -280,7 +303,7 @@ abstract class ###Component###Helper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -288,8 +311,8 @@ abstract class ###Component###Helper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -331,10 +354,10 @@ abstract class ###Component###Helper * @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param array $attributes The attributes to apply to the XML element * - * @return void + * @return null * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); } @@ -348,7 +371,7 @@ abstract class ###Component###Helper * @return void * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); } @@ -403,26 +426,78 @@ abstract class ###Component###Helper // button attributes $buttonAttributes = array( 'type' => 'radio', - 'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', - 'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway + 'name' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]) : 'bool_button', + 'label' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); // set the button options $buttonOptions = array( - '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', - '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); + '1' => isset($args[3]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[3]) : 'JYES', + '0' => isset($args[4]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[4]) : 'JNO'); // return the input - return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; }###HELPER_UIKIT######HELPER_CREATEUSER### + /** + * 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 + * + * @return mix string/int/float + * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(...); + */ + public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###') + { + return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var( + $table, + $where, + $whereString, + $what, + $operator, + $main + ); + } + + /** + * 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 + * + * @return array + * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(...); + */ + public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true) + { + return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars( + $table, + $where, + $whereString, + $what, + $operator, + $main, + $unique + ); + } + public static function isPublished($id,$type) { if ($type == 'raw') { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__###component###_'.$type.' AS a'); @@ -440,7 +515,7 @@ abstract class ###Component###Helper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -465,39 +540,39 @@ abstract class ###Component###Helper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions - * + * @return object The CMSObject of permission/authorised actions + * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') { // load the user if not given - if (!self::checkObject($user)) + if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getApplication()->getIdentity(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) - $view = self::safeString($view); - if (self::checkString($views)) + $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views)) { - $views = self::safeString($views); - } + $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views); + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; } // get created by if not found - if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && !isset($record->created_by) && isset($record->id)) { - $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + $record->created_by = Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var($view, $record->id, 'id', 'created_by', '=', $component); } // set actions only set in component settings $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); @@ -506,12 +581,12 @@ abstract class ###Component###Helper if ($target) { // convert to an array - if (self::checkString($target)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($target)) { $target = array($target); } // check if we are good to go - if (self::checkArray($target)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($target)) { $checkTarget = true; } @@ -532,7 +607,7 @@ abstract class ###Component###Helper // set area $area = 'comp'; // check if the record has an ID and the action is item related (not a component action) - if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) { // we are in item @@ -565,7 +640,7 @@ abstract class ###Component###Helper } } } - elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views) && isset($record->catid) && $record->catid > 0) { // we are in item $area = 'category'; @@ -637,7 +712,7 @@ abstract class ###Component###Helper * @param array $targets The array of target actions * * @return boolean true if action should be filtered out - * + * */ protected static function filterActions(&$view, &$action, &$targets) { @@ -653,6 +728,58 @@ abstract class ###Component###Helper return true; } + /** + * Check if have an json string + * + * @input string The json string to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); + */ + public static function checkJson($string) + { + return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); + } + + /** + * Check if have an object with a length + * + * @input object The object to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); + */ + public static function checkObject($object) + { + return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); + } + + /** + * Check if have an array with a length + * + * @input array The array to check + * + * @returns bool/int number of items in array on success + * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); + */ + public static function checkArray($array, $removeEmptyString = false) + { + return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); + } + + /** + * Check if have a string with a length + * + * @input string The string to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); + */ + public static function checkString($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); + } + /** * Check if we are connected * Thanks https://stackoverflow.com/a/4860432/1429677 @@ -662,8 +789,8 @@ abstract class ###Component###Helper public static function isConnected() { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? - $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + $connected = @fsockopen("www.example.com", 80); + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -678,9 +805,122 @@ abstract class ###Component###Helper return $is_conn; } + /** + * Merge an array of array's + * + * @input array The arrays you would like to merge + * + * @returns array on success + * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); + */ + public static function mergeArrays($arrays) + { + return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); + } + // typo sorry! public static function sorten($string, $length = 40, $addTip = true) { return self::shorten($string, $length, $addTip); - }###HELPER_SITE_LICENSE_LOCK######GET_CRYPT_KEY### + } + + /** + * Shorten a string + * + * @input string The you would like to shorten + * + * @returns string on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...); + */ + public static function shorten($string, $length = 40, $addTip = true) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten($string, $length, $addTip); + } + + /** + * Making strings safe (various ways) + * + * @input string The you would like to make safe + * + * @returns string on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...); + */ + public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe( + $string, + $type, + $spacer, + $replaceNumbers, + $keepOnlyCharacters + ); + } + + /** + * Convert none English strings to code usable string + * + * @input an string + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); + */ + public static function transliterate($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); + } + + /** + * make sure a string is HTML save + * + * @input an html string + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...); + */ + public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html( + $var, + $charset, + $shorten, + $length + ); + }###HELPER_SITE_LICENSE_LOCK### + + /** + * Convert all int in a string to an English word string + * + * @input an string with numbers + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); + */ + public static function replaceNumbers($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); + } + + /** + * Convert an integer into an English word string + * Thanks to Tom Nicholson + * + * @input an int + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); + */ + public static function numberToString($x) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); + } + + /** + * Random Key + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size); + */ + public static function randomkey($size) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size); + }###GET_CRYPT_KEY### } diff --git a/admin/compiler/joomla_4/SITE_HELPER_CONTROLLER.php b/admin/compiler/joomla_4/SITE_HELPER_CONTROLLER.php new file mode 100644 index 000000000..bbc91bd97 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_HELPER_CONTROLLER.php @@ -0,0 +1,129 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\Database\DatabaseInterface; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; +use Joomla\Utilities\ArrayHelper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Help Base Controller + * + * @since 1.6 + */ +class HelpController extends BaseController +{ + public function __construct($config) + { + parent::__construct($config); + // load the tasks + $this->registerTask('getText', 'help'); + } + + public function help() + { + $user = Factory::getApplication()->getIdentity(); + $jinput = Factory::getApplication()->input; + // Check Token! + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) + { + $task = $this->getTask(); + switch($task){ + case 'getText': + try + { + $idValue = $jinput->get('id', 0, 'INT'); + if($idValue) + { + $result = $this->getHelpDocumentText($idValue); + } + else + { + $result = ''; + } + echo $result; + // stop execution gracefully + jexit(); + } + catch(Exception $e) + { + // stop execution gracefully + jexit(); + } + break; + } + } + else + { + // stop execution gracefully + jexit(); + } + } + + protected function getHelpDocumentText($id) + { + $db = Factory::getContainer()->get(DatabaseInterface::class); + $query = $db->getQuery(true); + $query->select(array('a.title','a.content')); + $query->from('#__###component###_help_document AS a'); + $query->where('a.id = '.(int) $id); + $query->where('a.published = 1'); + $query->where('a.location = 2'); + $db->setQuery($query); + $db->execute(); + if($db->getNumRows()) + { + $text = []; + $document = $db->loadObject(); + // fix image issue + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; + // set document template + $text[] = ""; + $text[] = ''; + $text[] = ""; + $text[] = ''; + $text[] = "".$document->title.""; + $text[] = ''; + $text[] = ''; + $text[] = ""; + $text[] = '
'; + $text[] = '
'; + $text[] = '
'; + // build the help text + $text[] = '

'.$document->title."

"; + $text[] = str_replace(array_keys($images),array_values($images),$document->content); + // end template + $text[] = '


'; + $text[] = '
'; + $text[] = ""; + $text[] = ""; + + return implode("\n",$text); + } + return false; + } +} diff --git a/admin/compiler/joomla_4/SITE_LAYOUT.php b/admin/compiler/joomla_4/SITE_LAYOUT.php new file mode 100644 index 000000000..4d22fd308 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_LAYOUT.php @@ -0,0 +1,22 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###SITE_LAYOUT_HEADER### + +// No direct access to this file +defined('JPATH_BASE') or die;###SITE_LAYOUT_CODE### + +?>###SITE_LAYOUT_BODY### diff --git a/admin/compiler/joomla_4/SITE_ROUTER.php b/admin/compiler/joomla_4/SITE_ROUTER.php new file mode 100644 index 000000000..ad70467df --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ROUTER.php @@ -0,0 +1,97 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Service; + +###SITE_ROUTER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * Router class for the ###Component_name### Component + * + * @since 3.10 + */ +class Router extends RouterView +{ + /** + * Flag to remove IDs + * + * @var boolean + * @since 4.0.0 + */ + protected $noIDs = false; + + /** + * The category factory + * + * @var CategoryFactoryInterface + * @since 4.0.0 + */ + private $categoryFactory; + + /** + * The category cache + * + * @var array + * @since 4.0.0 + */ + private $categoryCache = []; + + /** + * The db + * + * @var DatabaseInterface + * @since 4.0.0 + */ + private $db; + + /** + * The component params + * + * @var Registry + * @since 4.0.0 + */ + private $params; + + /** + * ###Component### Component router constructor + * + * @param SiteApplication $app The application object + * @param AbstractMenu $menu The menu object to work with + * @param CategoryFactoryInterface $categoryFactory The category object + * @param DatabaseInterface $db The database object + * + * @since 4.0.0 + */ + public function __construct( + SiteApplication $app, + AbstractMenu $menu, + CategoryFactoryInterface $categoryFactory, + DatabaseInterface $db) + { + $this->categoryFactory = $categoryFactory; + $this->db = $db; + $this->params = ComponentHelper::getParams('com_###component###'); + $this->noIDs = (bool) $this->params->get('sef_ids', false);###SITE_ROUTER_CONSTRUCTOR_BEFORE_PARENT### + + parent::__construct($app, $menu);###SITE_ROUTER_CONSTRUCTOR_AFTER_PARENT### + + $this->attachRule(new MenuRules($this)); + $this->attachRule(new StandardRules($this)); + $this->attachRule(new NomenuRules($this)); + }###SITE_ROUTER_METHODS### +} diff --git a/admin/compiler/joomla_4/SITE_ROUTE_HELPER.php b/admin/compiler/joomla_4/SITE_ROUTE_HELPER.php new file mode 100644 index 000000000..11c38f396 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ROUTE_HELPER.php @@ -0,0 +1,141 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Language\Multilanguage; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Categories\CategoryNode; +use Joomla\CMS\Categories\Categories; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Component Route Helper + * + * @since 1.5 + */ +abstract class RouteHelper +{ + protected static $lookup;###ROUTEHELPER### + + protected static function _findItem($needles = null,$type = null) + { + $app = Factory::getApplication(); + $menus = $app->getMenu('site'); + $language = isset($needles['language']) ? $needles['language'] : '*'; + + // Prepare the reverse lookup array. + if (!isset(self::$lookup[$language])) + { + self::$lookup[$language] = []; + + $component = ComponentHelper::getComponent('com_###component###'); + + $attributes = array('component_id'); + $values = array($component->id); + + if ($language != '*') + { + $attributes[] = 'language'; + $values[] = array($needles['language'], '*'); + } + + $items = $menus->getItems($attributes, $values); + + foreach ($items as $item) + { + if (isset($item->query) && isset($item->query['view'])) + { + $view = $item->query['view']; + + if (!isset(self::$lookup[$language][$view])) + { + self::$lookup[$language][$view] = []; + } + + if (isset($item->query['id'])) + { + /** + * Here it will become a bit tricky + * language != * can override existing entries + * language == * cannot override existing entries + */ + if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*') + { + self::$lookup[$language][$view][$item->query['id']] = $item->id; + } + } + else + { + self::$lookup[$language][$view][0] = $item->id; + } + } + } + } + + if ($needles) + { + foreach ($needles as $view => $ids) + { + if (isset(self::$lookup[$language][$view])) + { + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($ids)) + { + foreach ($ids as $id) + { + if (isset(self::$lookup[$language][$view][(int) $id])) + { + return self::$lookup[$language][$view][(int) $id]; + } + } + } + elseif (isset(self::$lookup[$language][$view][0])) + { + return self::$lookup[$language][$view][0]; + } + } + } + } + + if ($type) + { + // Check if the global menu item has been set. + $params = ComponentHelper::getParams('com_###component###'); + if ($item = $params->get($type.'_menu', 0)) + { + return $item; + } + } + + // Check if the active menuitem matches the requested language + $active = $menus->getActive(); + + if ($active + && $active->component == 'com_###component###' + && ($language == '*' || in_array($active->language, array('*', $language)) || !Multilanguage::isEnabled())) + { + return $active->id; + } + + // If not found, return language specific home link + $default = $menus->getDefault($language); + + return !empty($default->id) ? $default->id : null; + } +} diff --git a/admin/compiler/joomla_4/SITE_VIEW.php b/admin/compiler/joomla_4/SITE_VIEW.php new file mode 100644 index 000000000..baa8a5f8b --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEW.php @@ -0,0 +1,23 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###SITE_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######SITE_CODE_BODY### + +?> +###SITE_TOP_FORM######SITE_TOP_BUTTON######SITE_BODY######SITE_BOTTOM_BUTTON######SITE_BOTTOM_FORM### diff --git a/admin/compiler/joomla_4/SITE_VIEWS.php b/admin/compiler/joomla_4/SITE_VIEWS.php new file mode 100644 index 000000000..c2efa4f45 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEWS.php @@ -0,0 +1,23 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###SITE_VIEWS_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######SITE_CODE_BODY### + +?> +###SITE_TOP_FORM######SITE_TOP_BUTTON######SITE_BODY######SITE_BOTTOM_BUTTON######SITE_BOTTOM_FORM### diff --git a/admin/compiler/joomla_4/SITE_VIEWS_HTML.php b/admin/compiler/joomla_4/SITE_VIEWS_HTML.php new file mode 100644 index 000000000..b59f57ef7 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEWS_HTML.php @@ -0,0 +1,108 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\View\###SViews###; + +###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###SViews### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // get combined params of both component and menu + $this->app ??= Factory::getApplication(); + $this->params = $this->app->getParams(); + $this->menu = $this->app->getMenu()->getActive(); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + // get the user object + $this->user ??= $this->app->getIdentity();###SITE_DIPLAY_METHOD### + }###SITE_EXTRA_DIPLAY_METHODS### + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###SITE_DOCUMENT_CUSTOM_CSS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###SITE_CUSTOM_BUTTONS### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + // now initiate the toolbar + $this->toolbar = Toolbar::getInstance(); + }###SITE_GET_MODULE### + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = false, int $length = 40) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } +} diff --git a/admin/compiler/joomla_4/SITE_VIEWS_MODEL.php b/admin/compiler/joomla_4/SITE_VIEWS_MODEL.php new file mode 100644 index 000000000..bbb1676d2 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEWS_MODEL.php @@ -0,0 +1,212 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Model; + +###SITE_VIEWS_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### List Model for ###SViews### + * + * @since 1.6 + */ +class ###SViews###Model extends ListModel +{ + /** + * Represents the current user object. + * + * @var User The user object representing the current user. + * @since 3.2.0 + */ + protected User $user; + + /** + * The unique identifier of the current user. + * + * @var int|null The ID of the current user. + * @since 3.2.0 + */ + protected ?int $userId; + + /** + * Flag indicating whether the current user is a guest. + * + * @var int 1 if the user is a guest, 0 otherwise. + * @since 3.2.0 + */ + protected int $guest; + + /** + * An array of groups that the current user belongs to. + * + * @var array|null An array of user group IDs. + * @since 3.2.0 + */ + protected ?array $groups; + + /** + * An array of view access levels for the current user. + * + * @var array|null An array of access level IDs. + * @since 3.2.0 + */ + protected ?array $levels; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The input object, providing access to the request data. + * + * @var Input The input object. + * @since 3.2.0 + */ + protected Input $input; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'components/com_###component###/assets/css/site.css', + 'components/com_###component###/assets/css/###sview###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'components/com_###component###/assets/js/site.js' + ]; + + /** + * A custom property for UIKit components. (not used unless you load v2) + */ + protected $uikitComp; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + $this->input ??= $this->app->getInput(); + + // Set the current user for authorisation checks (for those calling this model directly) + $this->user ??= $this->getCurrentUser(); + $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(); + + // will be removed + $this->initSet = true; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + * @since 1.6 + */ + protected function getListQuery() + {###SITE_GET_LIST_QUERY### + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + * @since 1.6 + */ + public function getItems() + { + $user = $this->user;###USER_PERMISSION_CHECK_ACCESS######LICENSE_LOCKED_CHECK######SITE_BEFORE_GET_ITEMS### + // load parent items + $items = parent::getItems(); + + // Get the global params + $globalParams = ComponentHelper::getParams('com_###component###', true);###SITE_GET_ITEMS######SITE_AFTER_GET_ITEMS### + + // return items + return $items; + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###LICENSE_LOCKED_SET_BOOL######SITE_CUSTOM_METHODS######SITE_CUSTOM_BUTTONS_METHOD### +} diff --git a/admin/compiler/joomla_4/SITE_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/SITE_VIEW_CONTROLLER.php new file mode 100644 index 000000000..0b5676074 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEW_CONTROLLER.php @@ -0,0 +1,120 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; + +###SITE_VIEW_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###SView### Form Controller + * + * @since 1.6 + */ +class ###SView###Controller extends FormController +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###'; + + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * The URL view list variable. + * + * @var string + * @since 1.6 + */ + protected $view_list = '###SITE_DEFAULT_VIEW###';###SITE_CUSTOM_BUTTONS_CONTROLLER### + + /** + * Method to check if you can edit an existing record. + * + * Extended classes can override this if necessary. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key; default is id. + * + * @return boolean + * + * @since 12.2 + */ + protected function allowEdit($data = [], $key = 'id') + { + // to insure no other tampering + return false; + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = []) + { + // to insure no other tampering + return false; + } + + /** + * Method to check if you can save a new or existing record. + * + * Extended classes can override this if necessary. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 12.2 + */ + protected function allowSave($data, $key = 'id') + { + // to insure no other tampering + return false; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModelLegacy $model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 12.2 + */ + protected function postSaveHook(JModelLegacy $model, $validData = []) + { + } +} diff --git a/admin/compiler/joomla_4/SITE_VIEW_HTML.php b/admin/compiler/joomla_4/SITE_VIEW_HTML.php new file mode 100644 index 000000000..19ad53193 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEW_HTML.php @@ -0,0 +1,108 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\View\###SView###; + +###SITE_VIEW_HTML_HEADER######SITE_GET_MODULE_JIMPORT### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###SView### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // get combined params of both component and menu + $this->app ??= Factory::getApplication(); + $this->params = $this->app->getParams(); + $this->menu = $this->app->getMenu()->getActive(); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + // get the user object + $this->user ??= $this->app->getIdentity();###SITE_DIPLAY_METHOD### + }###SITE_EXTRA_DIPLAY_METHODS### + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###SITE_DOCUMENT_CUSTOM_CSS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###SITE_CUSTOM_BUTTONS### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###sview###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + // now initiate the toolbar + $this->toolbar = Toolbar::getInstance(); + }###SITE_GET_MODULE### + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = false, int $length = 40) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } +} diff --git a/admin/compiler/joomla_4/SITE_VIEW_MODEL.php b/admin/compiler/joomla_4/SITE_VIEW_MODEL.php new file mode 100644 index 000000000..fe73b93a4 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEW_MODEL.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Model; + +###SITE_VIEW_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###SView### Item Model + * + * @since 1.6 + */ +class ###SView###Model extends ItemModel +{ + /** + * Model context string. + * + * @var string + * @since 1.6 + */ + protected $_context = 'com_###component###.###sview###'; + + /** + * Represents the current user object. + * + * @var User The user object representing the current user. + * @since 3.2.0 + */ + protected User $user; + + /** + * The unique identifier of the current user. + * + * @var int|null The ID of the current user. + * @since 3.2.0 + */ + protected ?int $userId; + + /** + * Flag indicating whether the current user is a guest. + * + * @var int 1 if the user is a guest, 0 otherwise. + * @since 3.2.0 + */ + protected int $guest; + + /** + * An array of groups that the current user belongs to. + * + * @var array|null An array of user group IDs. + * @since 3.2.0 + */ + protected ?array $groups; + + /** + * An array of view access levels for the current user. + * + * @var array|null An array of access level IDs. + * @since 3.2.0 + */ + protected ?array $levels; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The input object, providing access to the request data. + * + * @var Input The input object. + * @since 3.2.0 + */ + protected Input $input; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'components/com_###component###/assets/css/site.css', + 'components/com_###component###/assets/css/###sview###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'components/com_###component###/assets/js/site.js' + ]; + + /** + * A custom property for UI Kit components. + * + * @var array|null Property for storing UI Kit component-related data or objects. + * @since 3.2.0 + */ + protected ?array $uikitComp; + + /** + * @var object item + * @since 1.6 + */ + protected $item; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 3.0 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + $this->input ??= $this->app->getInput(); + + // Set the current user for authorisation checks (for those calling this model directly) + $this->user ??= $this->getCurrentUser(); + $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(); + + // will be removed + $this->initSet = true; + } + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @return void + * @since 1.6 + */ + protected function populateState() + { + // Get the itme main id + $id = $this->input->getInt('id', null); + $this->setState('###sview###.id', $id); + + // Load the parameters. + $params = $this->app->getParams(); + $this->setState('params', $params); + + 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. + * @since 1.6 + */ + public function getItem($pk = null) + {###USER_PERMISSION_CHECK_ACCESS### + + $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM### + + if ($this->_item === null) + { + $this->_item = []; + }###LICENSE_LOCKED_CHECK### + + if (!isset($this->_item[$pk])) + { + try + {###SITE_GET_ITEM### + } + catch (\Exception $e) + { + if ($e->getCode() == 404) + { + // Need to go thru the error handler to allow Redirect to work. + throw $e; + } + else + { + $this->setError($e); + $this->_item[$pk] = false; + } + } + }###SITE_AFTER_GET_ITEM### + + return $this->_item[$pk]; + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###LICENSE_LOCKED_SET_BOOL######SITE_CUSTOM_METHODS######SITE_CUSTOM_BUTTONS_METHOD### +} diff --git a/admin/compiler/joomla_4/access.xml b/admin/compiler/joomla_4/access.xml new file mode 100644 index 000000000..95908e259 --- /dev/null +++ b/admin/compiler/joomla_4/access.xml @@ -0,0 +1,4 @@ + + + ###ACCESS_SECTIONS### + \ No newline at end of file diff --git a/admin/compiler/joomla_4/admin.css b/admin/compiler/joomla_4/admin.css new file mode 100644 index 000000000..589b9cd9b --- /dev/null +++ b/admin/compiler/joomla_4/admin.css @@ -0,0 +1,7 @@ +###BOM### + +/* CSS Document */ +.no-click { + pointer-events: none; +} +###ADMINCSS### diff --git a/admin/compiler/joomla_4/admin.js b/admin/compiler/joomla_4/admin.js new file mode 100644 index 000000000..9c701e5be --- /dev/null +++ b/admin/compiler/joomla_4/admin.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###ADMINJS### \ No newline at end of file diff --git a/admin/compiler/joomla_4/component.xml b/admin/compiler/joomla_4/component.xml new file mode 100644 index 000000000..7dad78c48 --- /dev/null +++ b/admin/compiler/joomla_4/component.xml @@ -0,0 +1,87 @@ + + + COM_###COMPONENT### + ###BUILDDATE### + ###AUTHOR### + ###AUTHOREMAIL### + ###AUTHORWEBSITE### + ###COPYRIGHT### + ###LICENSE### + ###ACTUALVERSION### + ###Component_name### (v.###ACTUALVERSION###) +
+

###DESCRIPTION###

+

Created by ###AUTHOR###
Development started ###CREATIONDATE###

+ ]]>
+ ###NAMESPACEPREFIX###\Component\###ComponentNameSpace### + + + + + sql/install.mysql.utf8.sql + + + + + + + sql/uninstall.mysql.utf8.sql + + + + + ###Component###InstallerScript.php + + + index.html###EXSTRA_MEDIA_FILES### + js + css + images###EXSTRA_MEDIA_FOLDERS### + + + + + + sql/updates/mysql/ + + + + + index.html###EXSTRA_SITE_FILES### + assets + forms + layouts + src + tmpl###EXSTRA_SITE_FOLDERS### + + + + ###SITE_LANGUAGES### + + + + COM_###COMPONENT###_MENU + + ###MAINMENUS### + + + access.xml + config.xml + index.html###EXSTRA_ADMIN_FILES### + assets + forms + layouts + presets + services + sql + src + tmpl###EXSTRA_ADMIN_FOLDERS### + + + + ###ADMIN_LANGUAGES### + + + ###UPDATESERVER### +
\ No newline at end of file diff --git a/admin/compiler/joomla_4/config.xml b/admin/compiler/joomla_4/config.xml new file mode 100644 index 000000000..50b98e1fe --- /dev/null +++ b/admin/compiler/joomla_4/config.xml @@ -0,0 +1,19 @@ + + + ###CONFIG_FIELDSETS### +
+ +
+
\ No newline at end of file diff --git a/admin/compiler/joomla_4/dashboard.css b/admin/compiler/joomla_4/dashboard.css new file mode 100644 index 000000000..6502707ff --- /dev/null +++ b/admin/compiler/joomla_4/dashboard.css @@ -0,0 +1,155 @@ +###BOM### + +/* CSS Document */ + +.dashboard-container { + margin-left: 10px; + margin-top: 10px; + width: 100%; +} +.dashboard-container [class*="span"] { + display: block; + float: none; + margin-left: 0; + width: auto; +} +.dashboard-container:before, .dashboard-container:after { + content: ""; + display: table; +} +.dashboard-container:after { + clear: both; +} +.dashboard-container [class*="span"] { + box-sizing: border-box; + display: block; + float: left; + min-height: 145px; + min-width: 96px; + width: 100%; +} +.dashboard-container [class*="span"]:first-child { + margin-left: 0; +} +.dashboard-wraper { + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 5px; + float: left; + margin: 1%; + padding: 3px; + width: 17%; + min-height: 194px; + min-width: 96px; +} +.dashboard-content a { + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + min-height: 89px; + padding: 10px; + text-align: center; + text-decoration: none; +} +.dashboard-content a:hover { + background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + color: hsl(200, 100%, 30%); + text-decoration: none; +} +.dashboard-title { + display: block; + padding-top: 5px; +} +.dashboard-info { + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + font-size: 12px; + padding: 10px; + text-align: center; +} +.dashboard-info span { + display: block; + text-align: center; +} +.dashboard-info img { + margin: 0 auto; +} +.dashboard-table { + border-top: 1px solid hsl(0, 0%, 87%); + margin-top: 5px; + width: 100%; +} +.dashboard-info h5 { + font-size: 11px; + font-weight: bold; +} +.dashboard-block { + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 76%); + border-radius: 3px; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; + margin-bottom: 20px; +} +.dashboard-block .dashboard-block-head { + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border-bottom: 1px solid hsl(0, 0%, 76%); + border-radius: 3px 3px 0 0; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); + height: 40px; + position: relative; +} +.dashboard-block .dashboard-block-head h5 { + font-size: 12px; + margin: 0; + padding-left: 10px; + padding-top: 11px; + text-transform: uppercase; +} +.dashboard-block .dashboard-block-content { + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 0 0 3px 3px; +} +.dashboard-block .dashboard-block-box { + background: none repeat scroll 0 0 hsl(0, 0%, 100%); + border-top: 1px solid hsl(0, 0%, 82%); + box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; +} +.dashboard-block .dashboard-block-content .dashboard-block-box { + margin-top: 0 !important; +} +.dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table { + margin-bottom: 0 !important; +} +.dashboard-block-table { + background-color: hsla(0, 0%, 0%, 0); + border-collapse: collapse; + border-spacing: 0; + margin-bottom: 20px; + max-width: 100%; + width: 100%; +} +.dashboard-block-table th, .dashboard-block-table td { + border-top: 1px solid hsl(0, 0%, 87%); + line-height: 20px; + padding: 5px; + text-align: left; + vertical-align: middle; +} +.dashboard-badge { + background-color: hsl(0, 0%, 60%); + border-radius: 9px; + color: hsl(0, 0%, 100%); + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + padding: 1px 9px 2px; + text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); + vertical-align: baseline; + white-space: nowrap; +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/default.xml b/admin/compiler/joomla_4/default.xml new file mode 100644 index 000000000..10a8e4742 --- /dev/null +++ b/admin/compiler/joomla_4/default.xml @@ -0,0 +1 @@ +###SITE_MENU_XML### \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_batch_body.php b/admin/compiler/joomla_4/default_batch_body.php new file mode 100644 index 000000000..6ca60b2b1 --- /dev/null +++ b/admin/compiler/joomla_4/default_batch_body.php @@ -0,0 +1,26 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_batch_footer.php b/admin/compiler/joomla_4/default_batch_footer.php new file mode 100644 index 000000000..701e3c69b --- /dev/null +++ b/admin/compiler/joomla_4/default_batch_footer.php @@ -0,0 +1,30 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> + + + + \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_body.php b/admin/compiler/joomla_4/default_body.php new file mode 100644 index 000000000..05456df25 --- /dev/null +++ b/admin/compiler/joomla_4/default_body.php @@ -0,0 +1,28 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +$edit = "index.php?option=com_###component###&view=###views###&task=###view###.edit"; + +?> +###LISTBODY### \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_custom_admin_template.php b/admin/compiler/joomla_4/default_custom_admin_template.php new file mode 100644 index 000000000..5601278f7 --- /dev/null +++ b/admin/compiler/joomla_4/default_custom_admin_template.php @@ -0,0 +1,24 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_TEMPLATE_CODE_BODY### + +?>###CUSTOM_ADMIN_TEMPLATE_BODY### diff --git a/admin/compiler/joomla_4/default_foot.php b/admin/compiler/joomla_4/default_foot.php new file mode 100644 index 000000000..b5c0121af --- /dev/null +++ b/admin/compiler/joomla_4/default_foot.php @@ -0,0 +1,23 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_head.php b/admin/compiler/joomla_4/default_head.php new file mode 100644 index 000000000..c21d39531 --- /dev/null +++ b/admin/compiler/joomla_4/default_head.php @@ -0,0 +1,24 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> +###LISTHEAD### \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_import.php b/admin/compiler/joomla_4/default_import.php new file mode 100644 index 000000000..05ff76fe1 --- /dev/null +++ b/admin/compiler/joomla_4/default_import.php @@ -0,0 +1,199 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + +?> + + +
+
+
+ + hasPackage && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headerList) && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headers)) : ?> +
+ +
+ +
+ +
+
+ headerList as $name => $title): ?> +
+ +
+ +
+
+ +
+ +
+
+ + + 'upload')); ?> + + +
+ +
+ +
+ +
+
+
+     (.csv .xls .ods) +
+
+ + + +
+ +
+ +
+ +
+
+
+     (.csv .xls .ods) +
+
+ + + +
+ +
+ +
+ +
+
+
+     (.csv .xls .ods) +
+
+ + + + + + + +
\ No newline at end of file diff --git a/admin/compiler/joomla_4/default_import_custom.php b/admin/compiler/joomla_4/default_import_custom.php new file mode 100644 index 000000000..91b71fce6 --- /dev/null +++ b/admin/compiler/joomla_4/default_import_custom.php @@ -0,0 +1,30 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + +?>###IMPORT_DEFAULT_VIEW_CUSTOM### diff --git a/admin/compiler/joomla_4/default_list.xml b/admin/compiler/joomla_4/default_list.xml new file mode 100644 index 000000000..5f42db0d7 --- /dev/null +++ b/admin/compiler/joomla_4/default_list.xml @@ -0,0 +1,6 @@ + + + + COM_###COMPONENT###_MENU_###VIEWS###_DESC + + \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_main.php b/admin/compiler/joomla_4/default_main.php new file mode 100644 index 000000000..91b3fcb0a --- /dev/null +++ b/admin/compiler/joomla_4/default_main.php @@ -0,0 +1,37 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; + +// No direct access to this file +defined('_JEXEC') or die; + +?> +icons['main']) && is_array($this->icons['main'])) :?> + icons['main'] as $icon): ?> + + +
+ +

+ \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_site_template.php b/admin/compiler/joomla_4/default_site_template.php new file mode 100644 index 000000000..13daeb11f --- /dev/null +++ b/admin/compiler/joomla_4/default_site_template.php @@ -0,0 +1,24 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######SITE_TEMPLATE_CODE_BODY### + +?>###SITE_TEMPLATE_BODY### diff --git a/admin/compiler/joomla_4/default_toolbar.php b/admin/compiler/joomla_4/default_toolbar.php new file mode 100644 index 000000000..6fb862f1e --- /dev/null +++ b/admin/compiler/joomla_4/default_toolbar.php @@ -0,0 +1,53 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/compiler/joomla_4/default_vdm.php b/admin/compiler/joomla_4/default_vdm.php new file mode 100644 index 000000000..2af4045b4 --- /dev/null +++ b/admin/compiler/joomla_4/default_vdm.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; + +// No direct access to this file +defined('_JEXEC') or die; + +?> +<?php echo Text::_('COM_###COMPONENT###'); ?> + +
+contributors)): ?> + contributors) > 1): ?> +

+ +

+ +
    + contributors as $contributor): ?> +
  • :
  • + +
+
+ \ No newline at end of file diff --git a/admin/compiler/joomla_4/edit.xml b/admin/compiler/joomla_4/edit.xml new file mode 100644 index 000000000..10a8e4742 --- /dev/null +++ b/admin/compiler/joomla_4/edit.xml @@ -0,0 +1 @@ +###SITE_MENU_XML### \ No newline at end of file diff --git a/admin/compiler/joomla_4/en-GB.com_admin.ini b/admin/compiler/joomla_4/en-GB.com_admin.ini new file mode 100644 index 000000000..e5b382a4a --- /dev/null +++ b/admin/compiler/joomla_4/en-GB.com_admin.ini @@ -0,0 +1 @@ +###LANG_ADMIN### \ No newline at end of file diff --git a/admin/compiler/joomla_4/en-GB.com_admin.sys.ini b/admin/compiler/joomla_4/en-GB.com_admin.sys.ini new file mode 100644 index 000000000..fc07f9846 --- /dev/null +++ b/admin/compiler/joomla_4/en-GB.com_admin.sys.ini @@ -0,0 +1 @@ +###LANG_ADMIN_SYS### \ No newline at end of file diff --git a/admin/compiler/joomla_4/en-GB.com_site.ini b/admin/compiler/joomla_4/en-GB.com_site.ini new file mode 100644 index 000000000..7a78b98b2 --- /dev/null +++ b/admin/compiler/joomla_4/en-GB.com_site.ini @@ -0,0 +1 @@ +###LANG_SITE### \ No newline at end of file diff --git a/admin/compiler/joomla_4/en-GB.com_site.sys.ini b/admin/compiler/joomla_4/en-GB.com_site.sys.ini new file mode 100644 index 000000000..7e16bfbe8 --- /dev/null +++ b/admin/compiler/joomla_4/en-GB.com_site.sys.ini @@ -0,0 +1 @@ +###LANG_SITE_SYS### \ No newline at end of file diff --git a/admin/compiler/joomla_4/filter_forms.xml b/admin/compiler/joomla_4/filter_forms.xml new file mode 100644 index 000000000..9f2d5d31c --- /dev/null +++ b/admin/compiler/joomla_4/filter_forms.xml @@ -0,0 +1,9 @@ + +
+###FIELDFILTERSETS### + +###FIELDLISTSETS### +
\ No newline at end of file diff --git a/admin/compiler/joomla_4/import.gif b/admin/compiler/joomla_4/import.gif new file mode 100644 index 000000000..10bcb8569 Binary files /dev/null and b/admin/compiler/joomla_4/import.gif differ diff --git a/admin/compiler/joomla_4/index.html b/admin/compiler/joomla_4/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/compiler/joomla_4/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/compiler/joomla_4/install.mysql.utf8.sql b/admin/compiler/joomla_4/install.mysql.utf8.sql new file mode 100644 index 000000000..50bd3de50 --- /dev/null +++ b/admin/compiler/joomla_4/install.mysql.utf8.sql @@ -0,0 +1 @@ +###INSTALL### diff --git a/admin/compiler/joomla_4/layout.php b/admin/compiler/joomla_4/layout.php new file mode 100644 index 000000000..e5970ef27 --- /dev/null +++ b/admin/compiler/joomla_4/layout.php @@ -0,0 +1,47 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + ###LAYOUTITEMS### +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/compiler/joomla_4/layoutfull.php b/admin/compiler/joomla_4/layoutfull.php new file mode 100644 index 000000000..695619600 --- /dev/null +++ b/admin/compiler/joomla_4/layoutfull.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + ###LAYOUTITEMS### +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/compiler/joomla_4/layoutitems.php b/admin/compiler/joomla_4/layoutitems.php new file mode 100644 index 000000000..e5970ef27 --- /dev/null +++ b/admin/compiler/joomla_4/layoutitems.php @@ -0,0 +1,47 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + ###LAYOUTITEMS### +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/compiler/joomla_4/layoutlinkedview.php b/admin/compiler/joomla_4/layoutlinkedview.php new file mode 100644 index 000000000..92789487a --- /dev/null +++ b/admin/compiler/joomla_4/layoutlinkedview.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +defined('_JEXEC') or die; + +// set the defaults +$items = $displayData->###LAYOUTITEMS###; +$user = Factory::getApplication()->getIdentity(); +$id = $displayData->item->id; +###LAYOUTITEMSHEADER### + +?> +
+###LAYOUTITEMSTABLE### +
diff --git a/admin/compiler/joomla_4/layoutmetadata.php b/admin/compiler/joomla_4/layoutmetadata.php new file mode 100644 index 000000000..80877adb6 --- /dev/null +++ b/admin/compiler/joomla_4/layoutmetadata.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 + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; + +// No direct access to this file +defined('_JEXEC') or die; + +$form = $displayData->getForm(); + +// JLayout for standard handling of metadata fields in the administrator content edit screens. +$fieldSets = $form->getFieldsets('metadata'); +?> + + $fieldSet) : ?> + description) && trim($fieldSet->description)) : ?> +

escape(Text::_($fieldSet->description)); ?>

+ + + renderField('metadesc'); + echo $form->renderField('metakey'); + } + + foreach ($form->getFieldset($name) as $field) + { + if ($field->name != 'jform[metadata][tags][]') + { + echo $field->renderField(); + } + } ?> + diff --git a/admin/compiler/joomla_4/layoutpublished.php b/admin/compiler/joomla_4/layoutpublished.php new file mode 100644 index 000000000..e5970ef27 --- /dev/null +++ b/admin/compiler/joomla_4/layoutpublished.php @@ -0,0 +1,47 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + ###LAYOUTITEMS### +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/compiler/joomla_4/layouttitle.php b/admin/compiler/joomla_4/layouttitle.php new file mode 100644 index 000000000..becaaccda --- /dev/null +++ b/admin/compiler/joomla_4/layouttitle.php @@ -0,0 +1,57 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: [ + ###LAYOUTITEMS### +]; + +// Ensure $fields is treated as an array and count its size. +$size = count((array) $fields); + +// Use a ternary operator to determine the class. +// If there are 1 to 4 fields, set the class to divide the 12-grid column equally among the fields. +// For more than 4 fields, default to four columns (3-grid each) for medium and larger screens. +$css_class = ($size > 0 && $size <= 4) ? 'col-12 col-md-' . round(12 / $size) : 'col-12 col-md-3'; + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, ['class' => $css_class . ' control-wrapper-' . $field]); ?> + +
+ diff --git a/admin/compiler/joomla_4/module_forms.js b/admin/compiler/joomla_4/module_forms.js new file mode 100644 index 000000000..4bf5019bf --- /dev/null +++ b/admin/compiler/joomla_4/module_forms.js @@ -0,0 +1,3 @@ +###BOM### + +###VIEW_SCRIPT### diff --git a/admin/compiler/joomla_4/module_forms.xml b/admin/compiler/joomla_4/module_forms.xml new file mode 100644 index 000000000..bb0dcdb30 --- /dev/null +++ b/admin/compiler/joomla_4/module_forms.xml @@ -0,0 +1,12 @@ + +
+ + + + ###FIELDSETS### + + ###ACCESSCONTROL### +
\ No newline at end of file diff --git a/admin/compiler/joomla_4/settings.json b/admin/compiler/joomla_4/settings.json new file mode 100644 index 000000000..4cc56d0f4 --- /dev/null +++ b/admin/compiler/joomla_4/settings.json @@ -0,0 +1,824 @@ +{ + "create": { + "admin": { + "assets": { + "css": "css", + "images": { + "icons": "icons" + }, + "js": "js" + }, + "forms": "forms", + "language": { + "en-GB": "en-GB" + }, + "presets": "presets", + "services": "services", + "src": { + "Controller": "Controller", + "Extension": "Extension", + "Rule": "Rule", + "Field": "Field", + "Helper": "Helper", + "Model": "Model", + "Service": "Service", + "Table": "Table", + "View": "View" + }, + "sql": { + "updates": { + "mysql": "mysql" + }, + "xml": "xml" + }, + "tmpl": "tmpl" + }, + "site": { + "assets": { + "css": "css", + "images": "images", + "js": "js" + }, + "language": { + "en-GB": "en-GB" + }, + "forms": "forms", + "src": { + "Controller": "Controller", + "Dispatcher": "Dispatcher", + "Rule": "Rule", + "Field": "Field", + "Helper": "Helper", + "Model": "Model", + "Service": "Service", + "View": "View" + }, + "tmpl": "tmpl" + }, + "media": { + "css": "css", + "images": "images", + "js": "js" + } + }, + "move": { + "static": { + "ADMIN_PROVIDER.php": { + "naam": "ADMIN_PROVIDER.php", + "path": "c0mp0n3nt/admin/services", + "rename": "new", + "newName": "provider.php", + "type": "file" + }, + "ADMIN_EXTENSION_COMPONENT.php": { + "naam": "ADMIN_EXTENSION_COMPONENT.php", + "path": "c0mp0n3nt/admin/src/Extension", + "rename": "new", + "newName": "[[[Component]]]Component.php", + "type": "file" + }, + "ADMIN_DISPLAY_CONTROLLER.php": { + "naam": "ADMIN_DISPLAY_CONTROLLER.php", + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "DisplayController.php", + "type": "file" + }, + "SITE_DISPLAY_CONTROLLER.php": { + "naam": "SITE_DISPLAY_CONTROLLER.php", + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "DisplayController.php", + "type": "file" + }, + "access.xml": { + "naam": "access.xml", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "config.xml": { + "naam": "config.xml", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "component.xml": { + "naam": "component.xml", + "path": "c0mp0n3nt/", + "rename": "component", + "type": "file" + }, + "admin.css": { + "naam": "admin.css", + "path": "c0mp0n3nt/admin/assets/css", + "rename": false, + "type": "file" + }, + "admin.js": { + "naam": "admin.js", + "path": "c0mp0n3nt/admin/assets/js", + "rename": false, + "type": "file" + }, + "site.css": { + "naam": "site.css", + "path": "c0mp0n3nt/site/assets/css", + "rename": false, + "type": "file" + }, + "site.js": { + "naam": "site.js", + "path": "c0mp0n3nt/site/assets/js", + "rename": false, + "type": "file" + }, + "SITE_ROUTER.php": { + "naam": "SITE_ROUTER.php", + "path": "c0mp0n3nt/site/src/Service", + "rename": "new", + "newName": "Router.php", + "type": "file" + }, + "SITE_ROUTE_HELPER.php": { + "naam": "SITE_ROUTE_HELPER.php", + "path": "c0mp0n3nt/site/src/Helper", + "rename": "new", + "newName": "RouteHelper.php", + "type": "file" + }, + "ADMIN_HELPER_CLASS.php": { + "naam": "ADMIN_HELPER_CLASS.php", + "path": "c0mp0n3nt/admin/src/Helper", + "rename": "new", + "newName": "[[[Component]]]Helper.php", + "type": "file" + }, + "SITE_HELPER_CLASS.php": { + "naam": "SITE_HELPER_CLASS.php", + "path": "c0mp0n3nt/site/src/Helper", + "rename": "new", + "newName": "[[[Component]]]Helper.php", + "type": "file" + }, + "INSTALLER_SCRIPT.php": { + "naam": "INSTALLER_SCRIPT.php", + "path": "c0mp0n3nt/", + "rename": "new", + "newName": "[[[Component]]]InstallerScript.php", + "type": "file" + }, + "SITE_DISPATCHER.php": { + "naam": "SITE_DISPATCHER.php", + "path": "c0mp0n3nt/site/src/Dispatcher", + "rename": "new", + "newName": "Dispatcher.php", + "type": "file" + }, + "install.mysql.utf8.sql": { + "naam": "install.mysql.utf8.sql", + "path": "c0mp0n3nt/admin/sql", + "rename": false, + "type": "file" + }, + "uninstall.mysql.utf8.sql": { + "naam": "uninstall.mysql.utf8.sql", + "path": "c0mp0n3nt/admin/sql", + "rename": false, + "type": "file" + }, + "ADMIN_HEADERCHECK.php": { + "naam": "ADMIN_HEADERCHECK.php", + "path": "c0mp0n3nt/admin/src/Helper", + "rename": "new", + "newName": "HeaderCheck.php", + "type": "file" + }, + "LICENSE.txt": { + "naam": "LICENSE.txt", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "README.txt": { + "naam": "README.txt", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "README.md": { + "naam": "README.md", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "CHANGELOG.md": { + "naam": "CHANGELOG.md", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "SITE_HEADERCHECK.php": { + "naam": "SITE_HEADERCHECK.php", + "path": "c0mp0n3nt/site/src/Helper", + "rename": "new", + "newName": "HeaderCheck.php", + "type": "file" + }, + "import.gif": { + "naam": "import.gif", + "path": "c0mp0n3nt/admin/assets/images", + "rename": false, + "type": "file" + } + }, + "dynamic": { + "admin": { + "ADMIN_HELPER_EMAIL.php": { + "naam": "ADMIN_HELPER_EMAIL.php", + "path": "c0mp0n3nt/admin/src/Helper", + "rename": "new", + "newName": "[[[Component]]]Email.php", + "type": "emailer" + }, + "DASH_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Component]]]Controller.php", + "type": "dashboard" + }, + "DASH_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Component]]]Model.php", + "type": "dashboard" + }, + "DASH_VIEW_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Component]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "dashboard" + }, + "default_vdm.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[component]]]", + "rename": false, + "type": "dashboard" + }, + "default_main.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[component]]]", + "rename": false, + "type": "dashboard" + }, + "DASH_VIEW.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[component]]]", + "rename": "new", + "newName": "default.php", + "type": "dashboard" + }, + "dashboard.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": false, + "type": "dashboard" + }, + "filter_forms.xml": { + "path": "c0mp0n3nt/admin/forms", + "rename": "filter_forms", + "type": "filter" + }, + "module_forms.xml": { + "path": "c0mp0n3nt/admin/forms", + "rename": "module_forms", + "type": "single" + }, + "module_forms.js": { + "path": "c0mp0n3nt/media/js", + "rename": "module_forms", + "type": "single" + }, + "ADMIN_VIEW.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "ADMIN_VIEW_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "single" + }, + "ADMIN_VIEW_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "single" + }, + "ADMIN_VIEW_TABLE.php": { + "path": "c0mp0n3nt/admin/src/Table", + "rename": "new", + "newName": "[[[Name]]]Table.php", + "type": "single" + }, + "ADMIN_VIEW_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "single" + }, + "view.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "view", + "type": "single" + }, + "ADMIN_VIEWS_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "list" + }, + "ADMIN_VIEWS_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "list" + }, + "views.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "views", + "type": "list" + }, + "ADMIN_VIEWS_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "list" + }, + "ADMIN_VIEWS.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "ADMIN_VIEWS_EMPTYSTATE.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "emptystate.php", + "type": "list" + }, + "default_toolbar.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": false, + "type": "list" + }, + "default_head.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": false, + "type": "list" + }, + "default_body.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": false, + "type": "list" + }, + "default_foot.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": false, + "type": "list" + }, + "FORM_RULE.php": { + "path": "c0mp0n3nt/admin/src/Rule", + "rename": "new", + "newName": "[[[Key]]]Rule.php", + "type": "rule" + }, + "ADMIN_LAYOUT.php": { + "path": "c0mp0n3nt/admin/layouts", + "rename": "ADMIN_LAYOUT", + "type": "layout" + }, + "LAYOUT_OVERRIDE.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "LAYOUT_OVERRIDE", + "type": "layoutoverride" + }, + "layoutitems.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutitems", + "type": "layoutitems" + }, + "layoutfull.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutfull", + "type": "layoutfull" + }, + "layoutlinkedview.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutlinkedview", + "type": "layoutlinkedview" + }, + "layouttitle.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layouttitle", + "type": "layouttitle" + }, + "layoutpublished.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutpublished", + "type": "layoutpublished" + }, + "layoutmetadata.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutmetadata", + "type": "layoutmetadata" + }, + "FORM_CUSTOM_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldcustom" + }, + "FORM_LIST_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldlist" + }, + "FORM_RADIO_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldradio" + }, + "FORM_CHECKBOXES_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldcheckboxes" + }, + "FORM_USER_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fielduser" + }, + "ADMIN_AJAX_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "AjaxController.php", + "type": "ajax" + }, + "ADMIN_AJAX_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "AjaxModel.php", + "type": "ajax" + }, + "ADMIN_IMPORT_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "ImportController.php", + "type": "import" + }, + "ADMIN_IMPORT_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "ImportModel.php", + "type": "import" + }, + "ADMIN_IMPORT_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/Import", + "rename": "new", + "newName": "HtmlView.php", + "type": "import" + }, + "default_import.php": { + "path": "c0mp0n3nt/admin/tmpl/import", + "rename": "new", + "newName": "default.php", + "type": "import" + }, + "ADMIN_IMPORT_CONTROLLER_CUSTOM.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]importController.php", + "type": "customimport" + }, + "ADMIN_IMPORT_MODEL_CUSTOM.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]importModel.php", + "type": "customimport" + }, + "ADMIN_IMPORT_HTML_CUSTOM.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]import", + "rename": "new", + "newName": "HtmlView.php", + "type": "customimport" + }, + "default_import_custom.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]import", + "rename": "new", + "newName": "default.php", + "type": "customimport" + }, + "ADMIN_HELPER_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "HelpController.php", + "type": "help" + }, + "1.0.0.sql": { + "path": "c0mp0n3nt/admin/sql/updates/mysql", + "rename": "1.0.0", + "type": "sql_update" + }, + "update_server.xml": { + "path": "c0mp0n3nt/", + "rename": "update_server", + "type": "update_server" + }, + "viewFile.js": { + "path": "c0mp0n3nt/admin/assets/js", + "rename": "viewFile", + "type": "javascript_file" + } + }, + "site": { + "SITE_VIEWS_HTML.php": { + "path": "c0mp0n3nt/site/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "list" + }, + "SITE_VIEWS_MODEL.php": { + "path": "c0mp0n3nt/site/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "list" + }, + "views_site.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "views_site", + "type": "list" + }, + "SITE_VIEWS.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "SITE_VIEW_HTML.php": { + "path": "c0mp0n3nt/site/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "single" + }, + "view_site.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "view_site", + "type": "single" + }, + "SITE_VIEW_MODEL.php": { + "path": "c0mp0n3nt/site/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "single" + }, + "SITE_VIEW.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "default_site_template.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "site_template", + "type": "template" + }, + "SITE_LAYOUT.php": { + "path": "c0mp0n3nt/site/layouts", + "rename": "SITE_LAYOUT", + "type": "layout" + }, + "LAYOUT_OVERRIDE.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "LAYOUT_OVERRIDE", + "type": "layoutoverride" + }, + "layoutitems.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutitems", + "type": "layoutitems" + }, + "layoutfull.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutfull", + "type": "layoutfull" + }, + "layoutlinkedview.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutlinkedview", + "type": "layoutlinkedview" + }, + "layouttitle.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layouttitle", + "type": "layouttitle" + }, + "layoutpublished.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutpublished", + "type": "layoutpublished" + }, + "layoutmetadata.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutmetadata", + "type": "layoutmetadata" + }, + "default.xml": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": false, + "type": "menu" + }, + "edit.xml": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": false, + "type": "admin_menu" + }, + "module_forms.xml": { + "path": "c0mp0n3nt/site/forms", + "rename": "module_forms", + "type": "edit" + }, + "module_forms.js": { + "path": "c0mp0n3nt/site/forms", + "rename": "module_forms", + "type": "edit" + }, + "SITE_ADMIN_VIEW.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "new", + "newName": "edit.php", + "type": "edit" + }, + "SITE_ADMIN_VIEW_MODEL.php": { + "path": "c0mp0n3nt/site/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "edit" + }, + "SITE_ADMIN_VIEW_CONTROLLER.php": { + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "edit" + }, + "SITE_ADMIN_VIEW_HTML.php": { + "path": "c0mp0n3nt/site/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "edit" + }, + "view_site_edit.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "view_site_edit", + "type": "edit" + }, + "SITE_FORM_CUSTOM_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldcustom" + }, + "SITE_FORM_LIST_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldlist" + }, + "SITE_FORM_RADIO_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldradio" + }, + "SITE_FORM_CHECKBOXES_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldcheckboxes" + }, + "SITE_FORM_USER_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fielduser" + }, + "SITE_AJAX_CONTROLLER.php": { + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "AjaxController.php", + "type": "ajax" + }, + "SITE_AJAX_MODEL.php": { + "path": "c0mp0n3nt/site/src/Model", + "rename": "new", + "newName": "AjaxModel.php", + "type": "ajax" + }, + "SITE_HELPER_CONTROLLER.php": { + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "HelpController.php", + "type": "help" + }, + "SITE_VIEW_CONTROLLER.php": { + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "custom_form" + }, + "viewFileSite.js": { + "path": "c0mp0n3nt/site/assets/js", + "rename": "viewFileSite", + "type": "javascript_file" + } + }, + "custom_admin": { + "CUSTOM_ADMIN_VIEWS_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "list" + }, + "CUSTOM_ADMIN_VIEWS_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "list" + }, + "CUSTOM_ADMIN_VIEWS.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "CUSTOM_ADMIN_VIEWS_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "list" + }, + "views_custom_admin.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "views_custom_admin", + "type": "list" + }, + "view_custom_admin.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "view_custom_admin", + "type": "single" + }, + "CUSTOM_ADMIN_VIEW_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "single" + }, + "CUSTOM_ADMIN_VIEW_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "single" + }, + "CUSTOM_ADMIN_VIEW.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "CUSTOM_ADMIN_VIEW_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "single" + }, + "default_custom_admin_template.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "custom_admin_template", + "type": "template" + }, + "CUSTOM_ADMIN_LAYOUT.php": { + "path": "c0mp0n3nt/admin/layouts", + "rename": "CUSTOM_ADMIN_LAYOUT", + "type": "layout" + }, + "viewFileCustomAdmin.js": { + "path": "c0mp0n3nt/admin/assets/js", + "rename": "viewFileCustomAdmin", + "type": "javascript_file" + } + } + } + } +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/site.css b/admin/compiler/joomla_4/site.css new file mode 100644 index 000000000..b26522089 --- /dev/null +++ b/admin/compiler/joomla_4/site.css @@ -0,0 +1,7 @@ +###BOM### + +/* CSS Document */ +.no-click { + pointer-events: none; +} +###SITECSS### diff --git a/admin/compiler/joomla_4/site.js b/admin/compiler/joomla_4/site.js new file mode 100644 index 000000000..813632b9a --- /dev/null +++ b/admin/compiler/joomla_4/site.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###SITEJS### \ No newline at end of file diff --git a/admin/compiler/joomla_4/submitbutton.js b/admin/compiler/joomla_4/submitbutton.js new file mode 100644 index 000000000..cd10493cd --- /dev/null +++ b/admin/compiler/joomla_4/submitbutton.js @@ -0,0 +1,17 @@ +###BOM### + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var action = task.split('.'); + if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ + Joomla.submitform(task, document.getElementById("adminForm")); + return true; + } else { + alert(Joomla.JText._('###view###, some values are not acceptable.','Some values are unacceptable')); + return false; + } + } +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/submitbutton_site.js b/admin/compiler/joomla_4/submitbutton_site.js new file mode 100644 index 000000000..40938b445 --- /dev/null +++ b/admin/compiler/joomla_4/submitbutton_site.js @@ -0,0 +1,17 @@ +###BOM### + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var action = task.split('.'); + if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ + Joomla.submitform(task, document.getElementById("adminForm")); + return true; + } else { + alert(Joomla.JText._('###sview###, some values are not acceptable.','Some values are unacceptable')); + return false; + } + } +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/uninstall.mysql.utf8.sql b/admin/compiler/joomla_4/uninstall.mysql.utf8.sql new file mode 100644 index 000000000..b8b61a080 --- /dev/null +++ b/admin/compiler/joomla_4/uninstall.mysql.utf8.sql @@ -0,0 +1 @@ +###UNINSTALL### diff --git a/admin/compiler/joomla_4/update_server.xml b/admin/compiler/joomla_4/update_server.xml new file mode 100644 index 000000000..8120c1923 --- /dev/null +++ b/admin/compiler/joomla_4/update_server.xml @@ -0,0 +1 @@ +###UPDATE_SERVER_XML### \ No newline at end of file diff --git a/admin/compiler/joomla_4/view.css b/admin/compiler/joomla_4/view.css new file mode 100644 index 000000000..4144e5a3c --- /dev/null +++ b/admin/compiler/joomla_4/view.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###VIEWCSS### diff --git a/admin/compiler/joomla_4/viewFile.js b/admin/compiler/joomla_4/viewFile.js new file mode 100644 index 000000000..d855708a8 --- /dev/null +++ b/admin/compiler/joomla_4/viewFile.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###ADMIN_JAVASCRIPT_FILE### \ No newline at end of file diff --git a/admin/compiler/joomla_4/viewFileCustomAdmin.js b/admin/compiler/joomla_4/viewFileCustomAdmin.js new file mode 100644 index 000000000..8abce3885 --- /dev/null +++ b/admin/compiler/joomla_4/viewFileCustomAdmin.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###CUSTOM_ADMIN_JAVASCRIPT_FILE### \ No newline at end of file diff --git a/admin/compiler/joomla_4/viewFileSite.js b/admin/compiler/joomla_4/viewFileSite.js new file mode 100644 index 000000000..12ed97db2 --- /dev/null +++ b/admin/compiler/joomla_4/viewFileSite.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###SITE_JAVASCRIPT_FILE### \ No newline at end of file diff --git a/admin/compiler/joomla_4/view_custom_admin.css b/admin/compiler/joomla_4/view_custom_admin.css new file mode 100644 index 000000000..291066442 --- /dev/null +++ b/admin/compiler/joomla_4/view_custom_admin.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###CUSTOM_ADMIN_VIEWCSS### diff --git a/admin/compiler/joomla_4/view_site.css b/admin/compiler/joomla_4/view_site.css new file mode 100644 index 000000000..17a8824ae --- /dev/null +++ b/admin/compiler/joomla_4/view_site.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###SITE_VIEWCSS### diff --git a/admin/compiler/joomla_4/view_site_edit.css b/admin/compiler/joomla_4/view_site_edit.css new file mode 100644 index 000000000..17a8824ae --- /dev/null +++ b/admin/compiler/joomla_4/view_site_edit.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###SITE_VIEWCSS### diff --git a/admin/compiler/joomla_4/views.css b/admin/compiler/joomla_4/views.css new file mode 100644 index 000000000..d79fcb92b --- /dev/null +++ b/admin/compiler/joomla_4/views.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###VIEWSCSS### diff --git a/admin/compiler/joomla_4/views_custom_admin.css b/admin/compiler/joomla_4/views_custom_admin.css new file mode 100644 index 000000000..291066442 --- /dev/null +++ b/admin/compiler/joomla_4/views_custom_admin.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###CUSTOM_ADMIN_VIEWCSS### diff --git a/admin/compiler/joomla_4/views_site.css b/admin/compiler/joomla_4/views_site.css new file mode 100644 index 000000000..17a8824ae --- /dev/null +++ b/admin/compiler/joomla_4/views_site.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###SITE_VIEWCSS### diff --git a/admin/compiler/joomla_4/whmcs.php b/admin/compiler/joomla_4/whmcs.php new file mode 100644 index 000000000..ac7524f0e --- /dev/null +++ b/admin/compiler/joomla_4/whmcs.php @@ -0,0 +1,20 @@ + + * @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 JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// NO MORE... \ No newline at end of file diff --git a/admin/componentbuilder.php b/admin/componentbuilder.php index 53857eff6..631e970f8 100644 --- a/admin/componentbuilder.php +++ b/admin/componentbuilder.php @@ -19,8 +19,8 @@ if (file_exists($composer_autoloader)) require_once $composer_autoloader; } -// register this component namespace -spl_autoload_register(function ($class) { +// register additional namespace +\spl_autoload_register(function ($class) { // project-specific base directories and namespace prefix $search = [ 'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai', @@ -67,18 +67,21 @@ spl_autoload_register(function ($class) { } }); - +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Access\Exception\NotAllowed; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\MVC\Controller\BaseController; // Access check. -if (!JFactory::getUser()->authorise('core.manage', 'com_componentbuilder')) +if (!Factory::getUser()->authorise('core.manage', 'com_componentbuilder')) { - throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); -}; + throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); +} // Add CSS file for all pages -$document = JFactory::getDocument(); -$document->addStyleSheet('components/com_componentbuilder/assets/css/admin.css'); -$document->addScript('components/com_componentbuilder/assets/js/admin.js'); +Html::_('stylesheet', 'components/com_componentbuilder/assets/css/admin.css', ['version' => 'auto']); +Html::_('script', 'components/com_componentbuilder/assets/js/admin.js', ['version' => 'auto']); // require helper files JLoader::register('ComponentbuilderHelper', __DIR__ . '/helpers/componentbuilder.php'); @@ -86,13 +89,13 @@ JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/hel JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php'); // Trigger the Global Admin Event -ComponentbuilderHelper::globalEvent($document); +ComponentbuilderHelper::globalEvent(Factory::getDocument()); // Get an instance of the controller prefixed by Componentbuilder -$controller = JControllerLegacy::getInstance('Componentbuilder'); +$controller = BaseController::getInstance('Componentbuilder'); // Perform the Request task -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->execute(Factory::getApplication()->input->get('task')); // Redirect if set by the controller $controller->redirect(); diff --git a/admin/config.xml b/admin/config.xml index 75fbfed59..2b99376c9 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -970,6 +970,24 @@ /> + + + + COM_COMPONENTBUILDER_CONFIG_NO - - + + @@ -1012,8 +1030,8 @@ max="100" step="10" /> - - + + input->getCmd('view', 'componentbuilder'); - $data = $this->getViewRelation($view); - $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); + $view = $this->input->getCmd('view', 'componentbuilder'); + $data = $this->getViewRelation($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); // Check for edit form. - if(ComponentbuilderHelper::checkArray($data)) + if(UtilitiesArrayHelper::check($data)) { if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$data['view'], $id)) { // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); // set redirect - if ($refid > 0 && ComponentbuilderHelper::checkString($ref)) + if ($refid > 0 && StringHelper::check($ref)) { // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); } - elseif (ComponentbuilderHelper::checkString($ref)) + elseif (StringHelper::check($ref)) { // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); } else { // normal redirect back to the list view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.$data['views'], false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.$data['views'], false)); } return false; @@ -89,7 +93,7 @@ class ComponentbuilderController extends BaseController protected function getViewRelation($view) { // check the we have a value - if (ComponentbuilderHelper::checkString($view)) + if (StringHelper::check($view)) { // the view relationships $views = array( @@ -126,6 +130,7 @@ class ComponentbuilderController extends BaseController 'component_updates' => 'components_updates', 'component_mysql_tweaks' => 'components_mysql_tweaks', 'component_custom_admin_menus' => 'components_custom_admin_menus', + 'component_router' => 'components_routers', 'component_config' => 'components_config', 'component_dashboard' => 'components_dashboard', 'component_files_folders' => 'components_files_folders', diff --git a/admin/controllers/admin_custom_tabs.php b/admin/controllers/admin_custom_tabs.php index 51f8b1d9e..7f6e4bfce 100644 --- a/admin/controllers/admin_custom_tabs.php +++ b/admin/controllers/admin_custom_tabs.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Admin_custom_tabs Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admins_custom_tabs'; // safeguard for setting the return view listing to the main view. parent::__construct($config); } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -51,10 +57,10 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_custom_tabs.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_custom_tabs', '', array()); + $model = $this->getModel('Admin_custom_tabs', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_custom_tabs' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admins_custom_tabs' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/admin_fields.php b/admin/controllers/admin_fields.php index 89e3cb48b..98309de8b 100644 --- a/admin/controllers/admin_fields.php +++ b/admin/controllers/admin_fields.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Admin_fields Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerAdmin_fields extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admins_fields'; // safeguard for setting the return view listing to the main view. parent::__construct($config); } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -51,10 +57,10 @@ class ComponentbuilderControllerAdmin_fields extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_fields.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerAdmin_fields extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerAdmin_fields extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerAdmin_fields extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_fields', '', array()); + $model = $this->getModel('Admin_fields', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admins_fields' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerAdmin_fields extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerAdmin_fields extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerAdmin_fields extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/admin_fields_conditions.php b/admin/controllers/admin_fields_conditions.php index f5034ec93..361a81a0e 100644 --- a/admin/controllers/admin_fields_conditions.php +++ b/admin/controllers/admin_fields_conditions.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Admin_fields_conditions Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admins_fields_conditions'; // safeguard for setting the return view listing to the main view. parent::__construct($config); } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -51,10 +57,10 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_fields_conditions', '', array()); + $model = $this->getModel('Admin_fields_conditions', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_conditions' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admins_fields_conditions' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/admin_fields_relations.php b/admin/controllers/admin_fields_relations.php index dbc285ddd..b775c6e7e 100644 --- a/admin/controllers/admin_fields_relations.php +++ b/admin/controllers/admin_fields_relations.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Admin_fields_relations Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admins_fields_relations'; // safeguard for setting the return view listing to the main view. parent::__construct($config); } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -51,10 +57,10 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_fields_relations.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_fields_relations', '', array()); + $model = $this->getModel('Admin_fields_relations', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_relations' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admins_fields_relations' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/admin_view.php b/admin/controllers/admin_view.php index daa98d2be..1359388c3 100644 --- a/admin/controllers/admin_view.php +++ b/admin/controllers/admin_view.php @@ -12,8 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use VDM\Joomla\Utilities\GetHelper; /** * Admin_view Form Controller @@ -36,13 +43,13 @@ class ComponentbuilderControllerAdmin_view extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admin_views'; // safeguard for setting the return view listing to the main view. parent::__construct($config); } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -51,10 +58,10 @@ class ComponentbuilderControllerAdmin_view extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_view.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +83,10 @@ class ComponentbuilderControllerAdmin_view extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +157,12 @@ class ComponentbuilderControllerAdmin_view extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +179,13 @@ class ComponentbuilderControllerAdmin_view extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_view', '', array()); + $model = $this->getModel('Admin_view', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admin_views' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admin_views' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +210,13 @@ class ComponentbuilderControllerAdmin_view extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +227,7 @@ class ComponentbuilderControllerAdmin_view extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +238,7 @@ class ComponentbuilderControllerAdmin_view extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +264,7 @@ class ComponentbuilderControllerAdmin_view extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +282,29 @@ class ComponentbuilderControllerAdmin_view extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,14 +316,14 @@ class ComponentbuilderControllerAdmin_view extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // get the state object (Joomla\CMS\Object\CMSObject) $state = $model->get('state'); @@ -337,7 +344,7 @@ class ComponentbuilderControllerAdmin_view extends FormController foreach($_tablesArray as $_updateTable) { // get the linked ID - if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, 'admin_view', 'id')) + if ($_value = GetHelper::var($_updateTable, $oldID, 'admin_view', 'id')) { // copy fields to new admin view ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array('admin_view' => $newID)); @@ -347,5 +354,4 @@ class ComponentbuilderControllerAdmin_view extends FormController return; } - } diff --git a/admin/controllers/admin_views.php b/admin/controllers/admin_views.php index 4bd01f895..2fba8828a 100644 --- a/admin/controllers/admin_views.php +++ b/admin/controllers/admin_views.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\StringHelper; /** @@ -48,13 +54,13 @@ class ComponentbuilderControllerAdmin_views extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('admin_view.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -62,16 +68,16 @@ class ComponentbuilderControllerAdmin_views extends AdminController $model = $this->getModel('Admin_views'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Admin_views_'.$date->format('jS_F_Y'),'Admin views exported ('.$date->format('jS F, Y').')','admin views'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error'); return; } @@ -79,32 +85,32 @@ class ComponentbuilderControllerAdmin_views extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('admin_view.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Admin_views'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('admin_view_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'admin_views'); $session->set('dataType_VDM_IMPORTINTO', 'admin_view'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_ADMIN_VIEWS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_ADMIN_VIEWS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error'); return; } @@ -117,18 +123,18 @@ class ComponentbuilderControllerAdmin_views extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=admin_views', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('admin_views.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned @@ -139,7 +145,7 @@ class ComponentbuilderControllerAdmin_views extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } diff --git a/admin/controllers/admins_custom_tabs.php b/admin/controllers/admins_custom_tabs.php index 790c6e069..61e43cc65 100644 --- a/admin/controllers/admins_custom_tabs.php +++ b/admin/controllers/admins_custom_tabs.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Admins_custom_tabs Admin Controller diff --git a/admin/controllers/admins_fields.php b/admin/controllers/admins_fields.php index cf77f2fba..d8c328777 100644 --- a/admin/controllers/admins_fields.php +++ b/admin/controllers/admins_fields.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Admins_fields Admin Controller diff --git a/admin/controllers/admins_fields_conditions.php b/admin/controllers/admins_fields_conditions.php index 9a54b55a1..a832d2864 100644 --- a/admin/controllers/admins_fields_conditions.php +++ b/admin/controllers/admins_fields_conditions.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Admins_fields_conditions Admin Controller diff --git a/admin/controllers/admins_fields_relations.php b/admin/controllers/admins_fields_relations.php index 2a3804873..c14541e43 100644 --- a/admin/controllers/admins_fields_relations.php +++ b/admin/controllers/admins_fields_relations.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Admins_fields_relations Admin Controller diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index e27dd76da..2ae49345c 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -12,7 +12,9 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -24,9 +26,9 @@ class ComponentbuilderControllerAjax extends BaseController { parent::__construct($config); // make sure all json stuff are set - JFactory::getDocument()->setMimeEncoding( 'application/json' ); + Factory::getDocument()->setMimeEncoding( 'application/json' ); // get the application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); $app->setHeader('Access-Control-Allow-Origin', '*'); // load the tasks @@ -80,16 +82,16 @@ class ComponentbuilderControllerAjax extends BaseController public function ajax() { // get the user for later use - $user = JFactory::getUser(); + $user = Factory::getUser(); // get the input values - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; // check if we should return raw - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); // return to a callback function - $callback = $jinput->get('callback', null, 'CMD'); + $callback = $jinput->get('callback', null, 'CMD'); // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { // get the task @@ -102,7 +104,15 @@ class ComponentbuilderControllerAjax extends BaseController $noticeValue = $jinput->get('notice', NULL, 'STRING'); if($noticeValue && $user->id != 0) { - $result = $this->getModel('ajax')->isNew($noticeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->isNew($noticeValue); + } + else + { + $result = false; + } } else { @@ -121,7 +131,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -143,7 +153,15 @@ class ComponentbuilderControllerAjax extends BaseController $noticeValue = $jinput->get('notice', NULL, 'STRING'); if($noticeValue && $user->id != 0) { - $result = $this->getModel('ajax')->isRead($noticeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->isRead($noticeValue); + } + else + { + $result = false; + } } else { @@ -162,7 +180,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -184,7 +202,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getComponentDetails($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getComponentDetails($idValue); + } + else + { + $result = false; + } } else { @@ -203,7 +229,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -225,7 +251,15 @@ class ComponentbuilderControllerAjax extends BaseController $getTypeValue = $jinput->get('getType', NULL, 'WORD'); if($getTypeValue && $user->id != 0) { - $result = $this->getModel('ajax')->getCronPath($getTypeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getCronPath($getTypeValue); + } + else + { + $result = false; + } } else { @@ -244,7 +278,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -266,7 +300,15 @@ class ComponentbuilderControllerAjax extends BaseController $nameValue = $jinput->get('name', NULL, 'WORD'); if($nameValue && $user->id != 0) { - $result = $this->getModel('ajax')->getWiki($nameValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getWiki($nameValue); + } + else + { + $result = false; + } } else { @@ -285,7 +327,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -307,7 +349,15 @@ class ComponentbuilderControllerAjax extends BaseController $versionValue = $jinput->get('version', NULL, 'INT'); if($versionValue && $user->id != 0) { - $result = $this->getModel('ajax')->getVersion($versionValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getVersion($versionValue); + } + else + { + $result = false; + } } else { @@ -326,7 +376,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -348,7 +398,15 @@ class ComponentbuilderControllerAjax extends BaseController $packageValue = $jinput->get('package', NULL, 'BASE64'); if($packageValue && $user->id != 0) { - $result = $this->getModel('ajax')->getJCBpackageInfo($packageValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getJCBpackageInfo($packageValue); + } + else + { + $result = false; + } } else { @@ -367,7 +425,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -390,7 +448,15 @@ class ComponentbuilderControllerAjax extends BaseController $keyValue = $jinput->get('key', NULL, 'ALNUM'); if($identifierValue && $user->id != 0 && $keyValue) { - $result = $this->getModel('ajax')->getCrowdinDetails($identifierValue, $keyValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getCrowdinDetails($identifierValue, $keyValue); + } + else + { + $result = false; + } } else { @@ -409,7 +475,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -431,7 +497,15 @@ class ComponentbuilderControllerAjax extends BaseController $dataValue = $jinput->get('data', NULL, 'STRING'); if($dataValue && $user->id != 0) { - $result = $this->getModel('ajax')->getModuleCode($dataValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getModuleCode($dataValue); + } + else + { + $result = false; + } } else { @@ -450,7 +524,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -473,7 +547,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'WORD'); if($idValue && $user->id != 0 && $typeValue) { - $result = $this->getModel('ajax')->getClassCode($idValue, $typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getClassCode($idValue, $typeValue); + } + else + { + $result = false; + } } else { @@ -492,7 +574,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -516,7 +598,15 @@ class ComponentbuilderControllerAjax extends BaseController $keyValue = $jinput->get('key', 1, 'INT'); if($idValue && $user->id != 0 && $typeValue) { - $result = $this->getModel('ajax')->getClassCodeIds($idValue, $typeValue, $keyValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getClassCodeIds($idValue, $typeValue, $keyValue); + } + else + { + $result = false; + } } else { @@ -535,7 +625,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -558,7 +648,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'WORD'); if($idValue && $user->id != 0 && $typeValue) { - $result = $this->getModel('ajax')->getClassHeaderCode($idValue, $typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getClassHeaderCode($idValue, $typeValue); + } + else + { + $result = false; + } } else { @@ -577,7 +675,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -599,7 +697,15 @@ class ComponentbuilderControllerAjax extends BaseController $tableValue = $jinput->get('table', NULL, 'WORD'); if($tableValue && $user->id != 0) { - $result = $this->getModel('ajax')->getTableColumns($tableValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getTableColumns($tableValue); + } + else + { + $result = false; + } } else { @@ -618,7 +724,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -640,7 +746,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getFieldSelectOptions($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getFieldSelectOptions($idValue); + } + else + { + $result = false; + } } else { @@ -659,7 +773,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -681,7 +795,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'WORD'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->getDynamicScripts($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getDynamicScripts($typeValue); + } + else + { + $result = false; + } } else { @@ -700,7 +822,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -723,7 +845,15 @@ class ComponentbuilderControllerAjax extends BaseController $sizeValue = $jinput->get('size', NULL, 'INT'); if($typeValue && $user->id != 0 && $sizeValue) { - $result = $this->getModel('ajax')->getButton($typeValue, $sizeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getButton($typeValue, $sizeValue); + } + else + { + $result = false; + } } else { @@ -742,7 +872,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -765,7 +895,15 @@ class ComponentbuilderControllerAjax extends BaseController $sizeValue = $jinput->get('size', NULL, 'INT'); if($typeValue && $user->id != 0 && $sizeValue) { - $result = $this->getModel('ajax')->getButtonID($typeValue, $sizeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getButtonID($typeValue, $sizeValue); + } + else + { + $result = false; + } } else { @@ -784,7 +922,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -806,7 +944,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'WORD'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->getAjaxDisplay($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getAjaxDisplay($typeValue); + } + else + { + $result = false; + } } else { @@ -825,7 +971,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -847,7 +993,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'ALNUM'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->getLinked($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getLinked($typeValue); + } + else + { + $result = false; + } } else { @@ -866,7 +1020,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -888,7 +1042,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'ALNUM'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->checkAliasField($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkAliasField($typeValue); + } + else + { + $result = false; + } } else { @@ -907,7 +1069,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -929,7 +1091,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'ALNUM'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->checkCategoryField($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkCategoryField($typeValue); + } + else + { + $result = false; + } } else { @@ -948,7 +1118,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -970,7 +1140,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', null, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getTemplateDetails($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getTemplateDetails($idValue); + } + else + { + $result = false; + } } else { @@ -989,7 +1167,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1011,7 +1189,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getLayoutDetails($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getLayoutDetails($idValue); + } + else + { + $result = false; + } } else { @@ -1030,7 +1216,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1054,7 +1240,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'INT'); if($nameValue && $user->id != 0 && $asValue && $typeValue) { - $result = $this->getModel('ajax')->getDbTableColumns($nameValue, $asValue, $typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getDbTableColumns($nameValue, $asValue, $typeValue); + } + else + { + $result = false; + } } else { @@ -1073,7 +1267,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1097,7 +1291,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'INT'); if($idValue && $user->id != 0 && $asValue && $typeValue) { - $result = $this->getModel('ajax')->getViewTableColumns($idValue, $asValue, $typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getViewTableColumns($idValue, $asValue, $typeValue); + } + else + { + $result = false; + } } else { @@ -1116,7 +1318,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1139,7 +1341,15 @@ class ComponentbuilderControllerAjax extends BaseController $viewValue = $jinput->get('view', NULL, 'WORD'); if($idValue && $user->id != 0 && $viewValue) { - $result = $this->getModel('ajax')->getDynamicValues($idValue, $viewValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getDynamicValues($idValue, $viewValue); + } + else + { + $result = false; + } } else { @@ -1158,7 +1368,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1181,7 +1391,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($functioNameValue && $user->id != 0 && $idValue) { - $result = $this->getModel('ajax')->checkFunctionName($functioNameValue, $idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkFunctionName($functioNameValue, $idValue); + } + else + { + $result = false; + } } else { @@ -1200,7 +1418,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1224,7 +1442,15 @@ class ComponentbuilderControllerAjax extends BaseController $targetValue = $jinput->get('target', NULL, 'WORD'); if($functioNameValue && $user->id != 0 && $idValue && $targetValue) { - $result = $this->getModel('ajax')->usedin($functioNameValue, $idValue, $targetValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->usedin($functioNameValue, $idValue, $targetValue); + } + else + { + $result = false; + } } else { @@ -1243,7 +1469,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1265,7 +1491,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getEditCustomCodeButtons($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getEditCustomCodeButtons($idValue); + } + else + { + $result = false; + } } else { @@ -1284,7 +1518,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1308,7 +1542,15 @@ class ComponentbuilderControllerAjax extends BaseController $targetValue = $jinput->get('target', NULL, 'WORD'); if($placeholderValue && $user->id != 0 && $idValue && $targetValue) { - $result = $this->getModel('ajax')->placedin($placeholderValue, $idValue, $targetValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->placedin($placeholderValue, $idValue, $targetValue); + } + else + { + $result = false; + } } else { @@ -1327,7 +1569,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1350,7 +1592,15 @@ class ComponentbuilderControllerAjax extends BaseController $placeholderNameValue = $jinput->get('placeholderName', NULL, 'STRING'); if($idValue && $user->id != 0 && $placeholderNameValue) { - $result = $this->getModel('ajax')->checkPlaceholderName($idValue, $placeholderNameValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkPlaceholderName($idValue, $placeholderNameValue); + } + else + { + $result = false; + } } else { @@ -1369,7 +1619,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1391,7 +1641,15 @@ class ComponentbuilderControllerAjax extends BaseController $nameValue = $jinput->get('name', NULL, 'WORD'); if($nameValue && $user->id != 0) { - $result = $this->getModel('ajax')->getExistingValidationRuleCode($nameValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getExistingValidationRuleCode($nameValue); + } + else + { + $result = false; + } } else { @@ -1410,7 +1668,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1432,7 +1690,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getValidationRulesTable($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getValidationRulesTable($idValue); + } + else + { + $result = false; + } } else { @@ -1451,7 +1717,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1474,7 +1740,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($nameValue && $user->id != 0 && $idValue) { - $result = $this->getModel('ajax')->checkRuleName($nameValue, $idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkRuleName($nameValue, $idValue); + } + else + { + $result = false; + } } else { @@ -1493,7 +1767,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1515,7 +1789,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue) { - $result = $this->getModel('ajax')->getFieldTypeProperties($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getFieldTypeProperties($idValue); + } + else + { + $result = false; + } } else { @@ -1534,7 +1816,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1557,7 +1839,15 @@ class ComponentbuilderControllerAjax extends BaseController $fieldtypeValue = $jinput->get('fieldtype', NULL, 'ALNUM'); if($propertyValue && $user->id != 0 && $fieldtypeValue) { - $result = $this->getModel('ajax')->getFieldPropertyDesc($propertyValue, $fieldtypeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getFieldPropertyDesc($propertyValue, $fieldtypeValue); + } + else + { + $result = false; + } } else { @@ -1576,7 +1866,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1601,7 +1891,15 @@ class ComponentbuilderControllerAjax extends BaseController $areaValue = $jinput->get('area', NULL, 'INT'); if($listfieldValue && $user->id != 0 && $joinfieldsValue && $typeValue && $areaValue) { - $result = $this->getModel('ajax')->getCodeGlueOptions($listfieldValue, $joinfieldsValue, $typeValue, $areaValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getCodeGlueOptions($listfieldValue, $joinfieldsValue, $typeValue, $areaValue); + } + else + { + $result = false; + } } else { @@ -1620,7 +1918,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1648,7 +1946,15 @@ class ComponentbuilderControllerAjax extends BaseController $component_idValue = $jinput->get('component_id', 0, 'INT'); if($table_nameValue && $user->id != 0 && $type_searchValue && $search_valueValue) { - $result = $this->getModel('ajax')->doSearch($table_nameValue, $type_searchValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->doSearch($table_nameValue, $type_searchValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + } + else + { + $result = false; + } } else { @@ -1667,7 +1973,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1695,7 +2001,15 @@ class ComponentbuilderControllerAjax extends BaseController $component_idValue = $jinput->get('component_id', 0, 'INT'); if($table_nameValue && $user->id != 0 && $search_valueValue) { - $result = $this->getModel('ajax')->replaceAll($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->replaceAll($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + } + else + { + $result = false; + } } else { @@ -1714,7 +2028,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1743,7 +2057,15 @@ class ComponentbuilderControllerAjax extends BaseController $regex_searchValue = $jinput->get('regex_search', 0, 'INT'); if($field_nameValue && $user->id != 0 && $row_idValue && $table_nameValue && $search_valueValue) { - $result = $this->getModel('ajax')->getSearchValue($field_nameValue, $row_idValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getSearchValue($field_nameValue, $row_idValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue); + } + else + { + $result = false; + } } else { @@ -1762,7 +2084,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1792,7 +2114,15 @@ class ComponentbuilderControllerAjax extends BaseController $regex_searchValue = $jinput->get('regex_search', 0, 'INT'); if($field_nameValue && $user->id != 0 && $row_idValue && $table_nameValue && $search_valueValue) { - $result = $this->getModel('ajax')->getReplaceValue($field_nameValue, $row_idValue, $line_nrValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getReplaceValue($field_nameValue, $row_idValue, $line_nrValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue); + } + else + { + $result = false; + } } else { @@ -1811,7 +2141,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1836,7 +2166,15 @@ class ComponentbuilderControllerAjax extends BaseController $table_nameValue = $jinput->get('table_name', NULL, 'WORD'); if($valueValue && $user->id != 0 && $row_idValue && $field_nameValue && $table_nameValue) { - $result = $this->getModel('ajax')->setValue($valueValue, $row_idValue, $field_nameValue, $table_nameValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->setValue($valueValue, $row_idValue, $field_nameValue, $table_nameValue); + } + else + { + $result = false; + } } else { @@ -1855,7 +2193,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1877,7 +2215,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getSnippetDetails($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getSnippetDetails($idValue); + } + else + { + $result = false; + } } else { @@ -1896,7 +2242,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1919,7 +2265,15 @@ class ComponentbuilderControllerAjax extends BaseController $statusValue = $jinput->get('status', NULL, 'WORD'); if($pathValue && $user->id != 0 && $statusValue) { - $result = $this->getModel('ajax')->setSnippetGithub($pathValue, $statusValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->setSnippetGithub($pathValue, $statusValue); + } + else + { + $result = false; + } } else { @@ -1938,7 +2292,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1960,7 +2314,15 @@ class ComponentbuilderControllerAjax extends BaseController $librariesValue = $jinput->get('libraries', NULL, 'STRING'); if($librariesValue && $user->id != 0) { - $result = $this->getModel('ajax')->getSnippets($librariesValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getSnippets($librariesValue); + } + else + { + $result = false; + } } else { @@ -1979,7 +2341,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { diff --git a/admin/controllers/class_extendings.php b/admin/controllers/class_extendings.php index db9896b75..d5487f11f 100644 --- a/admin/controllers/class_extendings.php +++ b/admin/controllers/class_extendings.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Class_extendings Admin Controller diff --git a/admin/controllers/class_extends.php b/admin/controllers/class_extends.php index 5926cf210..7308076f2 100644 --- a/admin/controllers/class_extends.php +++ b/admin/controllers/class_extends.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Class_extends Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerClass_extends extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Class_extendings'; // safeguard for setting the return view listing to the main view. parent::__construct($config); } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -51,10 +57,10 @@ class ComponentbuilderControllerClass_extends extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('class_extends.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerClass_extends extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerClass_extends extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerClass_extends extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Class_extends', '', array()); + $model = $this->getModel('Class_extends', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_extendings' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_extendings' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerClass_extends extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerClass_extends extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerClass_extends extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerClass_extends extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerClass_extends extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerClass_extends extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/class_method.php b/admin/controllers/class_method.php index 1f492caaa..467e1839e 100644 --- a/admin/controllers/class_method.php +++ b/admin/controllers/class_method.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Class_method Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerClass_method extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Class_methods'; // safeguard for setting the return view listing to the main view. parent::__construct($config); } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -51,10 +57,10 @@ class ComponentbuilderControllerClass_method extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('class_method.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerClass_method extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerClass_method extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerClass_method extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Class_method', '', array()); + $model = $this->getModel('Class_method', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_methods' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerClass_method extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerClass_method extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerClass_method extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerClass_method extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerClass_method extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerClass_method extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/class_methods.php b/admin/controllers/class_methods.php index eb8a7660b..274d4cf16 100644 --- a/admin/controllers/class_methods.php +++ b/admin/controllers/class_methods.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Class_methods Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerClass_methods extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('class_method.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerClass_methods extends AdminController $model = $this->getModel('Class_methods'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Class_methods_'.$date->format('jS_F_Y'),'Class methods exported ('.$date->format('jS F, Y').')','class methods'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerClass_methods extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('class_method.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Class_methods'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('class_method_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'class_methods'); $session->set('dataType_VDM_IMPORTINTO', 'class_method'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_METHODS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_METHODS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/class_properties.php b/admin/controllers/class_properties.php index 76242b346..3b3a5fd32 100644 --- a/admin/controllers/class_properties.php +++ b/admin/controllers/class_properties.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Class_properties Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerClass_properties extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('class_property.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerClass_properties extends AdminController $model = $this->getModel('Class_properties'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Class_properties_'.$date->format('jS_F_Y'),'Class properties exported ('.$date->format('jS F, Y').')','class properties'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerClass_properties extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('class_property.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Class_properties'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('class_property_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'class_properties'); $session->set('dataType_VDM_IMPORTINTO', 'class_property'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_PROPERTIES'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_PROPERTIES'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/class_property.php b/admin/controllers/class_property.php index 8729a395e..098d702ee 100644 --- a/admin/controllers/class_property.php +++ b/admin/controllers/class_property.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Class_property Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerClass_property extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Class_properties'; // safeguard for setting the return view listing to the main view. parent::__construct($config); } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -51,10 +57,10 @@ class ComponentbuilderControllerClass_property extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('class_property.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerClass_property extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerClass_property extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerClass_property extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Class_property', '', array()); + $model = $this->getModel('Class_property', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_properties' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerClass_property extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerClass_property extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerClass_property extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerClass_property extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerClass_property extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerClass_property extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/compiler.php b/admin/controllers/compiler.php index 1314e6d02..fcdb47127 100644 --- a/admin/controllers/compiler.php +++ b/admin/controllers/compiler.php @@ -12,9 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use Joomla\CMS\Version; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -33,9 +38,9 @@ class ComponentbuilderControllerCompiler extends AdminController /** * Proxy for getModel. - * @since 2.5 + * @since 2.5 */ - public function getModel($name = 'Compiler', $prefix = 'ComponentbuilderModel', $config = array()) + public function getModel($name = 'Compiler', $prefix = 'ComponentbuilderModel', $config = []) { $model = parent::getModel($name, $prefix, array('ignore_request' => true)); @@ -44,7 +49,7 @@ class ComponentbuilderControllerCompiler extends AdminController public function dashboard() { - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder', false)); return; } @@ -56,12 +61,12 @@ class ComponentbuilderControllerCompiler extends AdminController public function getDynamicContent() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_DOWNLOAD_THE_COMPILER_ANIMATIONS'); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_DOWNLOAD_THE_COMPILER_ANIMATIONS'); // currently only those with permissions can get these images if($user->authorise('compiler.compiler_animations', 'com_componentbuilder')) { @@ -69,7 +74,7 @@ class ComponentbuilderControllerCompiler extends AdminController $model = $this->getModel('compiler'); if ($model->getDynamicContent($message)) { - $message = JText::_('COM_COMPONENTBUILDER_BALL_THE_COMPILER_ANIMATIONS_WERE_SUCCESSFULLY_DOWNLOADED_TO_THIS_JOOMLA_INSTALLB'); + $message = Text::_('COM_COMPONENTBUILDER_BALL_THE_COMPILER_ANIMATIONS_WERE_SUCCESSFULLY_DOWNLOADED_TO_THIS_JOOMLA_INSTALLB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -86,9 +91,9 @@ class ComponentbuilderControllerCompiler extends AdminController public function compiler() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // currently only those with admin access can compile a component if($user->authorise('core.manage', 'com_componentbuilder')) { @@ -97,7 +102,7 @@ class ComponentbuilderControllerCompiler extends AdminController $model = $this->getModel('compiler'); if ($model->builder()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } @@ -111,7 +116,7 @@ class ComponentbuilderControllerCompiler extends AdminController $add_plugin_install = false; $add_module_install = false; // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // set redirection URL $redirect_url = $app->getUserState('com_componentbuilder.redirect_url'); // get system messages @@ -121,7 +126,7 @@ class ComponentbuilderControllerCompiler extends AdminController // start new message $message = array(); // update the redirection URL - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); if (($pos = strpos($model->compiler->filepath['component'], "/tmp/")) !== FALSE) { $url = JURI::root() . substr($model->compiler->filepath['component'], $pos + 1); @@ -144,32 +149,36 @@ class ComponentbuilderControllerCompiler extends AdminController // Message of successful build $message[] = '

The (' . $model->compiler->filepath['component-folder'] . ') was Successfully Compiled!

'; } - $message[] = '

'; - // check if we have modules - if ($add_module_install) + + if (CFactory::_('Config')->joomla_version == Version::MAJOR_VERSION) { - foreach ($model->compiler->filepath['modules-folder'] as $module_id => $module_folder) + $message[] = '

'; + // check if we have modules + if ($add_module_install) { - $message[] = '

'; + foreach ($model->compiler->filepath['modules-folder'] as $module_id => $module_folder) + { + $message[] = '

'; + } } - } - // check if we have plugins - if ($add_plugin_install) - { - foreach ($model->compiler->filepath['plugins-folder'] as $plugin_id => $plugin_folder) + // check if we have plugins + if ($add_plugin_install) { - $message[] = '

'; + foreach ($model->compiler->filepath['plugins-folder'] as $plugin_id => $plugin_folder) + { + $message[] = '

'; + } + } + // set multi install button + if ($add_multi_install) + { + $message[] = '

You can install all compiled extensions!

'; + $message[] = '

'; } - } - // set multi install button - if ($add_multi_install) - { - $message[] = '

You can install all compiled extensions!

'; - $message[] = '

'; } $message[] = '

Total time saved

'; $message[] = ''; @@ -1606,7 +1620,7 @@ abstract class ComponentbuilderHelper { if (isset($info[$other]) && isset($info[$other][$key])) { - $display[] = JText::sprintf($value, $info[$other][$key]); + $display[] = Text::sprintf($value, $info[$other][$key]); } } $display[] = '
'; @@ -1620,7 +1634,7 @@ abstract class ComponentbuilderHelper } return implode("\n",$display); } - return '
'.JText::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
'; + return '
'.Text::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
'; } /** @@ -1629,7 +1643,7 @@ abstract class ComponentbuilderHelper public static function getDbTableColumns($tableName, $as, $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // get the columns $columns = $db->getTableColumns("#__" . $tableName); // set the type (multi or single) @@ -1657,7 +1671,7 @@ abstract class ComponentbuilderHelper public static function getViewTableColumns($admin_view, $as, $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -1737,7 +1751,7 @@ abstract class ComponentbuilderHelper public static function getFieldNameAndType($id, $spacers = false) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -1805,7 +1819,7 @@ abstract class ComponentbuilderHelper if (!$bool) { return array ( - 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER'), + 'message' => Text::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER'), 'status' => 'danger'); } return false; @@ -1818,7 +1832,7 @@ abstract class ComponentbuilderHelper if (!$bool) { return array ( - 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE'), + 'message' => Text::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE'), 'status' => 'danger'); } return false; @@ -1828,7 +1842,7 @@ abstract class ComponentbuilderHelper { return array ( 'name' => $name, - 'message' => JText::_('COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK'), + 'message' => Text::_('COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK'), 'status' => 'success'); } return true; @@ -1860,7 +1874,7 @@ abstract class ComponentbuilderHelper protected static function getPlaceholderTarget($id, $name) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('id', 'target'))); @@ -1889,7 +1903,7 @@ abstract class ComponentbuilderHelper if (!isset(self::$exPowers[$id])) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('a.id'))); @@ -2206,7 +2220,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // set the defaults self::setSessionDefaults(); @@ -2219,7 +2233,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // set to local memory to speed up program self::$localSession[$key] = $value; @@ -2234,7 +2248,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // check if in local memory if (!isset(self::$localSession[$key])) @@ -2255,7 +2269,7 @@ abstract class ComponentbuilderHelper public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $dbDefaults = false) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -2297,7 +2311,7 @@ abstract class ComponentbuilderHelper // value to check since there are false and null values even 0 in the values returned $confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB'; // set the headers - $field['values_description'] .= '' . JText::_('COM_COMPONENTBUILDER_PROPERTY') . '' . JText::_('COM_COMPONENTBUILDER_EXAMPLE') . '' . JText::_('COM_COMPONENTBUILDER_DESCRIPTION') . ''; + $field['values_description'] .= '' . Text::_('COM_COMPONENTBUILDER_PROPERTY') . '' . Text::_('COM_COMPONENTBUILDER_EXAMPLE') . '' . Text::_('COM_COMPONENTBUILDER_DESCRIPTION') . ''; foreach ($properties as $property) { $example = (isset($property['example']) && UtilitiesStringHelper::check($property['example'])) ? $property['example'] : ''; @@ -2428,7 +2442,7 @@ abstract class ComponentbuilderHelper public static function getFieldTypesProperties($targets = array(), $filter = array(), $exclude = array(), $type = 'id', $operator = 'IN') { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -2662,7 +2676,7 @@ abstract class ComponentbuilderHelper if (isset($errorMessage['error']) && UtilitiesStringHelper::check($errorMessage['error'])) { // set the error in the application - JFactory::getApplication()->enqueueMessage($errorMessage['error'], 'Error'); + Factory::getApplication()->enqueueMessage($errorMessage['error'], 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $errorMessage['error']; } @@ -2671,9 +2685,9 @@ abstract class ComponentbuilderHelper elseif (UtilitiesStringHelper::check($target)) { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $target); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $target); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2682,9 +2696,9 @@ abstract class ComponentbuilderHelper elseif ('nomemory' !== $type) { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $type); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $type); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2693,9 +2707,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID_DATA', $url, $type); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID_DATA', $url, $type); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2705,9 +2719,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA', $url); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA', $url); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2717,9 +2731,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST', $url); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST', $url); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2767,7 +2781,7 @@ abstract class ComponentbuilderHelper $type = 'data'; } // add little more help if it is an access token issue - $errorMessage = JText::sprintf('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', $errorMessage, $type); + $errorMessage = Text::sprintf('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', $errorMessage, $type); } // set error notice $message['error'] = $errorMessage; @@ -2857,7 +2871,7 @@ abstract class ComponentbuilderHelper $script['display'][] = self::_t(3) . "// Include helper submenu"; $script['display'][] = self::_t(3) . "[[[-#-#-Component]]]Helper::addSubmenu('import');"; $script['display'][] = self::_t(2) . "}"; - $script['display'][] = PHP_EOL . self::_t(2) . "\$paths = new stdClass;"; + $script['display'][] = PHP_EOL . self::_t(2) . "\$paths = new \stdClass;"; $script['display'][] = self::_t(2) . "\$paths->first = '';"; $script['display'][] = self::_t(2) . "\$state = \$this->get('state');"; $script['display'][] = PHP_EOL . self::_t(2) . "\$this->paths = &\$paths;"; @@ -2871,7 +2885,7 @@ abstract class ComponentbuilderHelper $script['display'][] = self::_t(3) . "\$this->sidebar = JHtmlSidebar::render();"; $script['display'][] = self::_t(2) . "}"; $script['display'][] = PHP_EOL . self::_t(2) . "// get the session object"; - $script['display'][] = self::_t(2) . "\$session = JFactory::getSession();"; + $script['display'][] = self::_t(2) . "\$session = Factory::getSession();"; $script['display'][] = self::_t(2) . "// check if it has package"; $script['display'][] = self::_t(2) . "\$this->hasPackage" . self::_t(1) . "= \$session->get('hasPackage', false);"; $script['display'][] = self::_t(2) . "\$this->dataType" . self::_t(1) . "= \$session->get('dataType', false);"; @@ -2904,11 +2918,11 @@ abstract class ComponentbuilderHelper $script['setdata'][] = self::_t(1) . "**/"; $script['setdata'][] = self::_t(1) . "protected function setData(\$package,\$table,\$target_headers)"; $script['setdata'][] = self::_t(1) . "{"; - $script['setdata'][] = self::_t(2) . "if ([[[-#-#-Component]]]Helper::checkArray(\$target_headers))"; + $script['setdata'][] = self::_t(2) . "if (Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$target_headers))"; $script['setdata'][] = self::_t(2) . "{"; $script['setdata'][] = self::_t(3) . "// make sure the file is loaded"; $script['setdata'][] = self::_t(3) . "[[[-#-#-Component]]]Helper::composerAutoload('phpspreadsheet');"; - $script['setdata'][] = self::_t(3) . "\$jinput = JFactory::getApplication()->input;"; + $script['setdata'][] = self::_t(3) . "\$jinput = Factory::getApplication()->input;"; $script['setdata'][] = self::_t(3) . "foreach(\$target_headers as \$header)"; $script['setdata'][] = self::_t(3) . "{"; $script['setdata'][] = self::_t(4) . "if ((\$column = \$jinput->getString(\$header, false)) !== false ||"; @@ -2948,16 +2962,16 @@ abstract class ComponentbuilderHelper $script['headers'][] = self::_t(1) . "public function getExImPortHeaders()"; $script['headers'][] = self::_t(1) . "{"; $script['headers'][] = self::_t(2) . "// Get a db connection."; - $script['headers'][] = self::_t(2) . "\$db = JFactory::getDbo();"; + $script['headers'][] = self::_t(2) . "\$db = Factory::getDbo();"; $script['headers'][] = self::_t(2) . "// get the columns"; $script['headers'][] = self::_t(2) . "\$columns = \$db->getTableColumns(\"#__[[[-#-#-component]]]_[[[-#-#-view]]]\");"; - $script['headers'][] = self::_t(2) . "if ([[[-#-#-Component]]]Helper::checkArray(\$columns))"; + $script['headers'][] = self::_t(2) . "if (Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$columns))"; $script['headers'][] = self::_t(2) . "{"; $script['headers'][] = self::_t(3) . "// remove the headers you don't import/export."; $script['headers'][] = self::_t(3) . "unset(\$columns['asset_id']);"; $script['headers'][] = self::_t(3) . "unset(\$columns['checked_out']);"; $script['headers'][] = self::_t(3) . "unset(\$columns['checked_out_time']);"; - $script['headers'][] = self::_t(3) . "\$headers = new stdClass();"; + $script['headers'][] = self::_t(3) . "\$headers = new \stdClass();"; $script['headers'][] = self::_t(3) . "foreach (\$columns as \$column => \$type)"; $script['headers'][] = self::_t(3) . "{"; $script['headers'][] = self::_t(4) . "\$headers->{\$column} = \$column;"; @@ -2981,10 +2995,10 @@ abstract class ComponentbuilderHelper $script['save'][] = self::_t(1) . "protected function save(\$data,\$table)"; $script['save'][] = self::_t(1) . "{"; $script['save'][] = self::_t(2) . "// import the data if there is any"; - $script['save'][] = self::_t(2) . "if([[[-#-#-Component]]]Helper::checkArray(\$data['array']))"; + $script['save'][] = self::_t(2) . "if(Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$data['array']))"; $script['save'][] = self::_t(2) . "{"; $script['save'][] = self::_t(3) . "// get user object"; - $script['save'][] = self::_t(3) . "\$user" . self::_t(2) . "= JFactory::getUser();"; + $script['save'][] = self::_t(3) . "\$user" . self::_t(2) . "= Factory::getUser();"; $script['save'][] = self::_t(3) . "// remove header if it has headers"; $script['save'][] = self::_t(3) . "\$id_key" . self::_t(1) . "= \$data['target_headers']['id'];"; $script['save'][] = self::_t(3) . "\$published_key" . self::_t(1) . "= \$data['target_headers']['published'];"; @@ -2999,14 +3013,14 @@ abstract class ComponentbuilderHelper $script['save'][] = self::_t(3) . "}"; $script['save'][] = self::_t(3) . ""; $script['save'][] = self::_t(3) . "// make sure there is still values in array and that it was not only headers"; - $script['save'][] = self::_t(3) . "if([[[-#-#-Component]]]Helper::checkArray(\$data['array']) && \$user->authorise(\$table.'.import', 'com_[[[-#-#-component]]]') && \$user->authorise('core.import', 'com_[[[-#-#-component]]]'))"; + $script['save'][] = self::_t(3) . "if(Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$data['array']) && \$user->authorise(\$table.'.import', 'com_[[[-#-#-component]]]') && \$user->authorise('core.import', 'com_[[[-#-#-component]]]'))"; $script['save'][] = self::_t(3) . "{"; $script['save'][] = self::_t(4) . "// set target."; $script['save'][] = self::_t(4) . "\$target" . self::_t(1) . "= array_flip(\$data['target_headers']);"; $script['save'][] = self::_t(4) . "// Get a db connection."; - $script['save'][] = self::_t(4) . "\$db = JFactory::getDbo();"; + $script['save'][] = self::_t(4) . "\$db = Factory::getDbo();"; $script['save'][] = self::_t(4) . "// set some defaults"; - $script['save'][] = self::_t(4) . "\$todayDate" . self::_t(2) . "= JFactory::getDate()->toSql();"; + $script['save'][] = self::_t(4) . "\$todayDate" . self::_t(2) . "= Factory::getDate()->toSql();"; $script['save'][] = self::_t(4) . "// get global action permissions"; $script['save'][] = self::_t(4) . "\$canDo" . self::_t(3) . "= [[[-#-#-Component]]]Helper::getActions(\$table);"; $script['save'][] = self::_t(4) . "\$canEdit" . self::_t(2) . "= \$canDo->get('core.edit');"; @@ -3194,7 +3208,7 @@ abstract class ComponentbuilderHelper { $script['view'] = array(); $script['view'][] = "" +COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_DESCRIPTION="You can run a cronjob that will backup all your components as they are mapped in JCB.

USE THE FOLLOWING: loading...

Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677" COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_LABEL="Backup JCB Mapped Components" COM_COMPONENTBUILDER_CONFIG_BACKUP_DESCRIPTION="Should the zipped package of the component be moved to the local backup and remote sales server? This is only applicable if this component has those values set." COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_DESCRIPTION="Enter the email where the backup key should be send. It will only send an email if a key change is detected, and not on every backup." @@ -3324,7 +3441,7 @@ COM_COMPONENTBUILDER_CONFIG_EVERY_MINUTE="Every Minute" COM_COMPONENTBUILDER_CONFIG_EVERY_SESSION="Every Session" COM_COMPONENTBUILDER_CONFIG_EVERY_WEEK="Every Week" COM_COMPONENTBUILDER_CONFIG_EXPANSION="Expansion" -COM_COMPONENTBUILDER_CONFIG_EXPANSIONCRONJOB_NOTE_DESCRIPTION="You must run a cronjob that will trigger the expansion events for JCB.

USE THE FOLLOWING: loading...

Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677" +COM_COMPONENTBUILDER_CONFIG_EXPANSIONCRONJOB_NOTE_DESCRIPTION="You must run a cronjob that will trigger the expansion events for JCB.

USE THE FOLLOWING: loading...

Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677" COM_COMPONENTBUILDER_CONFIG_EXPANSIONCRONJOB_NOTE_LABEL="Expansion Cronjob" COM_COMPONENTBUILDER_CONFIG_EXPANSION_DESCRIPTION="Properties for this field" COM_COMPONENTBUILDER_CONFIG_EXPANSION_LABEL="Expansion" @@ -3423,6 +3540,10 @@ COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_LABEL="Prefix
Check out thes COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_MESSAGE="Error! Please add some text here." COM_COMPONENTBUILDER_CONFIG_MINIFY_DESCRIPTION="Should the JavaScript be minified when compiled." COM_COMPONENTBUILDER_CONFIG_MINIFY_LABEL="Minify JS" +COM_COMPONENTBUILDER_CONFIG_NAMESPACE_PREFIX_DESCRIPTION="Add the namespace prefix. Like your company name in a code formate. So it will have no spaces and starting with an uppercase letter, and only be alphabetical characters.
Example: VastDevelopmentMethod
This will be used as a prefix to namespacing when targeting Joomla 4 and above." +COM_COMPONENTBUILDER_CONFIG_NAMESPACE_PREFIX_HINT="VastDevelopmentMethod" +COM_COMPONENTBUILDER_CONFIG_NAMESPACE_PREFIX_LABEL="Namespace Prefix" +COM_COMPONENTBUILDER_CONFIG_NAMESPACE_PREFIX_MESSAGE="Error! Please add namespace prefix here." COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE="Never update" COM_COMPONENTBUILDER_CONFIG_NO="No" COM_COMPONENTBUILDER_CONFIG_NONE="None" @@ -3438,7 +3559,7 @@ COM_COMPONENTBUILDER_CONFIG_NOTE_DEVELOPMENT_METHOD_DEFAULT_DESCRIPTION="

This COM_COMPONENTBUILDER_CONFIG_NOTE_DEVELOPMENT_METHOD_DEFAULT_LABEL="Default Development Method" COM_COMPONENTBUILDER_CONFIG_NOTE_DEVELOPMENT_METHOD_EXPANSION_DESCRIPTION="

This method adds easy compile and install of multiple components to the current Joomla system. This automated action is called expansion.

Expansion can be achieved in two ways.

Button Expansion Option

The first and most common way is to click on any of the Run Expansion buttons found at the top of some of the JCB admin views.

Cronjob Expansion Option

The second is by running a cronjob as explained bellow the area of selection in this tab. So you do not need to manually compile and install the selected components any more, the system does all that automatically for you. The latency of the workflow is based on your cronjob frequency and the size of your component.

Expansion is pause for a component in a few ways, one by actually checking out/opening the Joomla Component view of the component in JCB, or changing the state to unpublish, archive or trashed, or simply remove if from the list below.

The Expansion method is there to speedup development testing.

Below you should set the behaviour of a selected set of components that will be auto build and installed when the expansion module is run.

" COM_COMPONENTBUILDER_CONFIG_NOTE_DEVELOPMENT_METHOD_EXPANSION_LABEL="Expansion Development Method" -COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_DESCRIPTION="

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

" +COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_DESCRIPTION="

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

" COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_LABEL="Server Configuration" COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_DESCRIPTION="You must set the folder where all the components should be deployed for git. You will have to still do your git commit and other git commands yourself. Each component will create their own folder inside this git folder." COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_LABEL="Adding git to your compiler method" @@ -3612,8 +3733,8 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JAVASCRIPT_FILE_LABEL="Add JavaScript COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_AJAX_LABEL="Add PHP (AJAX)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_DOCUMENT_LABEL="Add PHP (custom document script)" -COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL="Add PHP (custom JViewLegacy display)" -COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_LABEL="Add PHP (custom JViewLegacy methods)" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL="Add PHP (custom HtmlView display)" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_LABEL="Add PHP (custom HtmlView methods)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_VIEW_LABEL="Add PHP (custom view script)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_AJAX_INPUT_LABEL="Ajax Input" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ALLOW_ZERO_DESCRIPTION="null & zero values" @@ -3723,6 +3844,7 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ENVELOPE="Envelope" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ENVELOPE_OPENED="Envelope Opened" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EQUALIZER="Equalizer" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ERROR_UNIQUE_ALIAS="Another Custom Admin View has the same alias." +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Custom Admin View has the same alias ." COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EXIT="Exit" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EXPAND="Expand" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EXPAND_2="Expand 2" @@ -4040,6 +4162,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_CUSTOM_CODE_DETAILS="Details" COM_COMPONENTBUILDER_CUSTOM_CODE_EDIT="Editing the Custom Code" COM_COMPONENTBUILDER_CUSTOM_CODE_ERROR_UNIQUE_ALIAS="Another Custom Code has the same alias." +COM_COMPONENTBUILDER_CUSTOM_CODE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Custom Code has the same alias ." COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_DESCRIPTION="The line from where to start adding the code." COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_HINT="Only Numbers" COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_LABEL="From Line (Zero based)" @@ -4059,6 +4182,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_HTML="HTML" COM_COMPONENTBUILDER_CUSTOM_CODE_ID="Id" COM_COMPONENTBUILDER_CUSTOM_CODE_INSERTION="Insertion" COM_COMPONENTBUILDER_CUSTOM_CODE_JCB_MANUAL="JCB (manual)" +COM_COMPONENTBUILDER_CUSTOM_CODE_JOOMLA_VERSION_LABEL="Joomla Version" COM_COMPONENTBUILDER_CUSTOM_CODE_MODIFIED_BY_DESC="The last user that modified this Custom Code." COM_COMPONENTBUILDER_CUSTOM_CODE_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_CUSTOM_CODE_MODIFIED_DATE_DESC="The date this Custom Code was modified." @@ -4153,6 +4277,7 @@ COM_COMPONENTBUILDER_DTEMAILDTDDSDD="
Email
%s
" COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="
License
%s
" COM_COMPONENTBUILDER_DTOWNERDTDDSDD="
Owner
%s
" COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="
Website
%s
" +COM_COMPONENTBUILDER_DYNAMIC_BUTTON_ERROR="Dynamic Button Error" COM_COMPONENTBUILDER_DYNAMIC_GET="Dynamic Get" COM_COMPONENTBUILDER_DYNAMIC_GETS="Dynamic Gets" COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS="Dynamic Gets Access" @@ -4214,7 +4339,7 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEMS_LABEL="Add PHP (before COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEM_LABEL="Add PHP (before getting the Item)" COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_GETLISTQUERY_LABEL="Add PHP (getListQuery - JModelList)" COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_DESCRIPTION="The option to override the default JCB implementation of the router parse method for the related view where this dynamicGet is added." -COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_LABEL="Add PHP (parse Method) - in Router" +COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_LABEL="Add PHP (parse Method) - in Joomla 3 Router" COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE="Array Value" COM_COMPONENTBUILDER_DYNAMIC_GET_ASCENDING="Ascending" COM_COMPONENTBUILDER_DYNAMIC_GET_AS_LABEL="AS" @@ -4251,6 +4376,7 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_EMPTY_LABEL="Allow" COM_COMPONENTBUILDER_DYNAMIC_GET_EQUAL="equal" COM_COMPONENTBUILDER_DYNAMIC_GET_EQUAL_OR_NOT="equal or not" COM_COMPONENTBUILDER_DYNAMIC_GET_ERROR_UNIQUE_ALIAS="Another Dynamic Get has the same alias." +COM_COMPONENTBUILDER_DYNAMIC_GET_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Dynamic Get has the same alias ." COM_COMPONENTBUILDER_DYNAMIC_GET_F="f" COM_COMPONENTBUILDER_DYNAMIC_GET_FF="ff" COM_COMPONENTBUILDER_DYNAMIC_GET_FILTER_DESCRIPTION="Here you can add filters to the query." @@ -4374,7 +4500,9 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_GETLISTQUERY_DESCRIPTION="Add PHP Here that COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_GETLISTQUERY_LABEL="PHP getListQuery Method
used to add custom filtering values." COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_DESCRIPTION="Add your PHP here! [Do not add the php tags]
Add the php code to override the default JCB implementation of the router parse method for the related view where this dynamicGet is added." COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_HINT="// PHP Here that should run in the parse Method -> switch | (array) $segments - the segments of the URL to parse | (array) $vars - the URL attributes to be used by the application." -COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_LABEL="PHP" +COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_LABEL="PHP (only for Joomla 3)" +COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_NOTICE_DESCRIPTION="For Joomla 4 and above we move the router related settings to the the Component Site Router area. This can be found in the Joomla Components list view, next to the [add site views button] you will see a button that opens this new Site Router view." +COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_NOTICE_LABEL="Joomla 4++" COM_COMPONENTBUILDER_DYNAMIC_GET_PLEASE_SELECT="Please select" COM_COMPONENTBUILDER_DYNAMIC_GET_PLUGIN_EVENTS_DESCRIPTION="Select the content plugin events you would like to add to the page that uses this dynamic get. Please note that the onContentPrepare event is added to all textarea and editor field types by default, so no need to add it again." COM_COMPONENTBUILDER_DYNAMIC_GET_PLUGIN_EVENTS_LABEL="Content Plugin Events
All events added here can
be accessed in the $this->item->event object.
" @@ -4637,6 +4765,7 @@ COM_COMPONENTBUILDER_FIELDTYPE_DOUBLE="DOUBLE" COM_COMPONENTBUILDER_FIELDTYPE_EDIT="Editing the Fieldtype" COM_COMPONENTBUILDER_FIELDTYPE_ELEVEN="11" COM_COMPONENTBUILDER_FIELDTYPE_ERROR_UNIQUE_ALIAS="Another Fieldtype has the same alias." +COM_COMPONENTBUILDER_FIELDTYPE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Fieldtype has the same alias ." COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_DESCRIPTION="Text Area" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_HINT="Value/Example Here" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL="Value/Example" @@ -4767,6 +4896,7 @@ COM_COMPONENTBUILDER_FIELD_DOUBLE="DOUBLE" COM_COMPONENTBUILDER_FIELD_EDIT="Editing the Field" COM_COMPONENTBUILDER_FIELD_ELEVEN="11" COM_COMPONENTBUILDER_FIELD_ERROR_UNIQUE_ALIAS="Another Field has the same alias." +COM_COMPONENTBUILDER_FIELD_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Field has the same alias ." COM_COMPONENTBUILDER_FIELD_EXPERT_MODE_CUSTOM="Expert Mode - Custom" COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES="Fields Categories" COM_COMPONENTBUILDER_FIELD_FIELDTYPE_DESCRIPTION="Set the field type" @@ -4868,6 +4998,7 @@ COM_COMPONENTBUILDER_FIELD_XML="Xml" COM_COMPONENTBUILDER_FIELD_YES="Yes" COM_COMPONENTBUILDER_FIELD_ZERO="0" COM_COMPONENTBUILDER_FILE="File" +COM_COMPONENTBUILDER_FILE_BSB_COULD_NOT_BE_STORED="File %s could not be stored!" COM_COMPONENTBUILDER_FILE_BSB_COULD_NOT_BE_UNLOCKED="File %s could not be unlocked!" COM_COMPONENTBUILDER_FILE_BSB_WAS_MOVED_TO_BSB="File %s was moved to %s" COM_COMPONENTBUILDER_FILE_BSB_WAS_NOT_MOVED_TO_BSB="File %s was not moved to %s" @@ -4909,6 +5040,8 @@ COM_COMPONENTBUILDER_FILTER_INDEXES_TYPE_ASCENDING="Indexes Type ascending" COM_COMPONENTBUILDER_FILTER_INDEXES_TYPE_DESCENDING="Indexes Type descending" COM_COMPONENTBUILDER_FILTER_JOOMLA_PLUGIN_GROUP_ASCENDING="Joomla Plugin Group ascending" COM_COMPONENTBUILDER_FILTER_JOOMLA_PLUGIN_GROUP_DESCENDING="Joomla Plugin Group descending" +COM_COMPONENTBUILDER_FILTER_JOOMLA_VERSION_ASCENDING="Joomla Version ascending" +COM_COMPONENTBUILDER_FILTER_JOOMLA_VERSION_DESCENDING="Joomla Version descending" COM_COMPONENTBUILDER_FILTER_LANGUAGE_TAG_ASCENDING="Language Tag ascending" COM_COMPONENTBUILDER_FILTER_LANGUAGE_TAG_DESCENDING="Language Tag descending" COM_COMPONENTBUILDER_FILTER_LIBRARY_ASCENDING="Library ascending" @@ -4954,6 +5087,7 @@ COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_MODULES="Status options for com COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_MYSQL_TWEAKS="Status options for components mysql tweaks" COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_PLACEHOLDERS="Status options for components placeholders" COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_PLUGINS="Status options for components plugins" +COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_ROUTERS="Status options for components routers" COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_SITE_VIEWS="Status options for components site views" COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_UPDATES="Status options for components updates" COM_COMPONENTBUILDER_FILTER_PUBLISHED_CUSTOM_ADMIN_VIEWS="Status options for custom admin views" @@ -5003,6 +5137,7 @@ COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_MODULES="Search the component modu COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_MYSQL_TWEAKS="Search the component mysql tweaks items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_PLACEHOLDERS="Search the component placeholders items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_PLUGINS="Search the component plugins items. Prefix with ID: to search for an item by ID." +COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_ROUTERS="Search the component router items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_SITE_VIEWS="Search the component site views items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_UPDATES="Search the component updates items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_CUSTOM_ADMIN_VIEWS="Search the custom admin view items. Prefix with ID: to search for an item by ID." @@ -5062,6 +5197,9 @@ COM_COMPONENTBUILDER_FILTER_SELECT_MODELLING_METHOD="Select Modelling Method" COM_COMPONENTBUILDER_FILTER_SELECT_NAME="Select Name" COM_COMPONENTBUILDER_FILTER_SELECT_NULL_SWITCH="Select Null Switch" COM_COMPONENTBUILDER_FILTER_SELECT_PROTOCOL="Select Protocol" +COM_COMPONENTBUILDER_FILTER_SELECT_ROUTER_MODECONSTRUCTOR_AFTER_PARENT="Select Router Mode[constructor_after_parent]" +COM_COMPONENTBUILDER_FILTER_SELECT_ROUTER_MODECONSTRUCTOR_BEFORE_PARENT="Select Router Mode[constructor_before_parent]" +COM_COMPONENTBUILDER_FILTER_SELECT_ROUTER_MODEMETHODS="Select Router Mode[methods]" COM_COMPONENTBUILDER_FILTER_SELECT_SITE_VIEWS="Select Site Views" COM_COMPONENTBUILDER_FILTER_SELECT_SUPER_POWER="Select Super Power" COM_COMPONENTBUILDER_FILTER_SELECT_TARGET="Select Target" @@ -5216,6 +5354,7 @@ COM_COMPONENTBUILDER_HELP_DOCUMENT_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_HELP_DOCUMENT_DETAILS="Details" COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT="Editing the Help Document" COM_COMPONENTBUILDER_HELP_DOCUMENT_ERROR_UNIQUE_ALIAS="Another Help Document has the same alias." +COM_COMPONENTBUILDER_HELP_DOCUMENT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Help Document has the same alias ." COM_COMPONENTBUILDER_HELP_DOCUMENT_GROUPS_DESCRIPTION="Select a group/s" COM_COMPONENTBUILDER_HELP_DOCUMENT_GROUPS_LABEL="Group/s" COM_COMPONENTBUILDER_HELP_DOCUMENT_ID="Id" @@ -5267,7 +5406,6 @@ COM_COMPONENTBUILDER_HOW_TO_GET_A_S_FREE_KEYSA_FROM_VDM="How to get free COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODES_WARNINGHTHREE="

Custom Codes Warning

" COM_COMPONENTBUILDER_HR_HTHREECZEROMPZERONTHREENT_ISSUE_FOUNDHTHREEPTHE_PATH_S_COULD_NOT_BE_USEDP="

c0mp0n3nt issue found

The path (%s) could not be used.

" COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE="

Dashboard Error

" -COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_BUTTON_ERRORHTHREE="

Dynamic Button Error

" COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE="

Dynamic folder(s) were detected.

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE="

External Code Error

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE="

External Code Notice

" @@ -5391,7 +5529,6 @@ COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS="JCB: Invest in Success" COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY="JCB: Invest in the Community" COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE="JCB: Invest in the Future" COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE="JCB: Invest in Your Future" -COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB="JCB is not yet fully ready for Joomla 4, but with your help, we can make the transition faster. Show your support by making a donation today and help us bring JCB to the next level.

Your component will still only be compiled for Joomla 3" COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS="JCB Lowers Development Stress" COM_COMPONENTBUILDER_JCB_NEEDS_YOU="JCB Needs You" COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION="JCB Offers a Stronger Solution" @@ -5497,6 +5634,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_DESCRIPTION="Add the option to COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL="Add WHMCS
(license add-on)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_MENU_PREFIX_DESCRIPTION="Would you like to add a prefix to the Joomla menu name of this component" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_MENU_PREFIX_LABEL="Add Menu Prefix" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_NAMESPACE_PREFIX_DESCRIPTION="Override the namespace prefix, or use the global value found under the component builder global option under the compiler tab." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_NAMESPACE_PREFIX_LABEL="Add Namespace Prefix" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_ADMIN_LABEL="Add PHP (helper_admin Class)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL="Add PHP (helper Classes - Both admin & site)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_SITE_LABEL="Add PHP (helper_site Class)" @@ -5606,6 +5745,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_MESSAGE="Error! Please author email COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMPTYCONTRIBUTORS_DESCRIPTION="Set if a list of empty contributor fields should be added." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMPTYCONTRIBUTORS_LABEL="Empty Contributor Fields" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ERROR_UNIQUE_ALIAS="Another Joomla Component has the same alias." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Component has the same alias ." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_BUY_LINK_DESCRIPTION="Enter link where your JCB package key can be bought." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_BUY_LINK_HINT="http://www.example.com/buy-keys" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_BUY_LINK_LABEL="Buy Link
(to get key)" @@ -5659,6 +5799,10 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MODIFIED_LABEL="Modified Date" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_DESCRIPTION="Here you can tweak the way JCB implements versions in the code commenting of your component." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL="Version Options" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MYSQL="MySQL" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_DESCRIPTION="Add the namespace prefix. Like your company name in a code formate. So it will have no spaces and starting with an uppercase letter, and only be alphabetical characters.
Example: VastDevelopmentMethod
This will be used as a prefix to namespacing when targeting Joomla 4 and above." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_HINT="VastDevelopmentMethod" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_LABEL="Namespace Prefix" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_MESSAGE="Error! Please add namespace prefix here." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_DESCRIPTION="Add Name in Code Here" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_HINT="codename" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL="Name in Code
Naming Conventions" @@ -5703,7 +5847,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ON_CUSTOM_ADMIN_VIEWS_DESCRIPTION="Do COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ON_CUSTOM_ADMIN_VIEWS_LABEL="Setting Custom Admin Views" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ON_SITE_VIEWS_DESCRIPTION="Do not add the same view twice it will not work. Please watch this tutorial for more help." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ON_SITE_VIEWS_LABEL="Setting Site Views" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_DESCRIPTION="

Need help, visit Markdown-Cheatsheet

# ###Component_name### (###VERSION###)

###DESCRIPTION###

# Build Details

+ *Company*: [###COMPANYNAME###](###AUTHORWEBSITE###)
+ *Author*: [###AUTHOR###](mailto:###AUTHOREMAIL###)
+ *Name*: [###Component_name###](###AUTHORWEBSITE###)
+ *First Build*: ###CREATIONDATE###
+ *Last Build*: ###BUILDDATE###
+ *Version*: ###VERSION###
+ *Copyright*: ###COPYRIGHT###
+ *License*: ###LICENSE###

## Build Time

**###totalHours### Hours** or **###totalDays### Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)

+ *Line count*: **###LINE_COUNT###**
+ *File count*: **###FILE_COUNT###**
+ *Folder count*: **###FOLDER_COUNT###**

**###actualHoursSpent### Hours** or **###actualDaysSpent### Eight Hour Days** (the actual time the author spent)

> (with the following break down:
> **debugging @###debuggingHours###hours** = codingtime / 4;
> **planning @###planningHours###hours** = codingtime / 7;
> **mapping @###mappingHours###hours** = codingtime / 10;
> **office @###officeHours###hours** = codingtime / 6;)

**###actualTotalHours### Hours** or **###actualTotalDays### Eight Hour Days**
(a total of the realistic time frame for this project)

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)

Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### months**

> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

## Donations

If you want to support this project, please consider donating:
* Open Collective: [Joomla-Component-Builder](https://opencollective.com/Joomla-Component-Builder)
" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_DESCRIPTION="

Need help, visit Markdown-Cheatsheet

# ###Component_name### (###VERSION###)

###DESCRIPTION###

# Build Details

+ *Company*: [###COMPANYNAME###](###AUTHORWEBSITE###)
+ *Author*: [###AUTHOR###](mailto:###AUTHOREMAIL###)
+ *Name*: [###Component_name###](###AUTHORWEBSITE###)
+ *First Build*: ###CREATIONDATE###
+ *Last Build*: ###BUILDDATE###
+ *Version*: ###VERSION###
+ *Copyright*: ###COPYRIGHT###
+ *License*: ###LICENSE###

## Build Time

**###totalHours### Hours** or **###totalDays### Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)

+ *Line count*: **###LINE_COUNT###**
+ *File count*: **###FILE_COUNT###**
+ *Folder count*: **###FOLDER_COUNT###**

**###actualHoursSpent### Hours** or **###actualDaysSpent### Eight Hour Days** (the actual time the author spent)

> (with the following break down:
> **debugging @###debuggingHours###hours** = codingtime / 4;
> **planning @###planningHours###hours** = codingtime / 7;
> **mapping @###mappingHours###hours** = codingtime / 10;
> **office @###officeHours###hours** = codingtime / 6;)

**###actualTotalHours### Hours** or **###actualTotalDays### Eight Hour Days**
(a total of the realistic time frame for this project)

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)

Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### months**

> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

## Donations

If you want to support this project, please consider donating:
* Open Collective: [Joomla-Component-Builder](https://opencollective.com/Joomla-Component-Builder)
" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_LABEL="Demo README (with all place-holders)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_DESCRIPTION="During compilation the file will be moved to the server. You still need to point the above update server url to the xml file location on your server for it to work correctly." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_LABEL="Select the server used for your update server." @@ -5822,7 +5966,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_MESSAGE="Error! Please add websi COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES="Yes" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZIP="ZIP" COM_COMPONENTBUILDER_JOOMLA_FIELDS="Joomla fields" -COM_COMPONENTBUILDER_JOOMLA_FOUR="Joomla 4" +COM_COMPONENTBUILDER_JOOMLA_FOUR_AND_FIVE="Joomla 4 and 5" COM_COMPONENTBUILDER_JOOMLA_MODULE="Joomla Module" COM_COMPONENTBUILDER_JOOMLA_MODULES="Joomla Modules" COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS="Joomla Modules Access" @@ -6004,6 +6148,7 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_JOOMLA_MODULE_DYNAMIC_INTEGRATION="Dynamic Integration" COM_COMPONENTBUILDER_JOOMLA_MODULE_EDIT="Editing the Joomla Module" COM_COMPONENTBUILDER_JOOMLA_MODULE_ERROR_UNIQUE_ALIAS="Another Joomla Module has the same alias." +COM_COMPONENTBUILDER_JOOMLA_MODULE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Module has the same alias ." COM_COMPONENTBUILDER_JOOMLA_MODULE_FIELD="Field" COM_COMPONENTBUILDER_JOOMLA_MODULE_FIELDSET_DESCRIPTION="Leave default if you don't know what this should be" COM_COMPONENTBUILDER_JOOMLA_MODULE_FIELDSET_HINT="basic" @@ -6037,6 +6182,7 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_CREATED_DATE_LABEL="Create COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_DEFAULT_LINK="Default (link)" COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_EDIT="Editing the Joomla Module Files, Folders & URLs" COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS="Another Joomla Module Files, Folders & URLs has the same alias." +COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Module Files, Folders & URLs has the same alias ." COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_FILE="File" COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_FILEPATH_DESCRIPTION="Full System Path" COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_FILEPATH_HINT="/home/user/folder/file.php" @@ -6199,6 +6345,7 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_CREATED_DATE_DESC="The date this Joom COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_EDIT="Editing the Joomla Module Updates" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_ERROR_UNIQUE_ALIAS="Another Joomla Module Updates has the same alias." +COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Module Updates has the same alias ." COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_ID="Id" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_JOOMLA_MODULE_LABEL="Joomla Modules" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_MODIFIED_BY_DESC="The last user that modified this Joomla Module Updates." @@ -6403,6 +6550,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_DYNAMIC_INTEGRATION="Dynamic Integration" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_EDIT="Editing the Joomla Plugin" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ERROR_UNIQUE_ALIAS="Another Joomla Plugin has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Plugin has the same alias ." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD="Field" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELDSET_DESCRIPTION="Leave default if you don't know what this should be" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELDSET_HINT="basic" @@ -6436,6 +6584,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_CREATED_DATE_LABEL="Create COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_DEFAULT_LINK="Default (link)" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_EDIT="Editing the Joomla Plugin Files, Folders & URLs" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS="Another Joomla Plugin Files, Folders & URLs has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Plugin Files, Folders & URLs has the same alias ." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_FILE="File" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_FILEPATH_DESCRIPTION="Full System Path" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_FILEPATH_HINT="/home/user/folder/file.php" @@ -6534,6 +6683,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_DETAILS="Details" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_EDIT="Editing the Joomla Plugin Group" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ERROR_UNIQUE_ALIAS="Another Joomla Plugin Group has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Plugin Group has the same alias ." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ID="Id" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_BY_DESC="The last user that modified this Joomla Plugin Group." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_BY_LABEL="Modified By" @@ -6651,6 +6801,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_CREATED_DATE_DESC="The date this Joom COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_EDIT="Editing the Joomla Plugin Updates" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_ERROR_UNIQUE_ALIAS="Another Joomla Plugin Updates has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Plugin Updates has the same alias ." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_ID="Id" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_JOOMLA_PLUGIN_LABEL="Joomla Plugins" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_MODIFIED_BY_DESC="The last user that modified this Joomla Plugin Updates." @@ -6757,6 +6908,7 @@ COM_COMPONENTBUILDER_LANGUAGE_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_LANGUAGE_DETAILS="Details" COM_COMPONENTBUILDER_LANGUAGE_EDIT="Editing the Language" COM_COMPONENTBUILDER_LANGUAGE_ERROR_UNIQUE_ALIAS="Another Language has the same alias." +COM_COMPONENTBUILDER_LANGUAGE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Language has the same alias ." COM_COMPONENTBUILDER_LANGUAGE_ID="Id" COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_DESCRIPTION="Enter the language tag – example: en-GB for English (UK). This should be the exact prefix used for the language installed or to be installed." COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_HINT="en-GB" @@ -6831,6 +6983,7 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_DETAILS="Details" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT="Editing the Language Translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ERROR_UNIQUE_ALIAS="Another Language Translation has the same alias." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Language Translation has the same alias ." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ID="Id" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE="Language" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE_LABEL="Language" @@ -6928,6 +7081,7 @@ COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_VALUES_DESCRIPTION="Only use dynamic get val COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_VALUES_LABEL="Dynamic Values" COM_COMPONENTBUILDER_LAYOUT_EDIT="Editing the Layout" COM_COMPONENTBUILDER_LAYOUT_ERROR_UNIQUE_ALIAS="Another Layout has the same alias." +COM_COMPONENTBUILDER_LAYOUT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Layout has the same alias ." COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS="Layout Get Snippets Button Access" COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_LAYOUT_ID="Id" @@ -7112,6 +7266,7 @@ COM_COMPONENTBUILDER_LIBRARY_CONFIG_CUSTOM_VALUE_HINT="Custom Value Here" COM_COMPONENTBUILDER_LIBRARY_CONFIG_CUSTOM_VALUE_LABEL="Custom Value" COM_COMPONENTBUILDER_LIBRARY_CONFIG_EDIT="Editing the Library Config" COM_COMPONENTBUILDER_LIBRARY_CONFIG_ERROR_UNIQUE_ALIAS="Another Library Config has the same alias." +COM_COMPONENTBUILDER_LIBRARY_CONFIG_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Library Config has the same alias ." COM_COMPONENTBUILDER_LIBRARY_CONFIG_FIELD="Field" COM_COMPONENTBUILDER_LIBRARY_CONFIG_FIELD_DESCRIPTION="Select a field" COM_COMPONENTBUILDER_LIBRARY_CONFIG_FIELD_LABEL="Field" @@ -7145,6 +7300,7 @@ COM_COMPONENTBUILDER_LIBRARY_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_LIBRARY_DESCRIPTION_MESSAGE="Error! Please add description here." COM_COMPONENTBUILDER_LIBRARY_EDIT="Editing the Library" COM_COMPONENTBUILDER_LIBRARY_ERROR_UNIQUE_ALIAS="Another Library has the same alias." +COM_COMPONENTBUILDER_LIBRARY_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Library has the same alias ." COM_COMPONENTBUILDER_LIBRARY_EXACT_LENGTH_ONLY_4_TEXT_FIELD="Exact Length (only 4 text_field)" COM_COMPONENTBUILDER_LIBRARY_EXCLUDE="exclude" COM_COMPONENTBUILDER_LIBRARY_FIELD_OPTIONS_HINT="Options here" @@ -7170,6 +7326,7 @@ COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_CREATED_DATE_LABEL="Created Date COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_DEFAULT_LINK="Default (link)" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_EDIT="Editing the Library Files, Folders & URLs" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS="Another Library Files, Folders & URLs has the same alias." +COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Library Files, Folders & URLs has the same alias ." COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_FILE="File" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_FILEPATH_DESCRIPTION="Full System Path" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_FILEPATH_HINT="/home/user/folder/file.php" @@ -7374,6 +7531,7 @@ COM_COMPONENTBUILDER_NO_COMPONENT_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_OF_ONE_CO COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_FOR_S="No cronjob path found for (%s)" COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cronjob path found since incorrect type requested." COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND="No description found." +COM_COMPONENTBUILDER_NO_FIELDS_WHERE_SELECTED="No fields where selected!" COM_COMPONENTBUILDER_NO_FILES_LINKED="No Files Linked" COM_COMPONENTBUILDER_NO_FOUND="No Found" COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S="No instances where found in %s" @@ -7474,6 +7632,7 @@ COM_COMPONENTBUILDER_PLACEHOLDER_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_PLACEHOLDER_DETAILS="Details" COM_COMPONENTBUILDER_PLACEHOLDER_EDIT="Editing the Placeholder" COM_COMPONENTBUILDER_PLACEHOLDER_ERROR_UNIQUE_ALIAS="Another Placeholder has the same alias." +COM_COMPONENTBUILDER_PLACEHOLDER_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Placeholder has the same alias ." COM_COMPONENTBUILDER_PLACEHOLDER_ID="Id" COM_COMPONENTBUILDER_PLACEHOLDER_MODIFIED_BY_DESC="The last user that modified this Placeholder." COM_COMPONENTBUILDER_PLACEHOLDER_MODIFIED_BY_LABEL="Modified By" @@ -7500,7 +7659,7 @@ COM_COMPONENTBUILDER_PLACEHOLDER_VERSION_LABEL="Version" COM_COMPONENTBUILDER_PLACES_ACROSS_JCB_WHERE_THIS_S_IS_LINKED="Places across JCB where this %s is linked." COM_COMPONENTBUILDER_PLEASE_ADD_FILES_TO_S="Please add files to (%s)" COM_COMPONENTBUILDER_PLEASE_ADD_FOLDERS_TO_S="Please add folders to (%s)" -COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_LATTER="Please check again latter." +COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_LATER="Please check again later" COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA="Please check again soon! and/or follow the progress on %sgit.vdm.dev." COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST="Please first make a selection from the list." COM_COMPONENTBUILDER_PLEASE_NOTE_THAT_THIS_PACKAGE_BHAS_NOB_CHECKSUM_VALIDATION="Please note that this package has no checksum validation!" @@ -7590,6 +7749,7 @@ COM_COMPONENTBUILDER_POWER_DESCRIPTION_HINT="Add Description Here" COM_COMPONENTBUILDER_POWER_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_POWER_EDIT="Editing the Power" COM_COMPONENTBUILDER_POWER_ERROR_UNIQUE_ALIAS="Another Power has the same alias." +COM_COMPONENTBUILDER_POWER_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Power has the same alias ." COM_COMPONENTBUILDER_POWER_EXTENDS_CUSTOM_DESCRIPTION="The custom class, this class should extend" COM_COMPONENTBUILDER_POWER_EXTENDS_CUSTOM_LABEL="Extends - Custom" COM_COMPONENTBUILDER_POWER_EXTENDS_CUSTOM_MESSAGE="Error! Please add the custom class, this class should extend." @@ -7707,6 +7867,7 @@ COM_COMPONENTBUILDER_REPLACE="Replace" COM_COMPONENTBUILDER_REPLACED_WITH="replaced with" COM_COMPONENTBUILDER_REPLACE_PROCESS_COMPLETE="replace process complete" COM_COMPONENTBUILDER_REPORT_AN_ISSUE_BSB="Report an issue: %s" +COM_COMPONENTBUILDER_REQUIRED_FIELDS_MISSING_IN_THE_BMYSQL_TABLES_SOURCE_MAPB_SELECTIONBR_S="Required fields missing in the MySQL -> Tables -> Source Map selection:
%s" COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_ENTERED_BE_ONE_OF_THE_OPTIONS_IN_AN_ELEMENT_OF_TYPEQUOTLISTQUOT_THAT_IS_THAT_THE_ELEMENT_IS_A_SELECT_LIST="Requires the value entered be one of the options in an element of type="list": that is, that the element is a select list." COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_TO_BE_A_TELEPHONE_NUMBER_COMPLYING_WITH_THE_STANDARDS_OF_NANPA_ITUT_TRECEONE_HUNDRED_AND_SIXTY_FOUR_OR_IETF_RFCFOUR_THOUSAND_NINE_HUNDRED_AND_THIRTY_THREE="Requires the value to be a Telephone number complying with the standards of nanpa, ITU-T T-REC-E.164 or ietf rfc4933." COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_TO_BE_THE_SAME_AS_THAT_HELD_IN_THE_FIELD_NAMED_QUOTFIELDQUOT_EGS="Requires the value to be the same as that held in the field named "field", eg:%s" @@ -7817,6 +7978,7 @@ COM_COMPONENTBUILDER_SERVER_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_SERVER_DETAILS="Details" COM_COMPONENTBUILDER_SERVER_EDIT="Editing the Server" COM_COMPONENTBUILDER_SERVER_ERROR_UNIQUE_ALIAS="Another Server has the same alias." +COM_COMPONENTBUILDER_SERVER_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Server has the same alias ." COM_COMPONENTBUILDER_SERVER_FTP="FTP" COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION="Add the server host name/IP here" COM_COMPONENTBUILDER_SERVER_HOST_HINT="yourhost.com" @@ -7956,8 +8118,8 @@ COM_COMPONENTBUILDER_SITE_VIEW_ADD_JAVASCRIPT_FILE_LABEL="Add JavaScript (file)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_AJAX_LABEL="Add PHP (AJAX)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_DOCUMENT_LABEL="Add PHP (custom document script)" -COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL="Add PHP (custom JViewLegacy display)" -COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_JVIEW_LABEL="Add PHP (custom JViewLegacy methods)" +COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL="Add PHP (custom HtmlView display)" +COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_JVIEW_LABEL="Add PHP (custom HtmlView methods)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_VIEW_LABEL="Add PHP (custom view script)" COM_COMPONENTBUILDER_SITE_VIEW_AJAX_INPUT_LABEL="Ajax Input" COM_COMPONENTBUILDER_SITE_VIEW_ALLOW_ZERO_DESCRIPTION="null & zero values" @@ -8072,6 +8234,7 @@ COM_COMPONENTBUILDER_SITE_VIEW_ENVELOPE="Envelope" COM_COMPONENTBUILDER_SITE_VIEW_ENVELOPE_OPENED="Envelope Opened" COM_COMPONENTBUILDER_SITE_VIEW_EQUALIZER="Equalizer" COM_COMPONENTBUILDER_SITE_VIEW_ERROR_UNIQUE_ALIAS="Another Site View has the same alias." +COM_COMPONENTBUILDER_SITE_VIEW_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Site View has the same alias ." COM_COMPONENTBUILDER_SITE_VIEW_EXIT="Exit" COM_COMPONENTBUILDER_SITE_VIEW_EXPAND="Expand" COM_COMPONENTBUILDER_SITE_VIEW_EXPAND_2="Expand 2" @@ -8404,6 +8567,7 @@ COM_COMPONENTBUILDER_SNIPPET_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_SNIPPET_DETAILS="Details" COM_COMPONENTBUILDER_SNIPPET_EDIT="Editing the Snippet" COM_COMPONENTBUILDER_SNIPPET_ERROR_UNIQUE_ALIAS="Another Snippet has the same alias." +COM_COMPONENTBUILDER_SNIPPET_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Snippet has the same alias ." COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS="Snippet Get Snippets Button Access" COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_SNIPPET_GUID_DESCRIPTION="Globally Unique Identifier" @@ -8487,6 +8651,7 @@ COM_COMPONENTBUILDER_SNIPPET_TYPE_DESCRIPTION_MESSAGE="Error! Please add descrip COM_COMPONENTBUILDER_SNIPPET_TYPE_DETAILS="Details" COM_COMPONENTBUILDER_SNIPPET_TYPE_EDIT="Editing the Snippet Type" COM_COMPONENTBUILDER_SNIPPET_TYPE_ERROR_UNIQUE_ALIAS="Another Snippet Type has the same alias." +COM_COMPONENTBUILDER_SNIPPET_TYPE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Snippet Type has the same alias ." COM_COMPONENTBUILDER_SNIPPET_TYPE_ID="Id" COM_COMPONENTBUILDER_SNIPPET_TYPE_LABEL="Type" COM_COMPONENTBUILDER_SNIPPET_TYPE_MODIFIED_BY_DESC="The last user that modified this Snippet Type." @@ -8650,6 +8815,7 @@ COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_VALUES_DESCRIPTION="Only use dynamic get v COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_VALUES_LABEL="Dynamic Values" COM_COMPONENTBUILDER_TEMPLATE_EDIT="Editing the Template" COM_COMPONENTBUILDER_TEMPLATE_ERROR_UNIQUE_ALIAS="Another Template has the same alias." +COM_COMPONENTBUILDER_TEMPLATE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Template has the same alias ." COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS="Template Get Snippets Button Access" COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_TEMPLATE_ID="Id" @@ -8736,6 +8902,7 @@ COM_COMPONENTBUILDER_THE_COMPONENT_MODULES="The component modules" COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS="The component mysql tweaks" COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS="The component placeholders" COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS="The component plugins" +COM_COMPONENTBUILDER_THE_COMPONENT_SITE_ROUTER="The component site router" COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS="The component site views" COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES="The component updates" COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL="The Component with all linked admin views, fields linked to admin views, custom admin views, site views, templates and layouts were cloned successful!" @@ -8821,6 +8988,7 @@ COM_COMPONENTBUILDER_TYPE_COMPONENT_MODULES="Component Modules" COM_COMPONENTBUILDER_TYPE_COMPONENT_MYSQL_TWEAKS="Component mysql Tweaks" COM_COMPONENTBUILDER_TYPE_COMPONENT_PLACEHOLDERS="Component Placeholders" COM_COMPONENTBUILDER_TYPE_COMPONENT_PLUGINS="Component Plugins" +COM_COMPONENTBUILDER_TYPE_COMPONENT_ROUTER="Component Router" COM_COMPONENTBUILDER_TYPE_COMPONENT_SITE_VIEWS="Component Site Views" COM_COMPONENTBUILDER_TYPE_COMPONENT_UPDATES="Component Updates" COM_COMPONENTBUILDER_TYPE_CUSTOM_ADMIN_VIEW="Custom Admin View" @@ -8924,6 +9092,7 @@ COM_COMPONENTBUILDER_VALIDATION_RULE_CREATED_DATE_DESC="The date this Validation COM_COMPONENTBUILDER_VALIDATION_RULE_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_VALIDATION_RULE_EDIT="Editing the Validation Rule" COM_COMPONENTBUILDER_VALIDATION_RULE_ERROR_UNIQUE_ALIAS="Another Validation Rule has the same alias." +COM_COMPONENTBUILDER_VALIDATION_RULE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Validation Rule has the same alias ." COM_COMPONENTBUILDER_VALIDATION_RULE_EXTENDS_FORMRULE="Extends FormRule" COM_COMPONENTBUILDER_VALIDATION_RULE_ID="Id" COM_COMPONENTBUILDER_VALIDATION_RULE_INHERIT_DESCRIPTION="Select an existing validation rule that you would like to adapt." @@ -8993,6 +9162,7 @@ COM_COMPONENTBUILDER_YES="Yes" COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL" COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE="Your are about to update ALL values that can be found in the database." COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW="Your are about to update row" +COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR_AND_JOOMLA_FIVE="Your component will be compiled to work in Joomla 4 and Joomla 5" COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE="Your component will be compiled to work in Joomla 3" COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 256 bit encryption using the above 32 character key." COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items." 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 b1d0e533b..9e13b53fc 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -391,6 +391,26 @@ COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE="Components Plugins Edit Stat COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component plugins" COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION="Components Plugins Edit Version" COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version components plugins" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS="Components Routers Access" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS_DESC="Allows the users in this group to access access components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_USE="Components Routers Batch Use" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_USE_DESC="Allows the users in this group to use batch copy/update method of batch components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE="Components Routers Create" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE_DESC="Allows the users in this group to create create components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE="Components Routers Delete" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE_DESC="Allows the users in this group to delete delete components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT="Components Routers Edit" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY="Components Routers Edit Created By" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE="Components Routers Edit Created Date" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_DESC="Allows the users in this group to edit the component router" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN="Components Routers Edit Own" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components routers created by them" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE="Components Routers Edit State" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component router" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION="Components Routers Edit Version" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version components routers" COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS="Components Site Views Access" COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS_DESC="Allows the users in this group to access access components site views" COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE="Components Site Views Batch Use" diff --git a/admin/layouts/admin_custom_tabs/publishing.php b/admin/layouts/admin_custom_tabs/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/admin_custom_tabs/publishing.php +++ b/admin/layouts/admin_custom_tabs/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_custom_tabs/publlshing.php b/admin/layouts/admin_custom_tabs/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_custom_tabs/publlshing.php +++ b/admin/layouts/admin_custom_tabs/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_custom_tabs/tabs_above.php b/admin/layouts/admin_custom_tabs/tabs_above.php index 4e0068392..c779fcdc7 100644 --- a/admin/layouts/admin_custom_tabs/tabs_above.php +++ b/admin/layouts/admin_custom_tabs/tabs_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'admin_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_custom_tabs/tabs_fullwidth.php b/admin/layouts/admin_custom_tabs/tabs_fullwidth.php index 8cdb42655..2366ef74f 100644 --- a/admin/layouts/admin_custom_tabs/tabs_fullwidth.php +++ b/admin/layouts/admin_custom_tabs/tabs_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'tabs' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields/fields_above.php b/admin/layouts/admin_fields/fields_above.php index 4e0068392..c779fcdc7 100644 --- a/admin/layouts/admin_fields/fields_above.php +++ b/admin/layouts/admin_fields/fields_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'admin_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields/fields_fullwidth.php b/admin/layouts/admin_fields/fields_fullwidth.php index ac1636573..9355bbd2f 100644 --- a/admin/layouts/admin_fields/fields_fullwidth.php +++ b/admin/layouts/admin_fields/fields_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfields' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields/publishing.php b/admin/layouts/admin_fields/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/admin_fields/publishing.php +++ b/admin/layouts/admin_fields/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields/publlshing.php b/admin/layouts/admin_fields/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_fields/publlshing.php +++ b/admin/layouts/admin_fields/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_conditions/conditions_above.php b/admin/layouts/admin_fields_conditions/conditions_above.php index 4e0068392..c779fcdc7 100644 --- a/admin/layouts/admin_fields_conditions/conditions_above.php +++ b/admin/layouts/admin_fields_conditions/conditions_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'admin_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_conditions/conditions_fullwidth.php b/admin/layouts/admin_fields_conditions/conditions_fullwidth.php index 6a98583c7..ed2efa434 100644 --- a/admin/layouts/admin_fields_conditions/conditions_fullwidth.php +++ b/admin/layouts/admin_fields_conditions/conditions_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addconditions' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_conditions/publishing.php b/admin/layouts/admin_fields_conditions/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/admin_fields_conditions/publishing.php +++ b/admin/layouts/admin_fields_conditions/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_conditions/publlshing.php b/admin/layouts/admin_fields_conditions/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_fields_conditions/publlshing.php +++ b/admin/layouts/admin_fields_conditions/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_relations/publishing.php b/admin/layouts/admin_fields_relations/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/admin_fields_relations/publishing.php +++ b/admin/layouts/admin_fields_relations/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_relations/publlshing.php b/admin/layouts/admin_fields_relations/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_fields_relations/publlshing.php +++ b/admin/layouts/admin_fields_relations/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_relations/relations_above.php b/admin/layouts/admin_fields_relations/relations_above.php index 4e0068392..c779fcdc7 100644 --- a/admin/layouts/admin_fields_relations/relations_above.php +++ b/admin/layouts/admin_fields_relations/relations_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'admin_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_relations/relations_fullwidth.php b/admin/layouts/admin_fields_relations/relations_fullwidth.php index f90e77fef..2bc1f28a3 100644 --- a/admin/layouts/admin_fields_relations/relations_fullwidth.php +++ b/admin/layouts/admin_fields_relations/relations_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addrelations' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/css_fullwidth.php b/admin/layouts/admin_view/css_fullwidth.php index 253eb58bd..96e44de92 100644 --- a/admin/layouts/admin_view/css_fullwidth.php +++ b/admin/layouts/admin_view/css_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/custom_buttons_fullwidth.php b/admin/layouts/admin_view/custom_buttons_fullwidth.php index 4d465133a..b923f43de 100644 --- a/admin/layouts/admin_view/custom_buttons_fullwidth.php +++ b/admin/layouts/admin_view/custom_buttons_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_model_list' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/custom_buttons_left.php b/admin/layouts/admin_view/custom_buttons_left.php index 0f09a8578..14e6b3be7 100644 --- a/admin/layouts/admin_view/custom_buttons_left.php +++ b/admin/layouts/admin_view/custom_buttons_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'custom_button' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/custom_import_fullwidth.php b/admin/layouts/admin_view/custom_import_fullwidth.php index 45e9c641c..d7581768d 100644 --- a/admin/layouts/admin_view/custom_import_fullwidth.php +++ b/admin/layouts/admin_view/custom_import_fullwidth.php @@ -38,7 +38,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_import_ext' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_above.php b/admin/layouts/admin_view/details_above.php index 87bb562cb..ca79cda0b 100644 --- a/admin/layouts/admin_view/details_above.php +++ b/admin/layouts/admin_view/details_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'system_name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_fullwidth.php b/admin/layouts/admin_view/details_fullwidth.php index 4c12d1b6e..ca6a32f57 100644 --- a/admin/layouts/admin_view/details_fullwidth.php +++ b/admin/layouts/admin_view/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_left.php b/admin/layouts/admin_view/details_left.php index ac95961ad..5ba739e4f 100644 --- a/admin/layouts/admin_view/details_left.php +++ b/admin/layouts/admin_view/details_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'icon_category' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_right.php b/admin/layouts/admin_view/details_right.php index cc8a1136b..08e45d724 100644 --- a/admin/layouts/admin_view/details_right.php +++ b/admin/layouts/admin_view/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_fadein' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_under.php b/admin/layouts/admin_view/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/admin_view/details_under.php +++ b/admin/layouts/admin_view/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/fields_fullwidth.php b/admin/layouts/admin_view/fields_fullwidth.php index c0c5e3d13..9ddd4f127 100644 --- a/admin/layouts/admin_view/fields_fullwidth.php +++ b/admin/layouts/admin_view/fields_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_create_edit_display' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/fields_left.php b/admin/layouts/admin_view/fields_left.php index 06e630cfb..94f05ff70 100644 --- a/admin/layouts/admin_view/fields_left.php +++ b/admin/layouts/admin_view/fields_left.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_category_submenu' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/fields_right.php b/admin/layouts/admin_view/fields_right.php index fe2333e2d..d18a73428 100644 --- a/admin/layouts/admin_view/fields_right.php +++ b/admin/layouts/admin_view/fields_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_create_edit_buttons' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/javascript_fullwidth.php b/admin/layouts/admin_view/javascript_fullwidth.php index 4730f04a4..ac14aa1ca 100644 --- a/admin/layouts/admin_view/javascript_fullwidth.php +++ b/admin/layouts/admin_view/javascript_fullwidth.php @@ -36,7 +36,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'javascript_views_footer' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/mysql_fullwidth.php b/admin/layouts/admin_view/mysql_fullwidth.php index e49958274..044a98f0e 100644 --- a/admin/layouts/admin_view/mysql_fullwidth.php +++ b/admin/layouts/admin_view/mysql_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sql' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/mysql_left.php b/admin/layouts/admin_view/mysql_left.php index 10141576d..be363eb8f 100644 --- a/admin/layouts/admin_view/mysql_left.php +++ b/admin/layouts/admin_view/mysql_left.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addtables' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/php_fullwidth.php b/admin/layouts/admin_view/php_fullwidth.php index 7f3e7e491..8594c257c 100644 --- a/admin/layouts/admin_view/php_fullwidth.php +++ b/admin/layouts/admin_view/php_fullwidth.php @@ -69,7 +69,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_document' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/publishing.php b/admin/layouts/admin_view/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/admin_view/publishing.php +++ b/admin/layouts/admin_view/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/publlshing.php b/admin/layouts/admin_view/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_view/publlshing.php +++ b/admin/layouts/admin_view/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/settings_fullwidth.php b/admin/layouts/admin_view/settings_fullwidth.php index 99653b635..432f6f109 100644 --- a/admin/layouts/admin_view/settings_fullwidth.php +++ b/admin/layouts/admin_view/settings_fullwidth.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addlinked_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 7e45fe25a..e16530a29 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -12,6 +12,7 @@ // No direct access to this file defined('JPATH_BASE') or die; +use Joomla\CMS\Language\Text; JHtmlBehavior::core(); $divWrapper = range(1,120,2); $counter = 0; @@ -19,8 +20,8 @@ $counter = 0; ListSelection) : ?>
ListSelection as $ListSelection) : ?> -
-
+
+
-
+
- +
- - -
+ + +
\ No newline at end of file diff --git a/admin/layouts/class_extends/details_fullwidth.php b/admin/layouts/class_extends/details_fullwidth.php index f7dc8078c..5384b8666 100644 --- a/admin/layouts/class_extends/details_fullwidth.php +++ b/admin/layouts/class_extends/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'head' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_extends/details_left.php b/admin/layouts/class_extends/details_left.php index 978f1cc38..93997fd08 100644 --- a/admin/layouts/class_extends/details_left.php +++ b/admin/layouts/class_extends/details_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'extension_type' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_extends/details_right.php b/admin/layouts/class_extends/details_right.php index 19e2f8dbb..c0a0b9647 100644 --- a/admin/layouts/class_extends/details_right.php +++ b/admin/layouts/class_extends/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'comment' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_extends/publishing.php b/admin/layouts/class_extends/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/class_extends/publishing.php +++ b/admin/layouts/class_extends/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_extends/publlshing.php b/admin/layouts/class_extends/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/class_extends/publlshing.php +++ b/admin/layouts/class_extends/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/details_fullwidth.php b/admin/layouts/class_method/details_fullwidth.php index 8551ba464..61779f18c 100644 --- a/admin/layouts/class_method/details_fullwidth.php +++ b/admin/layouts/class_method/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'code' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/details_left.php b/admin/layouts/class_method/details_left.php index c6ec62819..ac29eeb68 100644 --- a/admin/layouts/class_method/details_left.php +++ b/admin/layouts/class_method/details_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_plugin_group' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/details_right.php b/admin/layouts/class_method/details_right.php index 19e2f8dbb..c0a0b9647 100644 --- a/admin/layouts/class_method/details_right.php +++ b/admin/layouts/class_method/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'comment' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/publishing.php b/admin/layouts/class_method/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/class_method/publishing.php +++ b/admin/layouts/class_method/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/publlshing.php b/admin/layouts/class_method/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/class_method/publlshing.php +++ b/admin/layouts/class_method/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_property/details_left.php b/admin/layouts/class_property/details_left.php index 042b458dd..db307ef39 100644 --- a/admin/layouts/class_property/details_left.php +++ b/admin/layouts/class_property/details_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_plugin_group' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_property/details_right.php b/admin/layouts/class_property/details_right.php index 19e2f8dbb..c0a0b9647 100644 --- a/admin/layouts/class_property/details_right.php +++ b/admin/layouts/class_property/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'comment' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_property/publishing.php b/admin/layouts/class_property/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/class_property/publishing.php +++ b/admin/layouts/class_property/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_property/publlshing.php b/admin/layouts/class_property/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/class_property/publlshing.php +++ b/admin/layouts/class_property/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/clone_left.php b/admin/layouts/component_admin_views/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_admin_views/clone_left.php +++ b/admin/layouts/component_admin_views/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/publishing.php b/admin/layouts/component_admin_views/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_admin_views/publishing.php +++ b/admin/layouts/component_admin_views/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/publlshing.php b/admin/layouts/component_admin_views/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_admin_views/publlshing.php +++ b/admin/layouts/component_admin_views/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/views_above.php b/admin/layouts/component_admin_views/views_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_admin_views/views_above.php +++ b/admin/layouts/component_admin_views/views_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/views_fullwidth.php b/admin/layouts/component_admin_views/views_fullwidth.php index 1673841f2..5c7f56822 100644 --- a/admin/layouts/component_admin_views/views_fullwidth.php +++ b/admin/layouts/component_admin_views/views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addadmin_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/clone_left.php b/admin/layouts/component_config/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_config/clone_left.php +++ b/admin/layouts/component_config/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/options_above.php b/admin/layouts/component_config/options_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_config/options_above.php +++ b/admin/layouts/component_config/options_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/options_fullwidth.php b/admin/layouts/component_config/options_fullwidth.php index f05e0e794..3d2a9a8c5 100644 --- a/admin/layouts/component_config/options_fullwidth.php +++ b/admin/layouts/component_config/options_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addconfig' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/publishing.php b/admin/layouts/component_config/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_config/publishing.php +++ b/admin/layouts/component_config/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/publlshing.php b/admin/layouts/component_config/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_config/publlshing.php +++ b/admin/layouts/component_config/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/clone_left.php b/admin/layouts/component_custom_admin_menus/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_custom_admin_menus/clone_left.php +++ b/admin/layouts/component_custom_admin_menus/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/menus_above.php b/admin/layouts/component_custom_admin_menus/menus_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_custom_admin_menus/menus_above.php +++ b/admin/layouts/component_custom_admin_menus/menus_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/menus_fullwidth.php b/admin/layouts/component_custom_admin_menus/menus_fullwidth.php index bbc75d620..789f83fb1 100644 --- a/admin/layouts/component_custom_admin_menus/menus_fullwidth.php +++ b/admin/layouts/component_custom_admin_menus/menus_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addcustommenus' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/publishing.php b/admin/layouts/component_custom_admin_menus/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_custom_admin_menus/publishing.php +++ b/admin/layouts/component_custom_admin_menus/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/publlshing.php b/admin/layouts/component_custom_admin_menus/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_custom_admin_menus/publlshing.php +++ b/admin/layouts/component_custom_admin_menus/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/clone_left.php b/admin/layouts/component_custom_admin_views/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_custom_admin_views/clone_left.php +++ b/admin/layouts/component_custom_admin_views/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/publishing.php b/admin/layouts/component_custom_admin_views/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_custom_admin_views/publishing.php +++ b/admin/layouts/component_custom_admin_views/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/publlshing.php b/admin/layouts/component_custom_admin_views/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_custom_admin_views/publlshing.php +++ b/admin/layouts/component_custom_admin_views/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/views_above.php b/admin/layouts/component_custom_admin_views/views_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_custom_admin_views/views_above.php +++ b/admin/layouts/component_custom_admin_views/views_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/views_fullwidth.php b/admin/layouts/component_custom_admin_views/views_fullwidth.php index 6a4ad5855..10c57b3c7 100644 --- a/admin/layouts/component_custom_admin_views/views_fullwidth.php +++ b/admin/layouts/component_custom_admin_views/views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addcustom_admin_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/clone_left.php b/admin/layouts/component_dashboard/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_dashboard/clone_left.php +++ b/admin/layouts/component_dashboard/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/dashboard_above.php b/admin/layouts/component_dashboard/dashboard_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_dashboard/dashboard_above.php +++ b/admin/layouts/component_dashboard/dashboard_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/dashboard_fullwidth.php b/admin/layouts/component_dashboard/dashboard_fullwidth.php index aade82bb5..c842e18d8 100644 --- a/admin/layouts/component_dashboard/dashboard_fullwidth.php +++ b/admin/layouts/component_dashboard/dashboard_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dashboard_tab' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/publishing.php b/admin/layouts/component_dashboard/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_dashboard/publishing.php +++ b/admin/layouts/component_dashboard/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/publlshing.php b/admin/layouts/component_dashboard/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_dashboard/publlshing.php +++ b/admin/layouts/component_dashboard/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/advance_fullwidth.php b/admin/layouts/component_files_folders/advance_fullwidth.php index 5fd19b54f..3d510dcae 100644 --- a/admin/layouts/component_files_folders/advance_fullwidth.php +++ b/admin/layouts/component_files_folders/advance_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_constant_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/basic_above.php b/admin/layouts/component_files_folders/basic_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_files_folders/basic_above.php +++ b/admin/layouts/component_files_folders/basic_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/basic_fullwidth.php b/admin/layouts/component_files_folders/basic_fullwidth.php index 62e58dc11..223f7bf06 100644 --- a/admin/layouts/component_files_folders/basic_fullwidth.php +++ b/admin/layouts/component_files_folders/basic_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfolders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/clone_left.php b/admin/layouts/component_files_folders/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_files_folders/clone_left.php +++ b/admin/layouts/component_files_folders/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/publishing.php b/admin/layouts/component_files_folders/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_files_folders/publishing.php +++ b/admin/layouts/component_files_folders/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/publlshing.php b/admin/layouts/component_files_folders/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_files_folders/publlshing.php +++ b/admin/layouts/component_files_folders/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/clone_left.php b/admin/layouts/component_modules/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_modules/clone_left.php +++ b/admin/layouts/component_modules/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/modules_above.php b/admin/layouts/component_modules/modules_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_modules/modules_above.php +++ b/admin/layouts/component_modules/modules_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/modules_fullwidth.php b/admin/layouts/component_modules/modules_fullwidth.php index 41348c16e..463450154 100644 --- a/admin/layouts/component_modules/modules_fullwidth.php +++ b/admin/layouts/component_modules/modules_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addjoomla_modules' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/publishing.php b/admin/layouts/component_modules/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_modules/publishing.php +++ b/admin/layouts/component_modules/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/publlshing.php b/admin/layouts/component_modules/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_modules/publlshing.php +++ b/admin/layouts/component_modules/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/clone_left.php b/admin/layouts/component_mysql_tweaks/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_mysql_tweaks/clone_left.php +++ b/admin/layouts/component_mysql_tweaks/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/mysql_tweaks_above.php b/admin/layouts/component_mysql_tweaks/mysql_tweaks_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_mysql_tweaks/mysql_tweaks_above.php +++ b/admin/layouts/component_mysql_tweaks/mysql_tweaks_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/mysql_tweaks_fullwidth.php b/admin/layouts/component_mysql_tweaks/mysql_tweaks_fullwidth.php index c8066789a..7ea3bdef4 100644 --- a/admin/layouts/component_mysql_tweaks/mysql_tweaks_fullwidth.php +++ b/admin/layouts/component_mysql_tweaks/mysql_tweaks_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sql_tweak' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/publishing.php b/admin/layouts/component_mysql_tweaks/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_mysql_tweaks/publishing.php +++ b/admin/layouts/component_mysql_tweaks/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/publlshing.php b/admin/layouts/component_mysql_tweaks/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_mysql_tweaks/publlshing.php +++ b/admin/layouts/component_mysql_tweaks/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/clone_left.php b/admin/layouts/component_placeholders/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_placeholders/clone_left.php +++ b/admin/layouts/component_placeholders/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/details_above.php b/admin/layouts/component_placeholders/details_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_placeholders/details_above.php +++ b/admin/layouts/component_placeholders/details_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/details_fullwidth.php b/admin/layouts/component_placeholders/details_fullwidth.php index fd57fc4a6..f664fa009 100644 --- a/admin/layouts/component_placeholders/details_fullwidth.php +++ b/admin/layouts/component_placeholders/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addplaceholders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/publishing.php b/admin/layouts/component_placeholders/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_placeholders/publishing.php +++ b/admin/layouts/component_placeholders/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/publlshing.php b/admin/layouts/component_placeholders/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_placeholders/publlshing.php +++ b/admin/layouts/component_placeholders/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/clone_left.php b/admin/layouts/component_plugins/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_plugins/clone_left.php +++ b/admin/layouts/component_plugins/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/plugins_above.php b/admin/layouts/component_plugins/plugins_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_plugins/plugins_above.php +++ b/admin/layouts/component_plugins/plugins_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/plugins_fullwidth.php b/admin/layouts/component_plugins/plugins_fullwidth.php index 77bd19357..5c70f9f8d 100644 --- a/admin/layouts/component_plugins/plugins_fullwidth.php +++ b/admin/layouts/component_plugins/plugins_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addjoomla_plugins' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/publishing.php b/admin/layouts/component_plugins/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_plugins/publishing.php +++ b/admin/layouts/component_plugins/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/publlshing.php b/admin/layouts/component_plugins/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_plugins/publlshing.php +++ b/admin/layouts/component_plugins/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_router/index.html b/admin/layouts/component_router/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/component_router/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/component_router/publishing.php b/admin/layouts/component_router/publishing.php new file mode 100644 index 000000000..e8b5798d7 --- /dev/null +++ b/admin/layouts/component_router/publishing.php @@ -0,0 +1,46 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'title', + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/component_router/publlshing.php b/admin/layouts/component_router/publlshing.php new file mode 100644 index 000000000..9b1e77c16 --- /dev/null +++ b/admin/layouts/component_router/publlshing.php @@ -0,0 +1,47 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/component_router/settings_above.php b/admin/layouts/component_router/settings_above.php new file mode 100644 index 000000000..49a90ad8b --- /dev/null +++ b/admin/layouts/component_router/settings_above.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 + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'joomla_component' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/component_router/settings_fullwidth.php b/admin/layouts/component_router/settings_fullwidth.php new file mode 100644 index 000000000..81a7d5be6 --- /dev/null +++ b/admin/layouts/component_router/settings_fullwidth.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 + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'router_settings_details_switch', + 'note_router_settings', + 'note_router_settings_advance', + 'mode_constructor_before_parent', + 'note_mode_constructor_before_parent_manual', + 'constructor_before_parent_code', + 'constructor_before_parent_manual', + 'mode_constructor_after_parent', + 'constructor_after_parent_code', + 'mode_methods', + 'methods_code' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/component_site_views/clone_left.php b/admin/layouts/component_site_views/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_site_views/clone_left.php +++ b/admin/layouts/component_site_views/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_site_views/publishing.php b/admin/layouts/component_site_views/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_site_views/publishing.php +++ b/admin/layouts/component_site_views/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_site_views/publlshing.php b/admin/layouts/component_site_views/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_site_views/publlshing.php +++ b/admin/layouts/component_site_views/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_site_views/views_above.php b/admin/layouts/component_site_views/views_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_site_views/views_above.php +++ b/admin/layouts/component_site_views/views_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_site_views/views_fullwidth.php b/admin/layouts/component_site_views/views_fullwidth.php index 89afa4ba2..b98a52057 100644 --- a/admin/layouts/component_site_views/views_fullwidth.php +++ b/admin/layouts/component_site_views/views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addsite_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/clone_left.php b/admin/layouts/component_updates/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_updates/clone_left.php +++ b/admin/layouts/component_updates/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/publishing.php b/admin/layouts/component_updates/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_updates/publishing.php +++ b/admin/layouts/component_updates/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/publlshing.php b/admin/layouts/component_updates/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_updates/publlshing.php +++ b/admin/layouts/component_updates/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/updates_above.php b/admin/layouts/component_updates/updates_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_updates/updates_above.php +++ b/admin/layouts/component_updates/updates_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/updates_fullwidth.php b/admin/layouts/component_updates/updates_fullwidth.php index ccf6866f5..c7b1a2d6c 100644 --- a/admin/layouts/component_updates/updates_fullwidth.php +++ b/admin/layouts/component_updates/updates_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'version_update' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php index 554de9d8c..a0036b262 100644 --- a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php +++ b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_model' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/custom_buttons_left.php b/admin/layouts/custom_admin_view/custom_buttons_left.php index 0f09a8578..14e6b3be7 100644 --- a/admin/layouts/custom_admin_view/custom_buttons_left.php +++ b/admin/layouts/custom_admin_view/custom_buttons_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'custom_button' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_above.php b/admin/layouts/custom_admin_view/details_above.php index 019a14081..f4c751c3f 100644 --- a/admin/layouts/custom_admin_view/details_above.php +++ b/admin/layouts/custom_admin_view/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'context' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_fullwidth.php b/admin/layouts/custom_admin_view/details_fullwidth.php index 8c0c8e83e..4588be130 100644 --- a/admin/layouts/custom_admin_view/details_fullwidth.php +++ b/admin/layouts/custom_admin_view/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'default' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_left.php b/admin/layouts/custom_admin_view/details_left.php index df266c7f1..701581d58 100644 --- a/admin/layouts/custom_admin_view/details_left.php +++ b/admin/layouts/custom_admin_view/details_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_php_language_string' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_right.php b/admin/layouts/custom_admin_view/details_right.php index c97f5422e..45fb83312 100644 --- a/admin/layouts/custom_admin_view/details_right.php +++ b/admin/layouts/custom_admin_view/details_right.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_snippet_usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_rightside.php b/admin/layouts/custom_admin_view/details_rightside.php index d7ea40a77..41d309d7d 100644 --- a/admin/layouts/custom_admin_view/details_rightside.php +++ b/admin/layouts/custom_admin_view/details_rightside.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dynamic_values' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_under.php b/admin/layouts/custom_admin_view/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/custom_admin_view/details_under.php +++ b/admin/layouts/custom_admin_view/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/javascript_css_fullwidth.php b/admin/layouts/custom_admin_view/javascript_css_fullwidth.php index 2d215335d..2b81ca60e 100644 --- a/admin/layouts/custom_admin_view/javascript_css_fullwidth.php +++ b/admin/layouts/custom_admin_view/javascript_css_fullwidth.php @@ -36,7 +36,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/linked_components_fullwidth.php b/admin/layouts/custom_admin_view/linked_components_fullwidth.php index 4c12d1b6e..ca6a32f57 100644 --- a/admin/layouts/custom_admin_view/linked_components_fullwidth.php +++ b/admin/layouts/custom_admin_view/linked_components_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/php_fullwidth.php b/admin/layouts/custom_admin_view/php_fullwidth.php index deb10e126..84d3fe3d7 100644 --- a/admin/layouts/custom_admin_view/php_fullwidth.php +++ b/admin/layouts/custom_admin_view/php_fullwidth.php @@ -39,7 +39,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_jview' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/publishing.php b/admin/layouts/custom_admin_view/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/custom_admin_view/publishing.php +++ b/admin/layouts/custom_admin_view/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/publlshing.php b/admin/layouts/custom_admin_view/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/custom_admin_view/publlshing.php +++ b/admin/layouts/custom_admin_view/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_above.php b/admin/layouts/custom_code/details_above.php index 68ce3e65c..0eb3d4b75 100644 --- a/admin/layouts/custom_code/details_above.php +++ b/admin/layouts/custom_code/details_above.php @@ -28,10 +28,11 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; $fields = $displayData->get($fields_tab_layout) ?: array( 'target', 'system_name', + 'joomla_version', 'function_name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_fullwidth.php b/admin/layouts/custom_code/details_fullwidth.php index 2e431c66e..8729b857b 100644 --- a/admin/layouts/custom_code/details_fullwidth.php +++ b/admin/layouts/custom_code/details_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_placeholders_explained' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_left.php b/admin/layouts/custom_code/details_left.php index 3e3621fab..e93f38b47 100644 --- a/admin/layouts/custom_code/details_left.php +++ b/admin/layouts/custom_code/details_left.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'hashtarget' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_right.php b/admin/layouts/custom_code/details_right.php index 2e65f13a0..8227678a0 100644 --- a/admin/layouts/custom_code/details_right.php +++ b/admin/layouts/custom_code/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'hashendtarget' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_under.php b/admin/layouts/custom_code/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/custom_code/details_under.php +++ b/admin/layouts/custom_code/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/publishing.php b/admin/layouts/custom_code/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/custom_code/publishing.php +++ b/admin/layouts/custom_code/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/publlshing.php b/admin/layouts/custom_code/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/custom_code/publlshing.php +++ b/admin/layouts/custom_code/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/abacus_fullwidth.php b/admin/layouts/dynamic_get/abacus_fullwidth.php index 3ab1f0e03..fe4717716 100644 --- a/admin/layouts/dynamic_get/abacus_fullwidth.php +++ b/admin/layouts/dynamic_get/abacus_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_calculation' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/abacus_left.php b/admin/layouts/dynamic_get/abacus_left.php index bbf798601..d4598b9f6 100644 --- a/admin/layouts/dynamic_get/abacus_left.php +++ b/admin/layouts/dynamic_get/abacus_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addcalculation' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/custom_script_fullwidth.php b/admin/layouts/dynamic_get/custom_script_fullwidth.php index d529430e0..35156aedf 100644 --- a/admin/layouts/dynamic_get/custom_script_fullwidth.php +++ b/admin/layouts/dynamic_get/custom_script_fullwidth.php @@ -37,10 +37,11 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_php_after_getitems', 'php_after_getitems', 'add_php_router_parse', + 'php_router_parse_notice', 'php_router_parse' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/joint_fullwidth.php b/admin/layouts/dynamic_get/joint_fullwidth.php index d1c05074c..dd56f9b4c 100644 --- a/admin/layouts/dynamic_get/joint_fullwidth.php +++ b/admin/layouts/dynamic_get/joint_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'join_db_table' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_above.php b/admin/layouts/dynamic_get/main_above.php index d15037af5..9b4cf461f 100644 --- a/admin/layouts/dynamic_get/main_above.php +++ b/admin/layouts/dynamic_get/main_above.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'pagination' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_fullwidth.php b/admin/layouts/dynamic_get/main_fullwidth.php index dd170b76d..a752fe44d 100644 --- a/admin/layouts/dynamic_get/main_fullwidth.php +++ b/admin/layouts/dynamic_get/main_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_left.php b/admin/layouts/dynamic_get/main_left.php index 48761754b..9f5f64a50 100644 --- a/admin/layouts/dynamic_get/main_left.php +++ b/admin/layouts/dynamic_get/main_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'db_selection' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_right.php b/admin/layouts/dynamic_get/main_right.php index a504903ec..6573eab2f 100644 --- a/admin/layouts/dynamic_get/main_right.php +++ b/admin/layouts/dynamic_get/main_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'plugin_events' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_under.php b/admin/layouts/dynamic_get/main_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/dynamic_get/main_under.php +++ b/admin/layouts/dynamic_get/main_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/publishing.php b/admin/layouts/dynamic_get/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/dynamic_get/publishing.php +++ b/admin/layouts/dynamic_get/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/publlshing.php b/admin/layouts/dynamic_get/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/dynamic_get/publlshing.php +++ b/admin/layouts/dynamic_get/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/tweak_fullwidth.php b/admin/layouts/dynamic_get/tweak_fullwidth.php index 9d340c48d..bf3be56ad 100644 --- a/admin/layouts/dynamic_get/tweak_fullwidth.php +++ b/admin/layouts/dynamic_get/tweak_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'global' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/database_fullwidth.php b/admin/layouts/field/database_fullwidth.php index f3dde1361..e1f9066b7 100644 --- a/admin/layouts/field/database_fullwidth.php +++ b/admin/layouts/field/database_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_database_settings_needed' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/database_left.php b/admin/layouts/field/database_left.php index c312abeba..28043f64e 100644 --- a/admin/layouts/field/database_left.php +++ b/admin/layouts/field/database_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'datadefault_other' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/database_right.php b/admin/layouts/field/database_right.php index 644649025..13a86167b 100644 --- a/admin/layouts/field/database_right.php +++ b/admin/layouts/field/database_right.php @@ -39,7 +39,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'on_get_model_field' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/publishing.php b/admin/layouts/field/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/field/publishing.php +++ b/admin/layouts/field/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/publlshing.php b/admin/layouts/field/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/field/publlshing.php +++ b/admin/layouts/field/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/scripts_left.php b/admin/layouts/field/scripts_left.php index 726f3fe4a..2b6ac97dd 100644 --- a/admin/layouts/field/scripts_left.php +++ b/admin/layouts/field/scripts_left.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/scripts_right.php b/admin/layouts/field/scripts_right.php index 8ff91e5f2..f3d723ecf 100644 --- a/admin/layouts/field/scripts_right.php +++ b/admin/layouts/field/scripts_right.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'javascript_views_footer' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/set_properties_above.php b/admin/layouts/field/set_properties_above.php index a899861d3..dfa26042d 100644 --- a/admin/layouts/field/set_properties_above.php +++ b/admin/layouts/field/set_properties_above.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'catid' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/set_properties_fullwidth.php b/admin/layouts/field/set_properties_fullwidth.php index 77f331121..4a6aa70e4 100644 --- a/admin/layouts/field/set_properties_fullwidth.php +++ b/admin/layouts/field/set_properties_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_filter_information' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/set_properties_under.php b/admin/layouts/field/set_properties_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/field/set_properties_under.php +++ b/admin/layouts/field/set_properties_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/type_info_fullwidth.php b/admin/layouts/field/type_info_fullwidth.php index c310d8d68..beeb5186c 100644 --- a/admin/layouts/field/type_info_fullwidth.php +++ b/admin/layouts/field/type_info_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'xml' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/database_defaults_left.php b/admin/layouts/fieldtype/database_defaults_left.php index b0ea19849..8f786f5e8 100644 --- a/admin/layouts/fieldtype/database_defaults_left.php +++ b/admin/layouts/fieldtype/database_defaults_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'datadefault_other' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/database_defaults_right.php b/admin/layouts/fieldtype/database_defaults_right.php index 0f650d05d..7feeeaac0 100644 --- a/admin/layouts/fieldtype/database_defaults_right.php +++ b/admin/layouts/fieldtype/database_defaults_right.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_whmcs_encryption' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/details_above.php b/admin/layouts/fieldtype/details_above.php index 4b44cd601..4cf7932ce 100644 --- a/admin/layouts/fieldtype/details_above.php +++ b/admin/layouts/fieldtype/details_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/details_fullwidth.php b/admin/layouts/fieldtype/details_fullwidth.php index e150a3b3e..e3315a49c 100644 --- a/admin/layouts/fieldtype/details_fullwidth.php +++ b/admin/layouts/fieldtype/details_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/details_left.php b/admin/layouts/fieldtype/details_left.php index 0e67b869b..e04cc70b7 100644 --- a/admin/layouts/fieldtype/details_left.php +++ b/admin/layouts/fieldtype/details_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'short_description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/details_right.php b/admin/layouts/fieldtype/details_right.php index 37215496b..bd0ef9952 100644 --- a/admin/layouts/fieldtype/details_right.php +++ b/admin/layouts/fieldtype/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index badb9937b..af8e274a3 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -12,22 +12,28 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; + // set the defaults $items = $displayData->vycfields; -$user = JFactory::getUser(); +$user = Factory::getUser(); $id = $displayData->item->id; // set the edit URL $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; // set a return value $return = ($id) ? "index.php?option=com_componentbuilder&view=fieldtype&layout=edit&id=" . $id : ""; // check for a return value -$jinput = JFactory::getApplication()->input; +$jinput = Factory::getApplication()->input; if ($_return = $jinput->get('return', null, 'base64')) { $return .= "&return=" . $_return; } // check if return value was set -if (ComponentbuilderHelper::checkString($return)) +if (StringHelper::check($return)) { // set the referral values $ref = ($id) ? "&ref=fieldtype&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); @@ -47,40 +53,40 @@ $can = ComponentbuilderHelper::getActions('field');
get('field.create')): ?>
- - + +


- + @@ -88,7 +94,7 @@ $can = ComponentbuilderHelper::getActions('field'); $item): ?> authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('field',$item,'fields'); ?> @@ -96,7 +102,7 @@ $can = ComponentbuilderHelper::getActions('field'); get('field.edit')): ?> escape($item->name); ?>checked_out): ?> - name, $item->checked_out_time, 'fields.', $canCheckin); ?> + name, $item->checked_out_time, 'fields.', $canCheckin); ?> escape($item->name); ?> @@ -106,16 +112,16 @@ $can = ComponentbuilderHelper::getActions('field'); escape($item->fieldtype_name); ?> published == 1): ?> published == 0): ?> published == 2): ?> published == -2): ?> @@ -158,7 +164,7 @@ $can = ComponentbuilderHelper::getActions('field');
- + - + - + - + - + - + - + - + - +
- datatype); ?> + datatype); ?> - indexes); ?> + indexes); ?> - null_switch); ?> + null_switch); ?> - store); ?> + store); ?> authorise('core.edit', 'com_componentbuilder.field.category.' . (int)$item->catid)): ?> @@ -126,26 +132,26 @@ $can = ComponentbuilderHelper::getActions('field'); - - + + - - + + - - + + - - + +
- +
diff --git a/admin/layouts/fieldtype/publishing.php b/admin/layouts/fieldtype/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/fieldtype/publishing.php +++ b/admin/layouts/fieldtype/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/publlshing.php b/admin/layouts/fieldtype/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/fieldtype/publlshing.php +++ b/admin/layouts/fieldtype/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php index 5d8ed3d98..f3a8e7abf 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'alias' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php index 2d71a04d6..913080e6e 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'content' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php index f72ddc06e..695279e92 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'site_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php index 5dcfa71db..b986a65f5 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'article' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php index 09643bbaa..07e9d9a2a 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/publlshing.php b/admin/layouts/help_document/publlshing.php index cb41f62bc..d54df3db0 100644 --- a/admin/layouts/help_document/publlshing.php +++ b/admin/layouts/help_document/publlshing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/jcbnoticeboardpro.php b/admin/layouts/jcbnoticeboardpro.php index 1d0e53a8c..43533de2d 100644 --- a/admin/layouts/jcbnoticeboardpro.php +++ b/admin/layouts/jcbnoticeboardpro.php @@ -12,11 +12,16 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + ?>
- -
.
+ +
.
diff --git a/admin/layouts/jcbnoticeboardtabs.php b/admin/layouts/jcbnoticeboardtabs.php index 6a6ca9fbe..7749c2545 100644 --- a/admin/layouts/jcbnoticeboardtabs.php +++ b/admin/layouts/jcbnoticeboardtabs.php @@ -12,18 +12,23 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + ?> -
- $displayData['active'] . '-noticeboard')) ?> - - +
+ $displayData['active'] . '-noticeboard')); ?> + +
- - - -
- - + + + +
+ +
diff --git a/admin/layouts/jcbnoticeboardvdm.php b/admin/layouts/jcbnoticeboardvdm.php index 04dec6150..99bc2f1f4 100644 --- a/admin/layouts/jcbnoticeboardvdm.php +++ b/admin/layouts/jcbnoticeboardvdm.php @@ -12,11 +12,16 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + ?>
- -
.
+ +
.
diff --git a/admin/layouts/jcbsupportmessage.php b/admin/layouts/jcbsupportmessage.php index 1aaa5a707..4a242848c 100644 --- a/admin/layouts/jcbsupportmessage.php +++ b/admin/layouts/jcbsupportmessage.php @@ -12,17 +12,22 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + // Different support requests/appreciation $support = [ - JText::_("COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_JCB_IS_A_CRUCIAL_TOOL_FOR_PHP_PROGRAMMERS_WHO_USE_JOOMLA_TO_EARN_A_LIVING_BY_MAKING_A_BFINANCIAL_DONATIONB_YOU_CAN_SUPPORT_THE_GROWTH_AND_CONTINUITY_OF_THIS_VITAL_RESOURCE_AND_ENSURE_ITS_RELEVANCE_FOR_YEARS_TO_COME_YOUR_CONTRIBUTION_NO_MATTER_HOW_BIG_OR_SMALL_WILL_BE_DEEPLY_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_THE_CONTINUED_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_HAS_ALLOWED_JOOMLA_COMPONENT_BUILDER_JCB_TO_THRIVE_FOR_SEVEN_YEARS_SINCE_GOING_PUBLIC_YOUR_CONTRIBUTIONS_HAVE_BEEN_CRUCIAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_THANK_YOU_FOR_YOUR_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), - JText::_("COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL"), - JText::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_DONATIONB_SUPPORT_THE_NECESSARY_DEVELOPMENT_AND_MAINTENANCE_OF_THIS_OPENSOURCE_PROJECT_ENSURING_ITS_CONTINUED_GROWTH_AND_RELEVANCE_FOR_THE_COMMUNITY_YOUR_CONTRIBUTION_WILL_HELP_SECURE_THE_FUTURE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), - JText::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_THE_CONTINUAL_SUPPORT_OF_ALL_THOSE_USING_THE_TOOL_WILL_BE_MORE_THAN_ENOUGH_TO_ENSURE_ITS_CONTINUED_GROWTH_AND_RELEVANCE_BY_INVESTING_IN_THIS_OPENSOURCE_PROJECT_YOU_ARE_SECURING_ITS_FUTURE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), - JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_GRATITUDE_TO_ALL_THOSE_WHO_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WHETHER_AS_A_HOBBY_OR_AS_A_PART_OF_THEIR_BUSINESS_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_HAD_A_SIGNIFICANT_IMPACT_ON_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_WE_HIGHLY_VALUE_THE_DEDICATION_OF_HOBBYISTS_AND_THE_COMMITMENT_OF_COMPANIES_WHO_SUPPORT_JCB_AS_THEY_HAVE_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_WE_ARE_GRATEFUL_FOR_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_SMALL_AND_THANK_YOU_FOR_BEING_A_PART_OF_THE_POSITIVE_IMPACT_THAT_JCB_HAS_ON_THE_PHP_PROGRAMMING_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_WITHOUT_SUFFICIENT_SUPPORT_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_IS_IN_JEOPARDY_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_IT_IS_CRUCIAL_TO_ENSURE_ITS_CONTINUED_DEVELOPMENT_AND_MAINTENANCE_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_YOU_ARE_HELPING_TO_SAFEGUARD_THE_FUTURE_OF_THIS_OPENSOURCE_PROJECT_NEGLECTING_TO_SUPPORT_JCB_COULD_RESULT_IN_ITS_DECLINE_AND_LOSS_AS_A_RESOURCE_FOR_THE_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_HEARTFELT_APPRECIATION_TO_THOSE_WHO_HAVE_SUPPORTED_THE_JOOMLA_COMPONENT_BUILDER_JCB_PROJECT_OVER_THE_YEARS_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_BIG_OR_SMALL_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_ITS_GROWTH_AND_RELEVANCE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_SEVEN_YEARS_AFTER_GOING_PUBLIC_JCB_IS_STILL_HERE_TODAY_BECAUSE_OF_THE_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_WHO_BELIEVE_IN_THE_IMPORTANCE_OF_THIS_OPENSOURCE_PROJECT_YOUR_GENEROSITY_HAS_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), - JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_SINCERE_APPRECIATION_TO_THE_COMPANIES_WHO_USE_JOOMLA_COMPONENT_BUILDER_JCB_AND_SUPPORT_THE_PROJECT_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_YOUR_SUPPORT_HAS_ALLOWED_JCB_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_COMMITMENT_TO_THE_PROJECT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY") + Text::_("COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_JCB_IS_A_CRUCIAL_TOOL_FOR_PHP_PROGRAMMERS_WHO_USE_JOOMLA_TO_EARN_A_LIVING_BY_MAKING_A_BFINANCIAL_DONATIONB_YOU_CAN_SUPPORT_THE_GROWTH_AND_CONTINUITY_OF_THIS_VITAL_RESOURCE_AND_ENSURE_ITS_RELEVANCE_FOR_YEARS_TO_COME_YOUR_CONTRIBUTION_NO_MATTER_HOW_BIG_OR_SMALL_WILL_BE_DEEPLY_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_THE_CONTINUED_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_HAS_ALLOWED_JOOMLA_COMPONENT_BUILDER_JCB_TO_THRIVE_FOR_SEVEN_YEARS_SINCE_GOING_PUBLIC_YOUR_CONTRIBUTIONS_HAVE_BEEN_CRUCIAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_THANK_YOU_FOR_YOUR_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), + Text::_("COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL"), + Text::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_DONATIONB_SUPPORT_THE_NECESSARY_DEVELOPMENT_AND_MAINTENANCE_OF_THIS_OPENSOURCE_PROJECT_ENSURING_ITS_CONTINUED_GROWTH_AND_RELEVANCE_FOR_THE_COMMUNITY_YOUR_CONTRIBUTION_WILL_HELP_SECURE_THE_FUTURE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), + Text::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_THE_CONTINUAL_SUPPORT_OF_ALL_THOSE_USING_THE_TOOL_WILL_BE_MORE_THAN_ENOUGH_TO_ENSURE_ITS_CONTINUED_GROWTH_AND_RELEVANCE_BY_INVESTING_IN_THIS_OPENSOURCE_PROJECT_YOU_ARE_SECURING_ITS_FUTURE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), + Text::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_GRATITUDE_TO_ALL_THOSE_WHO_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WHETHER_AS_A_HOBBY_OR_AS_A_PART_OF_THEIR_BUSINESS_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_HAD_A_SIGNIFICANT_IMPACT_ON_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_WE_HIGHLY_VALUE_THE_DEDICATION_OF_HOBBYISTS_AND_THE_COMMITMENT_OF_COMPANIES_WHO_SUPPORT_JCB_AS_THEY_HAVE_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_WE_ARE_GRATEFUL_FOR_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_SMALL_AND_THANK_YOU_FOR_BEING_A_PART_OF_THE_POSITIVE_IMPACT_THAT_JCB_HAS_ON_THE_PHP_PROGRAMMING_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_WITHOUT_SUFFICIENT_SUPPORT_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_IS_IN_JEOPARDY_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_IT_IS_CRUCIAL_TO_ENSURE_ITS_CONTINUED_DEVELOPMENT_AND_MAINTENANCE_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_YOU_ARE_HELPING_TO_SAFEGUARD_THE_FUTURE_OF_THIS_OPENSOURCE_PROJECT_NEGLECTING_TO_SUPPORT_JCB_COULD_RESULT_IN_ITS_DECLINE_AND_LOSS_AS_A_RESOURCE_FOR_THE_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_HEARTFELT_APPRECIATION_TO_THOSE_WHO_HAVE_SUPPORTED_THE_JOOMLA_COMPONENT_BUILDER_JCB_PROJECT_OVER_THE_YEARS_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_BIG_OR_SMALL_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_ITS_GROWTH_AND_RELEVANCE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_SEVEN_YEARS_AFTER_GOING_PUBLIC_JCB_IS_STILL_HERE_TODAY_BECAUSE_OF_THE_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_WHO_BELIEVE_IN_THE_IMPORTANCE_OF_THIS_OPENSOURCE_PROJECT_YOUR_GENEROSITY_HAS_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), + Text::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_SINCERE_APPRECIATION_TO_THE_COMPANIES_WHO_USE_JOOMLA_COMPONENT_BUILDER_JCB_AND_SUPPORT_THE_PROJECT_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_YOUR_SUPPORT_HAS_ALLOWED_JCB_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_COMMITMENT_TO_THE_PROJECT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY") ]; // build the support message @@ -30,36 +35,36 @@ $support_message = $support[random_int(0, 8)]; // the button titles $titles = [ - JText::_("COM_COMPONENTBUILDER_JCB_ENABLES_PHP_DEVELOPMENT"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_OPENSOURCE"), - JText::_("COM_COMPONENTBUILDER_JCB_SAVES_TIME"), - JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_WORKFLOW"), - JText::_("COM_COMPONENTBUILDER_JCB_EMPOWERS_PHP_DEVELOPERS"), - JText::_("COM_COMPONENTBUILDER_JCB_STREAMLINES_DEVELOPMENT"), - JText::_("COM_COMPONENTBUILDER_JCB_PROMOTES_EFFICIENCY"), - JText::_("COM_COMPONENTBUILDER_JCB_ENHANCES_PRODUCTIVITY"), - JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_REVENUE"), - JText::_("COM_COMPONENTBUILDER_JCB_REDUCES_DEVELOPMENT_COSTS"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_THE_PHP_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHP_DEVELOPMENT"), - JText::_("COM_COMPONENTBUILDER_JCB_HELPS_GROW_BUSINESSES"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_PHP_INNOVATION"), - JText::_("COM_COMPONENTBUILDER_JCB_CONTRIBUTES_TO_OPENSOURCE"), - JText::_("COM_COMPONENTBUILDER_JCB_PROVIDES_A_BETTER_EXPERIENCE"), - JText::_("COM_COMPONENTBUILDER_JCB_OFFERS_MORE_FEATURES"), - JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_DEVELOPMENT_SPEED"), - JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_USER_EXPERIENCE"), - JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_USER_SATISFACTION"), - JText::_("COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS"), - JText::_("COM_COMPONENTBUILDER_JCB_PROMOTES_GOODWILL"), - JText::_("COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_WORTHY_CAUSE"), - JText::_("COM_COMPONENTBUILDER_JCB_BUILDS_A_BETTER_FUTURE"), - JText::_("COM_COMPONENTBUILDER_JCB_FOSTERS_A_STRONG_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHPS_REPUTATION"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_THRIVING_ECOSYSTEM"), - JText::_("COM_COMPONENTBUILDER_JCB_HELPS_PHP_THRIVE"), - JText::_("COM_COMPONENTBUILDER_JCB_INVESTS_IN_PHPS_SUCCESS") + Text::_("COM_COMPONENTBUILDER_JCB_ENABLES_PHP_DEVELOPMENT"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_OPENSOURCE"), + Text::_("COM_COMPONENTBUILDER_JCB_SAVES_TIME"), + Text::_("COM_COMPONENTBUILDER_JCB_IMPROVES_WORKFLOW"), + Text::_("COM_COMPONENTBUILDER_JCB_EMPOWERS_PHP_DEVELOPERS"), + Text::_("COM_COMPONENTBUILDER_JCB_STREAMLINES_DEVELOPMENT"), + Text::_("COM_COMPONENTBUILDER_JCB_PROMOTES_EFFICIENCY"), + Text::_("COM_COMPONENTBUILDER_JCB_ENHANCES_PRODUCTIVITY"), + Text::_("COM_COMPONENTBUILDER_JCB_INCREASES_REVENUE"), + Text::_("COM_COMPONENTBUILDER_JCB_REDUCES_DEVELOPMENT_COSTS"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_THE_PHP_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHP_DEVELOPMENT"), + Text::_("COM_COMPONENTBUILDER_JCB_HELPS_GROW_BUSINESSES"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_PHP_INNOVATION"), + Text::_("COM_COMPONENTBUILDER_JCB_CONTRIBUTES_TO_OPENSOURCE"), + Text::_("COM_COMPONENTBUILDER_JCB_PROVIDES_A_BETTER_EXPERIENCE"), + Text::_("COM_COMPONENTBUILDER_JCB_OFFERS_MORE_FEATURES"), + Text::_("COM_COMPONENTBUILDER_JCB_INCREASES_DEVELOPMENT_SPEED"), + Text::_("COM_COMPONENTBUILDER_JCB_IMPROVES_USER_EXPERIENCE"), + Text::_("COM_COMPONENTBUILDER_JCB_INCREASES_USER_SATISFACTION"), + Text::_("COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS"), + Text::_("COM_COMPONENTBUILDER_JCB_PROMOTES_GOODWILL"), + Text::_("COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_WORTHY_CAUSE"), + Text::_("COM_COMPONENTBUILDER_JCB_BUILDS_A_BETTER_FUTURE"), + Text::_("COM_COMPONENTBUILDER_JCB_FOSTERS_A_STRONG_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHPS_REPUTATION"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_THRIVING_ECOSYSTEM"), + Text::_("COM_COMPONENTBUILDER_JCB_HELPS_PHP_THRIVE"), + Text::_("COM_COMPONENTBUILDER_JCB_INVESTS_IN_PHPS_SUCCESS") ]; // build the support button @@ -67,39 +72,39 @@ $support_titles = $titles[random_int(0, 29)]; // the button names $button_names = [ - JText::_("COM_COMPONENTBUILDER_DONATE_TO_JCB"), - JText::_("COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY"), - JText::_("COM_COMPONENTBUILDER_CONTRIBUTE_TO_JCB"), - JText::_("COM_COMPONENTBUILDER_INVEST_IN_JCB"), - JText::_("COM_COMPONENTBUILDER_GIVE_TO_JCB"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_MISSION"), - JText::_("COM_COMPONENTBUILDER_HELP_JCB_GROW"), - JText::_("COM_COMPONENTBUILDER_BE_A_PART_OF_JCB"), - JText::_("COM_COMPONENTBUILDER_JCB_NEEDS_YOU"), - JText::_("COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR"), - JText::_("COM_COMPONENTBUILDER_EMPOWER_JCB"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_IMPACT"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_JOURNEY"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_COUNTS"), - JText::_("COM_COMPONENTBUILDER_EMPOWER_THE_FUTURE_WITH_JCB"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_CONTRIBUTION_MATTERS"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_VISION"), - JText::_("COM_COMPONENTBUILDER_ELEVATE_JCB_TODAY"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_CHANGE"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_DONATION_MATTERS"), - JText::_("COM_COMPONENTBUILDER_JCB_BE_THE_CHANGE"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_SUCCESS"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_IS_KEY"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS_MOST"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS_TODAY") + Text::_("COM_COMPONENTBUILDER_DONATE_TO_JCB"), + Text::_("COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY"), + Text::_("COM_COMPONENTBUILDER_CONTRIBUTE_TO_JCB"), + Text::_("COM_COMPONENTBUILDER_INVEST_IN_JCB"), + Text::_("COM_COMPONENTBUILDER_GIVE_TO_JCB"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_MISSION"), + Text::_("COM_COMPONENTBUILDER_HELP_JCB_GROW"), + Text::_("COM_COMPONENTBUILDER_BE_A_PART_OF_JCB"), + Text::_("COM_COMPONENTBUILDER_JCB_NEEDS_YOU"), + Text::_("COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR"), + Text::_("COM_COMPONENTBUILDER_EMPOWER_JCB"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_IMPACT"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_JOURNEY"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_COUNTS"), + Text::_("COM_COMPONENTBUILDER_EMPOWER_THE_FUTURE_WITH_JCB"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_CONTRIBUTION_MATTERS"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_VISION"), + Text::_("COM_COMPONENTBUILDER_ELEVATE_JCB_TODAY"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_CHANGE"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_DONATION_MATTERS"), + Text::_("COM_COMPONENTBUILDER_JCB_BE_THE_CHANGE"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_SUCCESS"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_IS_KEY"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS_MOST"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS_TODAY") ]; // build the support button diff --git a/admin/layouts/joomla_component/admin_views_fullwidth.php b/admin/layouts/joomla_component/admin_views_fullwidth.php index 49ecdf8a6..5c81e30d0 100644 --- a/admin/layouts/joomla_component/admin_views_fullwidth.php +++ b/admin/layouts/joomla_component/admin_views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_component_admin_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/custom_admin_views_fullwidth.php b/admin/layouts/joomla_component/custom_admin_views_fullwidth.php index 0b1cc116a..66d27edee 100644 --- a/admin/layouts/joomla_component/custom_admin_views_fullwidth.php +++ b/admin/layouts/joomla_component/custom_admin_views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_component_custom_admin_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dash_install_fullwidth.php b/admin/layouts/joomla_component/dash_install_fullwidth.php index 7eccffe1f..76916652b 100644 --- a/admin/layouts/joomla_component/dash_install_fullwidth.php +++ b/admin/layouts/joomla_component/dash_install_fullwidth.php @@ -38,7 +38,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_method_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dash_install_left.php b/admin/layouts/joomla_component/dash_install_left.php index 636e104f9..cb832413a 100644 --- a/admin/layouts/joomla_component/dash_install_left.php +++ b/admin/layouts/joomla_component/dash_install_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dashboard_type' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dash_install_right.php b/admin/layouts/joomla_component/dash_install_right.php index 510a9183e..3bd773f74 100644 --- a/admin/layouts/joomla_component/dash_install_right.php +++ b/admin/layouts/joomla_component/dash_install_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_botton_component_dashboard' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/details_above.php b/admin/layouts/joomla_component/details_above.php index 6cbed1d15..1c7e2de74 100644 --- a/admin/layouts/joomla_component/details_above.php +++ b/admin/layouts/joomla_component/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_powers' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/details_left.php b/admin/layouts/joomla_component/details_left.php index 9ddb7a9a8..6f450a888 100644 --- a/admin/layouts/joomla_component/details_left.php +++ b/admin/layouts/joomla_component/details_left.php @@ -40,7 +40,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/details_right.php b/admin/layouts/joomla_component/details_right.php index 2015302da..72051362e 100644 --- a/admin/layouts/joomla_component/details_right.php +++ b/admin/layouts/joomla_component/details_right.php @@ -42,7 +42,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'copyright' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/details_under.php b/admin/layouts/joomla_component/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/joomla_component/details_under.php +++ b/admin/layouts/joomla_component/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php b/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php index 8f152abbf..903b1f9e6 100644 --- a/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php +++ b/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'buildcompsql' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dynamic_integration_left.php b/admin/layouts/joomla_component/dynamic_integration_left.php index f1b7da7e0..26d81ac1d 100644 --- a/admin/layouts/joomla_component/dynamic_integration_left.php +++ b/admin/layouts/joomla_component/dynamic_integration_left.php @@ -43,7 +43,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'git_folder_path' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dynamic_integration_right.php b/admin/layouts/joomla_component/dynamic_integration_right.php index 36d48a06f..9cabdf06f 100644 --- a/admin/layouts/joomla_component/dynamic_integration_right.php +++ b/admin/layouts/joomla_component/dynamic_integration_right.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'crowdin_account_api_key' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/libs_helpers_fullwidth.php b/admin/layouts/joomla_component/libs_helpers_fullwidth.php index 4bb7292fb..8eb3abfc8 100644 --- a/admin/layouts/joomla_component/libs_helpers_fullwidth.php +++ b/admin/layouts/joomla_component/libs_helpers_fullwidth.php @@ -48,7 +48,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css_site' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/metadata.php b/admin/layouts/joomla_component/metadata.php index 47d8b22df..be4510d01 100644 --- a/admin/layouts/joomla_component/metadata.php +++ b/admin/layouts/joomla_component/metadata.php @@ -12,6 +12,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + $form = $displayData->getForm(); // JLayout for standard handling of metadata fields in the administrator content edit screens. @@ -20,7 +22,7 @@ $fieldSets = $form->getFieldsets('metadata'); $fieldSet) : ?> description) && trim($fieldSet->description)) : ?> -

escape(JText::_($fieldSet->description)); ?>

+

escape(Text::_($fieldSet->description)); ?>

get($fields_tab_layout) ?: array( 'assets_table_fix' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/publishing.php b/admin/layouts/joomla_component/publishing.php index 0375c1a3a..048dfd556 100644 --- a/admin/layouts/joomla_component/publishing.php +++ b/admin/layouts/joomla_component/publishing.php @@ -40,7 +40,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/readme_left.php b/admin/layouts/joomla_component/readme_left.php index 767d64d89..50544b2fc 100644 --- a/admin/layouts/joomla_component/readme_left.php +++ b/admin/layouts/joomla_component/readme_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'readme' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/readme_right.php b/admin/layouts/joomla_component/readme_right.php index 8d81512fc..c51b74829 100644 --- a/admin/layouts/joomla_component/readme_right.php +++ b/admin/layouts/joomla_component/readme_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_readme' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/settings_fullwidth.php b/admin/layouts/joomla_component/settings_fullwidth.php index f8b075556..4e723c4b7 100644 --- a/admin/layouts/joomla_component/settings_fullwidth.php +++ b/admin/layouts/joomla_component/settings_fullwidth.php @@ -26,14 +26,14 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( - 'spacer_hr_7', + 'spacer_hr_8', 'note_on_contributors', 'addcontributors', 'emptycontributors', 'number' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/settings_left.php b/admin/layouts/joomla_component/settings_left.php index 55a1ee310..5a9966cdf 100644 --- a/admin/layouts/joomla_component/settings_left.php +++ b/admin/layouts/joomla_component/settings_left.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_config' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/settings_right.php b/admin/layouts/joomla_component/settings_right.php index 9b45ab209..32fff8939 100644 --- a/admin/layouts/joomla_component/settings_right.php +++ b/admin/layouts/joomla_component/settings_right.php @@ -28,19 +28,22 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; $fields = $displayData->get($fields_tab_layout) ?: array( 'note_component_files_folders', 'spacer_hr_4', + 'add_namespace_prefix', + 'namespace_prefix', + 'spacer_hr_5', 'add_menu_prefix', 'menu_prefix', - 'spacer_hr_5', + 'spacer_hr_6', 'to_ignore_note', 'toignore', - 'spacer_hr_6', + 'spacer_hr_7', 'jcb_export_package_note', 'export_key', 'joomla_source_link', 'export_buy_link' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/site_views_fullwidth.php b/admin/layouts/joomla_component/site_views_fullwidth.php index 5ea3ff9a1..4807ed09c 100644 --- a/admin/layouts/joomla_component/site_views_fullwidth.php +++ b/admin/layouts/joomla_component/site_views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_component_site_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/code_fullwidth.php b/admin/layouts/joomla_module/code_fullwidth.php index 7ba3cd28c..09ee16e40 100644 --- a/admin/layouts/joomla_module/code_fullwidth.php +++ b/admin/layouts/joomla_module/code_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'mod_code' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/code_left.php b/admin/layouts/joomla_module/code_left.php index 224902240..b1336905b 100644 --- a/admin/layouts/joomla_module/code_left.php +++ b/admin/layouts/joomla_module/code_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'custom_get' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/code_right.php b/admin/layouts/joomla_module/code_right.php index 8a59d48d4..1fa0b3736 100644 --- a/admin/layouts/joomla_module/code_right.php +++ b/admin/layouts/joomla_module/code_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_mod_file_options' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/dynamic_integration_left.php b/admin/layouts/joomla_module/dynamic_integration_left.php index c35d75f98..198c4d093 100644 --- a/admin/layouts/joomla_module/dynamic_integration_left.php +++ b/admin/layouts/joomla_module/dynamic_integration_left.php @@ -37,7 +37,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sales_server' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/forms_fields_fullwidth.php b/admin/layouts/joomla_module/forms_fields_fullwidth.php index 7de237af2..f193193b7 100644 --- a/admin/layouts/joomla_module/forms_fields_fullwidth.php +++ b/admin/layouts/joomla_module/forms_fields_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'fields' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/helper_fullwidth.php b/admin/layouts/joomla_module/helper_fullwidth.php index ebfea4515..1ab63004b 100644 --- a/admin/layouts/joomla_module/helper_fullwidth.php +++ b/admin/layouts/joomla_module/helper_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'class_helper_code' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/helper_left.php b/admin/layouts/joomla_module/helper_left.php index ff4aab6f6..a4769693f 100644 --- a/admin/layouts/joomla_module/helper_left.php +++ b/admin/layouts/joomla_module/helper_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_class_helper' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/helper_right.php b/admin/layouts/joomla_module/helper_right.php index 0778bbd69..306e6e1a6 100644 --- a/admin/layouts/joomla_module/helper_right.php +++ b/admin/layouts/joomla_module/helper_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_class_helper_header' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/html_above.php b/admin/layouts/joomla_module/html_above.php index 85fb585df..bb1bb1a53 100644 --- a/admin/layouts/joomla_module/html_above.php +++ b/admin/layouts/joomla_module/html_above.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'target' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/html_fullwidth.php b/admin/layouts/joomla_module/html_fullwidth.php index 84d9224f9..2a0879327 100644 --- a/admin/layouts/joomla_module/html_fullwidth.php +++ b/admin/layouts/joomla_module/html_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/html_left.php b/admin/layouts/joomla_module/html_left.php index 5e6a487b9..b42bff411 100644 --- a/admin/layouts/joomla_module/html_left.php +++ b/admin/layouts/joomla_module/html_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_php_language_string' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/html_right.php b/admin/layouts/joomla_module/html_right.php index f7e79a421..d26d9c258 100644 --- a/admin/layouts/joomla_module/html_right.php +++ b/admin/layouts/joomla_module/html_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_snippet_usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/mysql_fullwidth.php b/admin/layouts/joomla_module/mysql_fullwidth.php index acde25167..c51f898bb 100644 --- a/admin/layouts/joomla_module/mysql_fullwidth.php +++ b/admin/layouts/joomla_module/mysql_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sql_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/publishing.php b/admin/layouts/joomla_module/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/joomla_module/publishing.php +++ b/admin/layouts/joomla_module/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/publlshing.php b/admin/layouts/joomla_module/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_module/publlshing.php +++ b/admin/layouts/joomla_module/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/readme_left.php b/admin/layouts/joomla_module/readme_left.php index 767d64d89..50544b2fc 100644 --- a/admin/layouts/joomla_module/readme_left.php +++ b/admin/layouts/joomla_module/readme_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'readme' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/script_file_fullwidth.php b/admin/layouts/joomla_module/script_file_fullwidth.php index 8c37a873c..f49d7850b 100644 --- a/admin/layouts/joomla_module/script_file_fullwidth.php +++ b/admin/layouts/joomla_module/script_file_fullwidth.php @@ -42,7 +42,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_method_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/advance_fullwidth.php b/admin/layouts/joomla_module_files_folders_urls/advance_fullwidth.php index 5fd19b54f..3d510dcae 100644 --- a/admin/layouts/joomla_module_files_folders_urls/advance_fullwidth.php +++ b/admin/layouts/joomla_module_files_folders_urls/advance_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_constant_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/basic_above.php b/admin/layouts/joomla_module_files_folders_urls/basic_above.php index 91f5cad4c..1845b0a09 100644 --- a/admin/layouts/joomla_module_files_folders_urls/basic_above.php +++ b/admin/layouts/joomla_module_files_folders_urls/basic_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_module' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/basic_fullwidth.php b/admin/layouts/joomla_module_files_folders_urls/basic_fullwidth.php index 5026c32d6..ad3ccb77b 100644 --- a/admin/layouts/joomla_module_files_folders_urls/basic_fullwidth.php +++ b/admin/layouts/joomla_module_files_folders_urls/basic_fullwidth.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfolders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/publishing.php b/admin/layouts/joomla_module_files_folders_urls/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_module_files_folders_urls/publishing.php +++ b/admin/layouts/joomla_module_files_folders_urls/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/publlshing.php b/admin/layouts/joomla_module_files_folders_urls/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_module_files_folders_urls/publlshing.php +++ b/admin/layouts/joomla_module_files_folders_urls/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_updates/publishing.php b/admin/layouts/joomla_module_updates/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_module_updates/publishing.php +++ b/admin/layouts/joomla_module_updates/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_updates/publlshing.php b/admin/layouts/joomla_module_updates/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_module_updates/publlshing.php +++ b/admin/layouts/joomla_module_updates/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_updates/updates_above.php b/admin/layouts/joomla_module_updates/updates_above.php index 91f5cad4c..1845b0a09 100644 --- a/admin/layouts/joomla_module_updates/updates_above.php +++ b/admin/layouts/joomla_module_updates/updates_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_module' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_updates/updates_fullwidth.php b/admin/layouts/joomla_module_updates/updates_fullwidth.php index ccf6866f5..c7b1a2d6c 100644 --- a/admin/layouts/joomla_module_updates/updates_fullwidth.php +++ b/admin/layouts/joomla_module_updates/updates_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'version_update' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/code_above.php b/admin/layouts/joomla_plugin/code_above.php index 8af6e74c1..08459ee0e 100644 --- a/admin/layouts/joomla_plugin/code_above.php +++ b/admin/layouts/joomla_plugin/code_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'plugin_version' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/code_fullwidth.php b/admin/layouts/joomla_plugin/code_fullwidth.php index 7b0382906..241bfebc7 100644 --- a/admin/layouts/joomla_plugin/code_fullwidth.php +++ b/admin/layouts/joomla_plugin/code_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/code_left.php b/admin/layouts/joomla_plugin/code_left.php index 6bbaf6c61..124c62611 100644 --- a/admin/layouts/joomla_plugin/code_left.php +++ b/admin/layouts/joomla_plugin/code_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_plugin' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/code_right.php b/admin/layouts/joomla_plugin/code_right.php index cce180871..bac079e74 100644 --- a/admin/layouts/joomla_plugin/code_right.php +++ b/admin/layouts/joomla_plugin/code_right.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'method_selection' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/dynamic_integration_left.php b/admin/layouts/joomla_plugin/dynamic_integration_left.php index c35d75f98..198c4d093 100644 --- a/admin/layouts/joomla_plugin/dynamic_integration_left.php +++ b/admin/layouts/joomla_plugin/dynamic_integration_left.php @@ -37,7 +37,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sales_server' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/forms_fields_fullwidth.php b/admin/layouts/joomla_plugin/forms_fields_fullwidth.php index 7de237af2..f193193b7 100644 --- a/admin/layouts/joomla_plugin/forms_fields_fullwidth.php +++ b/admin/layouts/joomla_plugin/forms_fields_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'fields' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/mysql_fullwidth.php b/admin/layouts/joomla_plugin/mysql_fullwidth.php index acde25167..c51f898bb 100644 --- a/admin/layouts/joomla_plugin/mysql_fullwidth.php +++ b/admin/layouts/joomla_plugin/mysql_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sql_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/publishing.php b/admin/layouts/joomla_plugin/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/joomla_plugin/publishing.php +++ b/admin/layouts/joomla_plugin/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/publlshing.php b/admin/layouts/joomla_plugin/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_plugin/publlshing.php +++ b/admin/layouts/joomla_plugin/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/readme_left.php b/admin/layouts/joomla_plugin/readme_left.php index 767d64d89..50544b2fc 100644 --- a/admin/layouts/joomla_plugin/readme_left.php +++ b/admin/layouts/joomla_plugin/readme_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'readme' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/script_file_fullwidth.php b/admin/layouts/joomla_plugin/script_file_fullwidth.php index 8c37a873c..f49d7850b 100644 --- a/admin/layouts/joomla_plugin/script_file_fullwidth.php +++ b/admin/layouts/joomla_plugin/script_file_fullwidth.php @@ -42,7 +42,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_method_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/advance_fullwidth.php b/admin/layouts/joomla_plugin_files_folders_urls/advance_fullwidth.php index 5fd19b54f..3d510dcae 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/advance_fullwidth.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/advance_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_constant_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/basic_above.php b/admin/layouts/joomla_plugin_files_folders_urls/basic_above.php index 0aa6bd601..74d3b5c8f 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/basic_above.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/basic_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_plugin' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/basic_fullwidth.php b/admin/layouts/joomla_plugin_files_folders_urls/basic_fullwidth.php index 5026c32d6..ad3ccb77b 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/basic_fullwidth.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/basic_fullwidth.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfolders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/publishing.php b/admin/layouts/joomla_plugin_files_folders_urls/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/publishing.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/publlshing.php b/admin/layouts/joomla_plugin_files_folders_urls/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/publlshing.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_group/details_left.php b/admin/layouts/joomla_plugin_group/details_left.php index 10724a9ed..698053efe 100644 --- a/admin/layouts/joomla_plugin_group/details_left.php +++ b/admin/layouts/joomla_plugin_group/details_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_group/details_right.php b/admin/layouts/joomla_plugin_group/details_right.php index 5e8f3f7a9..586dcd2ef 100644 --- a/admin/layouts/joomla_plugin_group/details_right.php +++ b/admin/layouts/joomla_plugin_group/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'class_extends' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_group/publishing.php b/admin/layouts/joomla_plugin_group/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_plugin_group/publishing.php +++ b/admin/layouts/joomla_plugin_group/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_group/publlshing.php b/admin/layouts/joomla_plugin_group/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_plugin_group/publlshing.php +++ b/admin/layouts/joomla_plugin_group/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_updates/publishing.php b/admin/layouts/joomla_plugin_updates/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_plugin_updates/publishing.php +++ b/admin/layouts/joomla_plugin_updates/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_updates/publlshing.php b/admin/layouts/joomla_plugin_updates/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_plugin_updates/publlshing.php +++ b/admin/layouts/joomla_plugin_updates/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_updates/updates_above.php b/admin/layouts/joomla_plugin_updates/updates_above.php index 0aa6bd601..74d3b5c8f 100644 --- a/admin/layouts/joomla_plugin_updates/updates_above.php +++ b/admin/layouts/joomla_plugin_updates/updates_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_plugin' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_updates/updates_fullwidth.php b/admin/layouts/joomla_plugin_updates/updates_fullwidth.php index ccf6866f5..c7b1a2d6c 100644 --- a/admin/layouts/joomla_plugin_updates/updates_fullwidth.php +++ b/admin/layouts/joomla_plugin_updates/updates_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'version_update' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language/details_left.php b/admin/layouts/language/details_left.php index 10724a9ed..698053efe 100644 --- a/admin/layouts/language/details_left.php +++ b/admin/layouts/language/details_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language/details_right.php b/admin/layouts/language/details_right.php index 5c45f24bd..a975654a4 100644 --- a/admin/layouts/language/details_right.php +++ b/admin/layouts/language/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'langtag' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language/publishing.php b/admin/layouts/language/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/language/publishing.php +++ b/admin/layouts/language/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language/publlshing.php b/admin/layouts/language/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/language/publlshing.php +++ b/admin/layouts/language/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language_translation/details_fullwidth.php b/admin/layouts/language_translation/details_fullwidth.php index 46179d851..4fe520946 100644 --- a/admin/layouts/language_translation/details_fullwidth.php +++ b/admin/layouts/language_translation/details_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'plugins' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language_translation/publishing.php b/admin/layouts/language_translation/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/language_translation/publishing.php +++ b/admin/layouts/language_translation/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language_translation/publlshing.php b/admin/layouts/language_translation/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/language_translation/publlshing.php +++ b/admin/layouts/language_translation/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/custom_script_fullwidth.php b/admin/layouts/layout/custom_script_fullwidth.php index edba69106..ea6db0d57 100644 --- a/admin/layouts/layout/custom_script_fullwidth.php +++ b/admin/layouts/layout/custom_script_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_fullwidth.php b/admin/layouts/layout/details_fullwidth.php index 4bc5550c6..19e53b0b0 100644 --- a/admin/layouts/layout/details_fullwidth.php +++ b/admin/layouts/layout/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'layout' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_left.php b/admin/layouts/layout/details_left.php index 876f27db5..5a2389916 100644 --- a/admin/layouts/layout/details_left.php +++ b/admin/layouts/layout/details_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_php_language_string' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_right.php b/admin/layouts/layout/details_right.php index f7e79a421..d26d9c258 100644 --- a/admin/layouts/layout/details_right.php +++ b/admin/layouts/layout/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_snippet_usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_rightside.php b/admin/layouts/layout/details_rightside.php index 466f72e12..18568c5ee 100644 --- a/admin/layouts/layout/details_rightside.php +++ b/admin/layouts/layout/details_rightside.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dynamic_values' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_under.php b/admin/layouts/layout/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/layout/details_under.php +++ b/admin/layouts/layout/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/publishing.php b/admin/layouts/layout/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/layout/publishing.php +++ b/admin/layouts/layout/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/publlshing.php b/admin/layouts/layout/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/layout/publlshing.php +++ b/admin/layouts/layout/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_above.php b/admin/layouts/library/behaviour_above.php index e1a453bf9..4190834f1 100644 --- a/admin/layouts/library/behaviour_above.php +++ b/admin/layouts/library/behaviour_above.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'type' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_fullwidth.php b/admin/layouts/library/behaviour_fullwidth.php index 0e3318e96..c80202b74 100644 --- a/admin/layouts/library/behaviour_fullwidth.php +++ b/admin/layouts/library/behaviour_fullwidth.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_setdocument' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_left.php b/admin/layouts/library/behaviour_left.php index d2e6922bd..cbb497a40 100644 --- a/admin/layouts/library/behaviour_left.php +++ b/admin/layouts/library/behaviour_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'libraries' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_right.php b/admin/layouts/library/behaviour_right.php index 37215496b..bd0ef9952 100644 --- a/admin/layouts/library/behaviour_right.php +++ b/admin/layouts/library/behaviour_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_under.php b/admin/layouts/library/behaviour_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/library/behaviour_under.php +++ b/admin/layouts/library/behaviour_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/config_fullwidth.php b/admin/layouts/library/config_fullwidth.php index 03f0a08a7..7f0044561 100644 --- a/admin/layouts/library/config_fullwidth.php +++ b/admin/layouts/library/config_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_library_config' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/files_folders_urls_fullwidth.php b/admin/layouts/library/files_folders_urls_fullwidth.php index 3f3f9ac75..4e443a475 100644 --- a/admin/layouts/library/files_folders_urls_fullwidth.php +++ b/admin/layouts/library/files_folders_urls_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_library_files_folders_urls' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/linked_fullwidth.php b/admin/layouts/library/linked_fullwidth.php index 4c12d1b6e..ca6a32f57 100644 --- a/admin/layouts/library/linked_fullwidth.php +++ b/admin/layouts/library/linked_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/publishing.php b/admin/layouts/library/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/library/publishing.php +++ b/admin/layouts/library/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/publlshing.php b/admin/layouts/library/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/library/publlshing.php +++ b/admin/layouts/library/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_config/publishing.php b/admin/layouts/library_config/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/library_config/publishing.php +++ b/admin/layouts/library_config/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_config/publlshing.php b/admin/layouts/library_config/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/library_config/publlshing.php +++ b/admin/layouts/library_config/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_config/tweaks_above.php b/admin/layouts/library_config/tweaks_above.php index 91cb40ee7..a28024f97 100644 --- a/admin/layouts/library_config/tweaks_above.php +++ b/admin/layouts/library_config/tweaks_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'library' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_config/tweaks_fullwidth.php b/admin/layouts/library_config/tweaks_fullwidth.php index f05e0e794..3d2a9a8c5 100644 --- a/admin/layouts/library_config/tweaks_fullwidth.php +++ b/admin/layouts/library_config/tweaks_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addconfig' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/advance_fullwidth.php b/admin/layouts/library_files_folders_urls/advance_fullwidth.php index 5fd19b54f..3d510dcae 100644 --- a/admin/layouts/library_files_folders_urls/advance_fullwidth.php +++ b/admin/layouts/library_files_folders_urls/advance_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_constant_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/basic_above.php b/admin/layouts/library_files_folders_urls/basic_above.php index 91cb40ee7..a28024f97 100644 --- a/admin/layouts/library_files_folders_urls/basic_above.php +++ b/admin/layouts/library_files_folders_urls/basic_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'library' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/basic_fullwidth.php b/admin/layouts/library_files_folders_urls/basic_fullwidth.php index 5026c32d6..ad3ccb77b 100644 --- a/admin/layouts/library_files_folders_urls/basic_fullwidth.php +++ b/admin/layouts/library_files_folders_urls/basic_fullwidth.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfolders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/publishing.php b/admin/layouts/library_files_folders_urls/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/library_files_folders_urls/publishing.php +++ b/admin/layouts/library_files_folders_urls/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/publlshing.php b/admin/layouts/library_files_folders_urls/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/library_files_folders_urls/publlshing.php +++ b/admin/layouts/library_files_folders_urls/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/details_fullwidth.php b/admin/layouts/placeholder/details_fullwidth.php index 71cab66d0..ef5ca0e12 100644 --- a/admin/layouts/placeholder/details_fullwidth.php +++ b/admin/layouts/placeholder/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_placeholders_placedin' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/details_left.php b/admin/layouts/placeholder/details_left.php index 0baf316e5..8297ca542 100644 --- a/admin/layouts/placeholder/details_left.php +++ b/admin/layouts/placeholder/details_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'target' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/details_right.php b/admin/layouts/placeholder/details_right.php index 76c8df47c..1aa0b4512 100644 --- a/admin/layouts/placeholder/details_right.php +++ b/admin/layouts/placeholder/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'value' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/publishing.php b/admin/layouts/placeholder/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/placeholder/publishing.php +++ b/admin/layouts/placeholder/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/publlshing.php b/admin/layouts/placeholder/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/placeholder/publlshing.php +++ b/admin/layouts/placeholder/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/code_above.php b/admin/layouts/power/code_above.php index cf6f7cec8..5ab82172b 100644 --- a/admin/layouts/power/code_above.php +++ b/admin/layouts/power/code_above.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'power_version' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/code_fullwidth.php b/admin/layouts/power/code_fullwidth.php index d96752827..dccfbf694 100644 --- a/admin/layouts/power/code_fullwidth.php +++ b/admin/layouts/power/code_fullwidth.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/code_left.php b/admin/layouts/power/code_left.php index 85ed07e9f..754b1e245 100644 --- a/admin/layouts/power/code_left.php +++ b/admin/layouts/power/code_left.php @@ -36,7 +36,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_head' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/code_right.php b/admin/layouts/power/code_right.php index 31be74664..13965517a 100644 --- a/admin/layouts/power/code_right.php +++ b/admin/layouts/power/code_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'namespace_details' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/composer_fullwidth.php b/admin/layouts/power/composer_fullwidth.php index be49af6e3..c22125db4 100644 --- a/admin/layouts/power/composer_fullwidth.php +++ b/admin/layouts/power/composer_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'composer' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/licensing_fullwidth.php b/admin/layouts/power/licensing_fullwidth.php index 56e874540..27bcb582d 100644 --- a/admin/layouts/power/licensing_fullwidth.php +++ b/admin/layouts/power/licensing_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'licensing_template' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/publishing.php b/admin/layouts/power/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/power/publishing.php +++ b/admin/layouts/power/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/publlshing.php b/admin/layouts/power/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/power/publlshing.php +++ b/admin/layouts/power/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/super_power_left.php b/admin/layouts/power/super_power_left.php index 8b1e5cc6c..b52853eda 100644 --- a/admin/layouts/power/super_power_left.php +++ b/admin/layouts/power/super_power_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'approved_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/super_power_right.php b/admin/layouts/power/super_power_right.php index e0dac78ab..9f9100729 100644 --- a/admin/layouts/power/super_power_right.php +++ b/admin/layouts/power/super_power_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_approved_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/repeatablejcb.php b/admin/layouts/repeatablejcb.php index 1140563ac..b267b7fe0 100644 --- a/admin/layouts/repeatablejcb.php +++ b/admin/layouts/repeatablejcb.php @@ -12,6 +12,11 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + /** * Make thing clear * @@ -30,8 +35,8 @@ defined('JPATH_BASE') or die('Restricted access'); extract($displayData); // Add script -JHtml::_('jquery.ui', array('core', 'sortable')); -JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); +Html::_('jquery.ui', array('core', 'sortable')); +Html::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); $sublayout = 'sectionjcb'; @@ -49,7 +54,7 @@ $sublayout = 'sectionjcb';
@@ -57,7 +62,7 @@ $sublayout = 'sectionjcb'; $form) : - echo JLayoutHelper::render( + echo LayoutHelper::render( $sublayout, array( 'form' => $form, @@ -76,7 +81,7 @@ $sublayout = 'sectionjcb'; array('<', '>'), array('SUBFORMLT', 'SUBFORMGT'), trim( - JLayoutHelper::render( + LayoutHelper::render( $sublayout, array( 'form' => $tmpl, diff --git a/admin/layouts/rows.php b/admin/layouts/rows.php index 5379aea33..bb4739667 100644 --- a/admin/layouts/rows.php +++ b/admin/layouts/rows.php @@ -12,6 +12,11 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + $headers = $displayData['headers']; $items = $displayData['items']; diff --git a/admin/layouts/sectionjcb.php b/admin/layouts/sectionjcb.php index d4c471711..0480635c8 100644 --- a/admin/layouts/sectionjcb.php +++ b/admin/layouts/sectionjcb.php @@ -12,6 +12,11 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + /** * Make thing clear * @@ -32,17 +37,17 @@ extract($displayData);
- + - + - + diff --git a/admin/layouts/server/details_above.php b/admin/layouts/server/details_above.php index c3294693f..260e4acac 100644 --- a/admin/layouts/server/details_above.php +++ b/admin/layouts/server/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'protocol' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/details_fullwidth.php b/admin/layouts/server/details_fullwidth.php index bf273a8fd..0606486ab 100644 --- a/admin/layouts/server/details_fullwidth.php +++ b/admin/layouts/server/details_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/details_left.php b/admin/layouts/server/details_left.php index e62eb25c4..24d94700e 100644 --- a/admin/layouts/server/details_left.php +++ b/admin/layouts/server/details_left.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'path' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/details_right.php b/admin/layouts/server/details_right.php index 650fb35b5..a79175534 100644 --- a/admin/layouts/server/details_right.php +++ b/admin/layouts/server/details_right.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'secret' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index 403302ea3..1672fb03e 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -11,25 +11,30 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use VDM\Joomla\Utilities\ArrayHelper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; // set the defaults $items = $displayData->vymlinked_components; -$user = JFactory::getUser(); +$user = Factory::getUser(); $id = $displayData->item->id; // set the edit URL $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; // set a return value $return = ($id) ? "index.php?option=com_componentbuilder&view=server&layout=edit&id=" . $id : ""; // check for a return value -$jinput = JFactory::getApplication()->input; +$jinput = Factory::getApplication()->input; if ($_return = $jinput->get('return', null, 'base64')) { $return .= "&return=" . $_return; } // check if return value was set -if (ComponentbuilderHelper::checkString($return)) +if (StringHelper::check($return)) { // set the referral values $ref = ($id) ? "&ref=server&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); @@ -41,27 +46,27 @@ else ?>
- + @@ -69,7 +74,7 @@ else $item): ?> authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components'); ?> @@ -78,7 +83,7 @@ else get('joomla_component.edit')): ?> escape($item->system_name); ?>checked_out): ?> - name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> + name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> escape($item->system_name); ?> @@ -89,7 +94,7 @@ else // always make sure the $this->return_here is set if (!isset($this->return_here)) { - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); } // setup the buttons if (!isset($_buttons) || !ArrayHelper::check($_buttons)) @@ -99,78 +104,84 @@ else array( 'view' => 'component_admin_views', 'views' => 'components_admin_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'), 'icon' => 'stack'), array( 'view' => 'component_custom_admin_views', 'views' => 'components_custom_admin_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS'), 'icon' => 'screen'), array( 'view' => 'component_site_views', 'views' => 'components_site_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS'), 'icon' => 'palette'), + array( + 'view' => 'component_router', + 'views' => 'components_routers', + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_ROUTER'), + 'icon' => 'tree-2'), array( 'view' => 'component_config', 'views' => 'components_config', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG'), 'icon' => 'options') ); $_buttons[1] = array( array( 'view' => 'component_placeholders', 'views' => 'components_placeholders', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS'), 'icon' => 'search'), array( 'view' => 'component_updates', 'views' => 'components_updates', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES'), 'icon' => 'database'), array( 'view' => 'component_mysql_tweaks', 'views' => 'components_mysql_tweaks', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS'), 'icon' => 'screwdriver'), array( 'view' => 'component_files_folders', 'views' => 'components_files_folders', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS'), 'icon' => 'briefcase') ); $_buttons[2] = array( array( 'view' => 'component_custom_admin_menus', 'views' => 'components_custom_admin_menus', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS'), 'icon' => 'plus'), array( 'view' => 'component_dashboard', 'views' => 'components_dashboard', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'), 'icon' => 'dashboard'), array( 'view' => 'component_modules', 'views' => 'components_modules', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'), 'icon' => 'cube'), array( 'view' => 'component_plugins', 'views' => 'components_plugins', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS'), 'icon' => 'power-cord') ); } ?>
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> - + +
published == 1): ?> published == 0): ?> published == 2): ?> published == -2): ?> @@ -253,7 +264,7 @@ else
- + - + - + - + - + - +
@@ -179,7 +190,7 @@ else
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> @@ -193,7 +204,7 @@ else
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> @@ -207,13 +218,13 @@ else escape($item->author); ?>
email) && StringHelper::check($item->author)) : ?> - + escape($item->email); ?>
website) && StringHelper::check($item->author)) : ?> - + escape($item->website); ?> @@ -221,26 +232,26 @@ else
- - + + - - + + - - + + - - + +
- +
diff --git a/admin/layouts/server/publishing.php b/admin/layouts/server/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/server/publishing.php +++ b/admin/layouts/server/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/publlshing.php b/admin/layouts/server/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/server/publlshing.php +++ b/admin/layouts/server/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/custom_buttons_fullwidth.php b/admin/layouts/site_view/custom_buttons_fullwidth.php index fef43f97c..fe8891fc9 100644 --- a/admin/layouts/site_view/custom_buttons_fullwidth.php +++ b/admin/layouts/site_view/custom_buttons_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_model' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/custom_buttons_left.php b/admin/layouts/site_view/custom_buttons_left.php index a4498e425..ed88d47f8 100644 --- a/admin/layouts/site_view/custom_buttons_left.php +++ b/admin/layouts/site_view/custom_buttons_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_custom_button' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/custom_buttons_right.php b/admin/layouts/site_view/custom_buttons_right.php index ec870325d..cd8031b00 100644 --- a/admin/layouts/site_view/custom_buttons_right.php +++ b/admin/layouts/site_view/custom_buttons_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'button_position' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_above.php b/admin/layouts/site_view/details_above.php index 019a14081..f4c751c3f 100644 --- a/admin/layouts/site_view/details_above.php +++ b/admin/layouts/site_view/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'context' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_fullwidth.php b/admin/layouts/site_view/details_fullwidth.php index 8c0c8e83e..4588be130 100644 --- a/admin/layouts/site_view/details_fullwidth.php +++ b/admin/layouts/site_view/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'default' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_left.php b/admin/layouts/site_view/details_left.php index df266c7f1..701581d58 100644 --- a/admin/layouts/site_view/details_left.php +++ b/admin/layouts/site_view/details_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_php_language_string' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_right.php b/admin/layouts/site_view/details_right.php index f7e79a421..d26d9c258 100644 --- a/admin/layouts/site_view/details_right.php +++ b/admin/layouts/site_view/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_snippet_usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_rightside.php b/admin/layouts/site_view/details_rightside.php index d7ea40a77..41d309d7d 100644 --- a/admin/layouts/site_view/details_rightside.php +++ b/admin/layouts/site_view/details_rightside.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dynamic_values' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_under.php b/admin/layouts/site_view/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/site_view/details_under.php +++ b/admin/layouts/site_view/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/javascript_css_fullwidth.php b/admin/layouts/site_view/javascript_css_fullwidth.php index af32af44d..c081c7d95 100644 --- a/admin/layouts/site_view/javascript_css_fullwidth.php +++ b/admin/layouts/site_view/javascript_css_fullwidth.php @@ -36,7 +36,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/linked_components_fullwidth.php b/admin/layouts/site_view/linked_components_fullwidth.php index 4c12d1b6e..ca6a32f57 100644 --- a/admin/layouts/site_view/linked_components_fullwidth.php +++ b/admin/layouts/site_view/linked_components_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/php_fullwidth.php b/admin/layouts/site_view/php_fullwidth.php index deb10e126..84d3fe3d7 100644 --- a/admin/layouts/site_view/php_fullwidth.php +++ b/admin/layouts/site_view/php_fullwidth.php @@ -39,7 +39,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_jview' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/publishing.php b/admin/layouts/site_view/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/site_view/publishing.php +++ b/admin/layouts/site_view/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/publlshing.php b/admin/layouts/site_view/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/site_view/publlshing.php +++ b/admin/layouts/site_view/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/contributor_fullwidth.php b/admin/layouts/snippet/contributor_fullwidth.php index 775ce5c44..6b3984e9a 100644 --- a/admin/layouts/snippet/contributor_fullwidth.php +++ b/admin/layouts/snippet/contributor_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_contributor_details' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/contributor_left.php b/admin/layouts/snippet/contributor_left.php index e60f6bd57..36a156c78 100644 --- a/admin/layouts/snippet/contributor_left.php +++ b/admin/layouts/snippet/contributor_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'contributor_website' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/contributor_right.php b/admin/layouts/snippet/contributor_right.php index 6c4cbc3ef..b6501baf9 100644 --- a/admin/layouts/snippet/contributor_right.php +++ b/admin/layouts/snippet/contributor_right.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'contributor_email' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/details_above.php b/admin/layouts/snippet/details_above.php index c32593c09..aabfe2019 100644 --- a/admin/layouts/snippet/details_above.php +++ b/admin/layouts/snippet/details_above.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'library' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/details_left.php b/admin/layouts/snippet/details_left.php index ad9163876..50a1c050f 100644 --- a/admin/layouts/snippet/details_left.php +++ b/admin/layouts/snippet/details_left.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/details_right.php b/admin/layouts/snippet/details_right.php index 722eb549b..7d903d4bd 100644 --- a/admin/layouts/snippet/details_right.php +++ b/admin/layouts/snippet/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'snippet' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/publishing.php b/admin/layouts/snippet/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/snippet/publishing.php +++ b/admin/layouts/snippet/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/publlshing.php b/admin/layouts/snippet/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/snippet/publlshing.php +++ b/admin/layouts/snippet/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet_type/details_left.php b/admin/layouts/snippet_type/details_left.php index 10724a9ed..698053efe 100644 --- a/admin/layouts/snippet_type/details_left.php +++ b/admin/layouts/snippet_type/details_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet_type/details_right.php b/admin/layouts/snippet_type/details_right.php index 37215496b..bd0ef9952 100644 --- a/admin/layouts/snippet_type/details_right.php +++ b/admin/layouts/snippet_type/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet_type/publishing.php b/admin/layouts/snippet_type/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/snippet_type/publishing.php +++ b/admin/layouts/snippet_type/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet_type/publlshing.php b/admin/layouts/snippet_type/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/snippet_type/publlshing.php +++ b/admin/layouts/snippet_type/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/table.php b/admin/layouts/table.php index b526bfa0a..53c005383 100644 --- a/admin/layouts/table.php +++ b/admin/layouts/table.php @@ -11,12 +11,17 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; use VDM\Joomla\Utilities\StringHelper; $table_id = (isset($displayData['id'])) ? $displayData['id'] : StringHelper::random(7); $name = (isset($displayData['name'])) ? $displayData['name'] : false; $table_class = (isset($displayData['table_class'])) ? $displayData['table_class'] : 'uk-table'; -$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [JText::_('COM_COMPONENTBUILDER_NO'), JText::_('COM_COMPONENTBUILDER_HEADERS'), JText::_('COM_COMPONENTBUILDER_FOUND')]; +$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [Text::_('COM_COMPONENTBUILDER_NO'), Text::_('COM_COMPONENTBUILDER_HEADERS'), Text::_('COM_COMPONENTBUILDER_FOUND')]; $items = (isset($displayData['items'])) ? $displayData['items'] : 6; ?> @@ -54,7 +59,7 @@ $items = (isset($displayData['items'])) ? $displayData['items'] : 6; - $headers, 'items' => $items]); ?> + $headers, 'items' => $items]); ?>
@@ -64,8 +69,8 @@ $items = (isset($displayData['items'])) ? $displayData['items'] : 6; if (!isset($displayData['init']) || $displayData['init']) : ?>
\ No newline at end of file diff --git a/admin/views/admins_fields_conditions/view.html.php b/admin/views/admins_fields_conditions/view.html.php index d99212b9c..04b666912 100644 --- a/admin/views/admins_fields_conditions/view.html.php +++ b/admin/views/admins_fields_conditions/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Admins_fields_conditions @@ -35,7 +48,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); $this->canEdit = $this->canDo->get('admin_fields_conditions.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_conditions'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('admin_fields_conditions.add'); + ToolbarHelper::addNew('admin_fields_conditions.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('admin_fields_conditions.edit'); + ToolbarHelper::editList('admin_fields_conditions.edit'); } if ($this->canState) { - JToolBarHelper::publishList('admins_fields_conditions.publish'); - JToolBarHelper::unpublishList('admins_fields_conditions.unpublish'); - JToolBarHelper::archiveList('admins_fields_conditions.archive'); + ToolbarHelper::publishList('admins_fields_conditions.publish'); + ToolbarHelper::unpublishList('admins_fields_conditions.unpublish'); + ToolbarHelper::archiveList('admins_fields_conditions.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('admins_fields_conditions.checkin'); + ToolbarHelper::checkin('admins_fields_conditions.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,34 +142,34 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'admins_fields_conditions.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'admins_fields_conditions.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('admins_fields_conditions.trash'); + ToolbarHelper::trash('admins_fields_conditions.trash'); } } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -164,9 +177,9 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } } @@ -180,10 +193,10 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_conditions.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admins_fields_conditions.css", ['version' => 'auto']); } /** @@ -198,23 +211,33 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/admins_fields_relations/tmpl/default.php b/admin/views/admins_fields_relations/tmpl/default.php index e515b42ea..09e52d271 100644 --- a/admin/views/admins_fields_relations/tmpl/default.php +++ b/admin/views/admins_fields_relations/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields_relations.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'admin_fields_relationsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'admin_fields_relationsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,5 +70,5 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/admins_fields_relations/tmpl/default_batch_body.php b/admin/views/admins_fields_relations/tmpl/default_batch_body.php index f45996a1e..e12368766 100644 --- a/admin/views/admins_fields_relations/tmpl/default_batch_body.php +++ b/admin/views/admins_fields_relations/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_batch_footer.php b/admin/views/admins_fields_relations/tmpl/default_batch_footer.php index adc091fbb..6715bf9e5 100644 --- a/admin/views/admins_fields_relations/tmpl/default_batch_footer.php +++ b/admin/views/admins_fields_relations/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_body.php b/admin/views/admins_fields_relations/tmpl/default_body.php index 7c5fb6506..de037435f 100644 --- a/admin/views/admins_fields_relations/tmpl/default_body.php +++ b/admin/views/admins_fields_relations/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task=admin_fields_relations.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('admin_fields_relations',$item,'admins_fields_relations'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task get('admin_fields_relations.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task get('admin_fields_relations.edit')): ?> escape($item->admin_view_system_name); ?> checked_out): ?> - name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?> + name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?> escape($item->admin_view_system_name); ?> @@ -73,15 +77,15 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task get('admin_fields_relations.edit.state')) : ?> checked_out) : ?> - published, $i, 'admins_fields_relations.', true, 'cb'); ?> + published, $i, 'admins_fields_relations.', true, 'cb'); ?> - published, $i, 'admins_fields_relations.', false, 'cb'); ?> + published, $i, 'admins_fields_relations.', false, 'cb'); ?> - published, $i, 'admins_fields_relations.', true, 'cb'); ?> + published, $i, 'admins_fields_relations.', true, 'cb'); ?> - published, $i, 'admins_fields_relations.', false, 'cb'); ?> + published, $i, 'admins_fields_relations.', false, 'cb'); ?> diff --git a/admin/views/admins_fields_relations/tmpl/default_head.php b/admin/views/admins_fields_relations/tmpl/default_head.php index 2557d2a11..28d218805 100644 --- a/admin/views/admins_fields_relations/tmpl/default_head.php +++ b/admin/views/admins_fields_relations/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,18 +33,18 @@ defined('_JEXEC') or die('Restricted access'); - + canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_toolbar.php b/admin/views/admins_fields_relations/tmpl/default_toolbar.php index 236c32115..cce52d798 100644 --- a/admin/views/admins_fields_relations/tmpl/default_toolbar.php +++ b/admin/views/admins_fields_relations/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/admins_fields_relations/view.html.php b/admin/views/admins_fields_relations/view.html.php index dfcada8ef..06cc45a12 100644 --- a/admin/views/admins_fields_relations/view.html.php +++ b/admin/views/admins_fields_relations/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Admins_fields_relations @@ -35,7 +48,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations'); $this->canEdit = $this->canDo->get('admin_fields_relations.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_relations'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('admin_fields_relations.add'); + ToolbarHelper::addNew('admin_fields_relations.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('admin_fields_relations.edit'); + ToolbarHelper::editList('admin_fields_relations.edit'); } if ($this->canState) { - JToolBarHelper::publishList('admins_fields_relations.publish'); - JToolBarHelper::unpublishList('admins_fields_relations.unpublish'); - JToolBarHelper::archiveList('admins_fields_relations.archive'); + ToolbarHelper::publishList('admins_fields_relations.publish'); + ToolbarHelper::unpublishList('admins_fields_relations.unpublish'); + ToolbarHelper::archiveList('admins_fields_relations.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('admins_fields_relations.checkin'); + ToolbarHelper::checkin('admins_fields_relations.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,34 +142,34 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'admins_fields_relations.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'admins_fields_relations.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('admins_fields_relations.trash'); + ToolbarHelper::trash('admins_fields_relations.trash'); } } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_relations'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -164,9 +177,9 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } } @@ -180,10 +193,10 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_relations.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admins_fields_relations.css", ['version' => 'auto']); } /** @@ -198,23 +211,33 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/class_extendings/tmpl/default.php b/admin/views/class_extendings/tmpl/default.php index 053a616f2..6505c0c6c 100644 --- a/admin/views/class_extendings/tmpl/default.php +++ b/admin/views/class_extendings/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_extendings.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'class_extendsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'class_extendsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,5 +70,5 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/class_extendings/tmpl/default_batch_body.php b/admin/views/class_extendings/tmpl/default_batch_body.php index ed473bd78..58f6322da 100644 --- a/admin/views/class_extendings/tmpl/default_batch_body.php +++ b/admin/views/class_extendings/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_batch_footer.php b/admin/views/class_extendings/tmpl/default_batch_footer.php index abd385711..d99efe2f7 100644 --- a/admin/views/class_extendings/tmpl/default_batch_footer.php +++ b/admin/views/class_extendings/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_body.php b/admin/views/class_extendings/tmpl/default_body.php index b0c9ea780..aa3f3f15c 100644 --- a/admin/views/class_extendings/tmpl/default_body.php +++ b/admin/views/class_extendings/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_extends.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('class_extends',$item,'class_extendings'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_ $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_ get('class_extends.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_ get('class_extends.edit')): ?> escape($item->name); ?> checked_out): ?> - name, $item->checked_out_time, 'class_extendings.', $canCheckin); ?> + name, $item->checked_out_time, 'class_extendings.', $canCheckin); ?> escape($item->name); ?> @@ -70,21 +74,21 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_
- extension_type); ?> + extension_type); ?> get('class_extends.edit.state')) : ?> checked_out) : ?> - published, $i, 'class_extendings.', true, 'cb'); ?> + published, $i, 'class_extendings.', true, 'cb'); ?> - published, $i, 'class_extendings.', false, 'cb'); ?> + published, $i, 'class_extendings.', false, 'cb'); ?> - published, $i, 'class_extendings.', true, 'cb'); ?> + published, $i, 'class_extendings.', true, 'cb'); ?> - published, $i, 'class_extendings.', false, 'cb'); ?> + published, $i, 'class_extendings.', false, 'cb'); ?> diff --git a/admin/views/class_extendings/tmpl/default_head.php b/admin/views/class_extendings/tmpl/default_head.php index 40bee431c..338c01d3f 100644 --- a/admin/views/class_extendings/tmpl/default_head.php +++ b/admin/views/class_extendings/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,21 +33,21 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_toolbar.php b/admin/views/class_extendings/tmpl/default_toolbar.php index 18c6a9ac6..c572fc964 100644 --- a/admin/views/class_extendings/tmpl/default_toolbar.php +++ b/admin/views/class_extendings/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/class_extendings/view.html.php b/admin/views/class_extendings/view.html.php index 3e0582f87..302f48e63 100644 --- a/admin/views/class_extendings/view.html.php +++ b/admin/views/class_extendings/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Class_extendings @@ -35,7 +48,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('class_extends'); $this->canEdit = $this->canDo->get('class_extends.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewClass_extendings extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_extendings'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('class_extends.add'); + ToolbarHelper::addNew('class_extends.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('class_extends.edit'); + ToolbarHelper::editList('class_extends.edit'); } if ($this->canState) { - JToolBarHelper::publishList('class_extendings.publish'); - JToolBarHelper::unpublishList('class_extendings.unpublish'); - JToolBarHelper::archiveList('class_extendings.archive'); + ToolbarHelper::publishList('class_extendings.publish'); + ToolbarHelper::unpublishList('class_extendings.unpublish'); + ToolbarHelper::archiveList('class_extendings.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('class_extendings.checkin'); + ToolbarHelper::checkin('class_extendings.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewClass_extendings extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,34 +142,34 @@ class ComponentbuilderViewClass_extendings extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'class_extendings.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'class_extendings.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('class_extendings.trash'); + ToolbarHelper::trash('class_extendings.trash'); } } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('class_extendings'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -164,9 +177,9 @@ class ComponentbuilderViewClass_extendings extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -174,19 +187,19 @@ class ComponentbuilderViewClass_extendings extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Extension Type Selection - $this->extension_typeOptions = JFormHelper::loadFieldType('classextendingsfilterextensiontype')->options; + $this->extension_typeOptions = FormHelper::loadFieldType('classextendingsfilterextensiontype')->options; // We do some sanitation for Extension Type filter - if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + if (ArrayHelper::check($this->extension_typeOptions) && isset($this->extension_typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + !StringHelper::check($this->extension_typeOptions[0]->value)) { unset($this->extension_typeOptions[0]); } // Extension Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -', 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + Html::_('select.options', $this->extension_typeOptions, 'value', 'text') ); } } @@ -200,10 +213,10 @@ class ComponentbuilderViewClass_extendings extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_extendings.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_extendings.css", ['version' => 'auto']); } /** @@ -218,25 +231,35 @@ class ComponentbuilderViewClass_extendings extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL'), - 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL'), + 'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/class_extends/submitbutton.js b/admin/views/class_extends/submitbutton.js index ca3c27842..926f8a99e 100644 --- a/admin/views/class_extends/submitbutton.js +++ b/admin/views/class_extends/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/class_extends/tmpl/edit.php b/admin/views/class_extends/tmpl/edit.php index dde23d141..d0e41072d 100644 --- a/admin/views/class_extends/tmpl/edit.php +++ b/admin/views/class_extends/tmpl/edit.php @@ -12,76 +12,75 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/class_methods/view.html.php b/admin/views/class_methods/view.html.php index 29c445ee0..8dbb68f70 100644 --- a/admin/views/class_methods/view.html.php +++ b/admin/views/class_methods/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Class_methods @@ -35,7 +48,7 @@ class ComponentbuilderViewClass_methods extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewClass_methods extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('class_method'); $this->canEdit = $this->canDo->get('class_method.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewClass_methods extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewClass_methods extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_METHODS'), 'cube'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_methods'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_METHODS'), 'cube'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('class_method.add'); + ToolbarHelper::addNew('class_method.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('class_method.edit'); + ToolbarHelper::editList('class_method.edit'); } if ($this->canState) { - JToolBarHelper::publishList('class_methods.publish'); - JToolBarHelper::unpublishList('class_methods.unpublish'); - JToolBarHelper::archiveList('class_methods.archive'); + ToolbarHelper::publishList('class_methods.publish'); + ToolbarHelper::unpublishList('class_methods.unpublish'); + ToolbarHelper::archiveList('class_methods.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('class_methods.checkin'); + ToolbarHelper::checkin('class_methods.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,44 +142,44 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'class_methods.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'class_methods.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('class_methods.trash'); + ToolbarHelper::trash('class_methods.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('class_method.export')) { - JToolBarHelper::custom('class_methods.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('class_methods.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('class_method.import')) { - JToolBarHelper::custom('class_methods.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('class_methods.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('class_methods'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -174,9 +187,9 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -184,19 +197,19 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Visibility Selection - $this->visibilityOptions = JFormHelper::loadFieldType('classmethodsfiltervisibility')->options; + $this->visibilityOptions = FormHelper::loadFieldType('classmethodsfiltervisibility')->options; // We do some sanitation for Visibility filter - if (ComponentbuilderHelper::checkArray($this->visibilityOptions) && + if (ArrayHelper::check($this->visibilityOptions) && isset($this->visibilityOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->visibilityOptions[0]->value)) + !StringHelper::check($this->visibilityOptions[0]->value)) { unset($this->visibilityOptions[0]); } // Visibility Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -', 'batch[visibility]', - JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') + Html::_('select.options', $this->visibilityOptions, 'value', 'text') ); } @@ -204,19 +217,19 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Extension Type Selection - $this->extension_typeOptions = JFormHelper::loadFieldType('classmethodsfilterextensiontype')->options; + $this->extension_typeOptions = FormHelper::loadFieldType('classmethodsfilterextensiontype')->options; // We do some sanitation for Extension Type filter - if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + if (ArrayHelper::check($this->extension_typeOptions) && isset($this->extension_typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + !StringHelper::check($this->extension_typeOptions[0]->value)) { unset($this->extension_typeOptions[0]); } // Extension Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -', 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + Html::_('select.options', $this->extension_typeOptions, 'value', 'text') ); } } @@ -230,10 +243,10 @@ class ComponentbuilderViewClass_methods extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_METHODS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_methods.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_METHODS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_methods.css", ['version' => 'auto']); } /** @@ -248,26 +261,36 @@ class ComponentbuilderViewClass_methods extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL'), - 'a.visibility' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL'), - 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL'), + 'a.visibility' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL'), + 'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/class_properties/tmpl/default.php b/admin/views/class_properties/tmpl/default.php index bdc5e8c93..691b8ad00 100644 --- a/admin/views/class_properties/tmpl/default.php +++ b/admin/views/class_properties/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_properties.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'class_propertyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'class_propertyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,5 +70,5 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/class_properties/tmpl/default_batch_body.php b/admin/views/class_properties/tmpl/default_batch_body.php index 9bd922141..3427bbae1 100644 --- a/admin/views/class_properties/tmpl/default_batch_body.php +++ b/admin/views/class_properties/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_batch_footer.php b/admin/views/class_properties/tmpl/default_batch_footer.php index 7243f9707..389db3405 100644 --- a/admin/views/class_properties/tmpl/default_batch_footer.php +++ b/admin/views/class_properties/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_body.php b/admin/views/class_properties/tmpl/default_body.php index 4befb19f3..6bffa38ca 100644 --- a/admin/views/class_properties/tmpl/default_body.php +++ b/admin/views/class_properties/tmpl/default_body.php @@ -11,6 +11,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\Utilities\StringHelper; $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_property.edit"; @@ -19,7 +23,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('class_property',$item,'class_properties'); ?> @@ -29,7 +33,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -47,12 +51,12 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ get('class_property.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -63,7 +67,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ get('class_property.edit')): ?> escape($item->name); ?> checked_out): ?> - name, $item->checked_out_time, 'class_properties.', $canCheckin); ?> + name, $item->checked_out_time, 'class_properties.', $canCheckin); ?> escape($item->name); ?> @@ -71,16 +75,16 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
- visibility); ?> + visibility); ?>
joomla_plugin_group) && StringHelper::check($item->joomla_plugin_group)): ?> - extension_type); ?> : + extension_type); ?> : escape($item->joomla_plugin_group_name); ?> - extension_type); ?> + extension_type); ?>
@@ -88,15 +92,15 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ get('class_property.edit.state')) : ?> checked_out) : ?> - published, $i, 'class_properties.', true, 'cb'); ?> + published, $i, 'class_properties.', true, 'cb'); ?> - published, $i, 'class_properties.', false, 'cb'); ?> + published, $i, 'class_properties.', false, 'cb'); ?> - published, $i, 'class_properties.', true, 'cb'); ?> + published, $i, 'class_properties.', true, 'cb'); ?> - published, $i, 'class_properties.', false, 'cb'); ?> + published, $i, 'class_properties.', false, 'cb'); ?> diff --git a/admin/views/class_properties/tmpl/default_head.php b/admin/views/class_properties/tmpl/default_head.php index 1f74bde03..eb3aff79a 100644 --- a/admin/views/class_properties/tmpl/default_head.php +++ b/admin/views/class_properties/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,24 +33,24 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_toolbar.php b/admin/views/class_properties/tmpl/default_toolbar.php index 5950a1dc2..a8f4988f3 100644 --- a/admin/views/class_properties/tmpl/default_toolbar.php +++ b/admin/views/class_properties/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/class_properties/view.html.php b/admin/views/class_properties/view.html.php index 58201f0e2..feeb4d2ff 100644 --- a/admin/views/class_properties/view.html.php +++ b/admin/views/class_properties/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Class_properties @@ -35,7 +48,7 @@ class ComponentbuilderViewClass_properties extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewClass_properties extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('class_property'); $this->canEdit = $this->canDo->get('class_property.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewClass_properties extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewClass_properties extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'), 'cube'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_properties'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'), 'cube'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('class_property.add'); + ToolbarHelper::addNew('class_property.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('class_property.edit'); + ToolbarHelper::editList('class_property.edit'); } if ($this->canState) { - JToolBarHelper::publishList('class_properties.publish'); - JToolBarHelper::unpublishList('class_properties.unpublish'); - JToolBarHelper::archiveList('class_properties.archive'); + ToolbarHelper::publishList('class_properties.publish'); + ToolbarHelper::unpublishList('class_properties.unpublish'); + ToolbarHelper::archiveList('class_properties.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('class_properties.checkin'); + ToolbarHelper::checkin('class_properties.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,44 +142,44 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'class_properties.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'class_properties.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('class_properties.trash'); + ToolbarHelper::trash('class_properties.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('class_property.export')) { - JToolBarHelper::custom('class_properties.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('class_properties.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('class_property.import')) { - JToolBarHelper::custom('class_properties.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('class_properties.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('class_properties'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -174,9 +187,9 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -184,19 +197,19 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Visibility Selection - $this->visibilityOptions = JFormHelper::loadFieldType('classpropertiesfiltervisibility')->options; + $this->visibilityOptions = FormHelper::loadFieldType('classpropertiesfiltervisibility')->options; // We do some sanitation for Visibility filter - if (ComponentbuilderHelper::checkArray($this->visibilityOptions) && + if (ArrayHelper::check($this->visibilityOptions) && isset($this->visibilityOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->visibilityOptions[0]->value)) + !StringHelper::check($this->visibilityOptions[0]->value)) { unset($this->visibilityOptions[0]); } // Visibility Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -', 'batch[visibility]', - JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') + Html::_('select.options', $this->visibilityOptions, 'value', 'text') ); } @@ -204,19 +217,19 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Extension Type Selection - $this->extension_typeOptions = JFormHelper::loadFieldType('classpropertiesfilterextensiontype')->options; + $this->extension_typeOptions = FormHelper::loadFieldType('classpropertiesfilterextensiontype')->options; // We do some sanitation for Extension Type filter - if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + if (ArrayHelper::check($this->extension_typeOptions) && isset($this->extension_typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + !StringHelper::check($this->extension_typeOptions[0]->value)) { unset($this->extension_typeOptions[0]); } // Extension Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -', 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + Html::_('select.options', $this->extension_typeOptions, 'value', 'text') ); } } @@ -230,10 +243,10 @@ class ComponentbuilderViewClass_properties extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_properties.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_properties.css", ['version' => 'auto']); } /** @@ -248,26 +261,36 @@ class ComponentbuilderViewClass_properties extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL'), - 'a.visibility' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL'), - 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL'), + 'a.visibility' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL'), + 'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/class_property/submitbutton.js b/admin/views/class_property/submitbutton.js index 58f528b96..dcae3cc66 100644 --- a/admin/views/class_property/submitbutton.js +++ b/admin/views/class_property/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/class_property/tmpl/edit.php b/admin/views/class_property/tmpl/edit.php index 4873e8cb2..99a8d537d 100644 --- a/admin/views/class_property/tmpl/edit.php +++ b/admin/views/class_property/tmpl/edit.php @@ -12,71 +12,70 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> -
-

+

-
+
form): ?> form->renderFieldset('builder'); ?> @@ -147,7 +160,7 @@ jQuery('
')
@@ -156,75 +169,83 @@ jQuery('
')
form->renderFieldset('advanced'); ?>
- 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?> + 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?>
- +
-

+

diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 2a47eff3e..864e7f531 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -12,10 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Form\Form; +use Joomla\CMS\Layout\LayoutHelper; use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\FormHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Compiler @@ -26,11 +36,11 @@ class ComponentbuilderViewCompiler extends HtmlView function display($tpl = null) { // get component params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // get the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('compiler'); // Initialise variables. @@ -102,15 +112,15 @@ class ComponentbuilderViewCompiler extends HtmlView // Check for errors. if (count($errors = $this->get('Errors'))) { - throw new Exception(implode(PHP_EOL, $errors), 500); + throw new \Exception(implode(PHP_EOL, $errors), 500); } parent::display($tpl); } // These are subform layouts used in JCB - // JLayoutHelper::render('sectionjcb', [?]); // added to ensure the layout are loaded - // JLayoutHelper::render('repeatablejcb', [?]); // added to ensure the layout are loaded + // LayoutHelper::render('sectionjcb', [?]); // added to ensure the layout are loaded + // LayoutHelper::render('repeatablejcb', [?]); // added to ensure the layout are loaded /** * Get the dynamic build form fields needed on the page @@ -147,7 +157,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -167,7 +177,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -188,7 +198,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -208,7 +218,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -228,7 +238,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -248,7 +258,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -272,7 +282,58 @@ class ComponentbuilderViewCompiler extends HtmlView } // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Joomla Versions attributes + $attributes = [ + 'type' => 'list', + 'name' => 'joomla_version', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_VERSION', + 'class' => 'list_class', + 'description' => 'COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET', + 'default' => '3']; + // start the joomla versions options + $options = [ + '3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE', + '4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR_AND_FIVE' + ]; + + // add to form + $xml = FormHelper::xml($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Joomla Version 3 attributes + $attributes = [ + 'type' => 'note', + 'name' => 'joomla_version_note_three', + 'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE', + 'class' => 'alert alert-success', + 'showon' => 'joomla_version:3']; + + // add to form + $xml = FormHelper::xml($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Joomla Version 4 and five attributes + $attributes = [ + 'type' => 'note', + 'name' => 'joomla_version_note_four_five', + 'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR_AND_JOOMLA_FIVE', + 'class' => 'alert alert-success', + 'showon' => 'joomla_version:4']; + + // add to form + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -292,7 +353,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -307,58 +368,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); - if ($xml instanceof SimpleXMLElement) - { - $form->setField($xml, null, true, 'advanced'); - } - - // Joomla Versions attributes - $attributes = [ - 'type' => 'radio', - 'name' => 'joomla_version_donations', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_VERSION', - 'class' => 'btn-group btn-group-yesno', - 'description' => 'COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET', - 'default' => '3', - 'showon' => 'show_advanced_options:1']; - // start the joomla versions options - $options = [ - '3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE', - '4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR']; - - // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); - if ($xml instanceof SimpleXMLElement) - { - $form->setField($xml, null, true, 'advanced'); - } - - // Joomla Version 3 attributes - $attributes = [ - 'type' => 'note', - 'name' => 'joomla_version_note_three', - 'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE', - 'class' => 'alert alert-success', - 'showon' => 'show_advanced_options:1[AND]joomla_version_donations:3']; - - // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); - if ($xml instanceof SimpleXMLElement) - { - $form->setField($xml, null, true, 'advanced'); - } - - // Joomla Version 4 attributes - $attributes = [ - 'type' => 'note', - 'name' => 'joomla_version_note_four', - 'description' => 'COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB', - 'class' => 'alert alert-info', - 'showon' => 'show_advanced_options:1[AND]joomla_version_donations:4']; - - // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -380,7 +390,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -397,7 +407,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1[AND]powers_repository:1']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -420,7 +430,7 @@ class ComponentbuilderViewCompiler extends HtmlView '4' => 'COM_COMPONENTBUILDER_FOUR_SPACES']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -442,7 +452,7 @@ class ComponentbuilderViewCompiler extends HtmlView '3' => 'COM_COMPONENTBUILDER_COMPONENT']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -457,7 +467,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1[AND]add_build_date:2']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -472,7 +482,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1[AND]add_build_date:3']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -490,7 +500,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1[AND]add_build_date:2']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -507,7 +517,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -521,7 +531,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -543,7 +553,7 @@ class ComponentbuilderViewCompiler extends HtmlView */ protected function getSupportMessage(): string { - return JLayoutHelper::render('jcbsupportmessage', []); + return LayoutHelper::render('jcbsupportmessage', []); } @@ -556,12 +566,12 @@ class ComponentbuilderViewCompiler extends HtmlView // Only load jQuery if needed. (default is true) if ($this->params->get('add_jquery_framework', 1) == 1) { - JHtml::_('jquery.framework'); + Html::_('jquery.framework'); } // Load the header checker class. require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' ); // Initialize the header checker. - $HeaderCheck = new componentbuilderHeaderCheck; + $HeaderCheck = new componentbuilderHeaderCheck(); // Load uikit options. $uikit = $this->params->get('uikit_load'); @@ -573,26 +583,26 @@ class ComponentbuilderViewCompiler extends HtmlView // 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']); + Html::_('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']); + Html::_('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 = []; $uikitComp[] = 'data-uk-grid'; // Get field uikit components needed in this view. $uikitFieldComp = $this->get('UikitComp'); - if (isset($uikitFieldComp) && ComponentbuilderHelper::checkArray($uikitFieldComp)) + if (isset($uikitFieldComp) && ArrayHelper::check($uikitFieldComp)) { - if (isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp)) + if (isset($uikitComp) && ArrayHelper::check($uikitComp)) { $uikitComp = array_merge($uikitComp, $uikitFieldComp); $uikitComp = array_unique($uikitComp); @@ -605,10 +615,8 @@ class ComponentbuilderViewCompiler extends HtmlView } // Load the needed uikit components in this view. - if ($uikit != 2 && isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp)) + if ($uikit != 2 && isset($uikitComp) && ArrayHelper::check($uikitComp)) { - // load just in case. - jimport('joomla.filesystem.file'); // loading... foreach ($uikitComp as $class) { @@ -618,95 +626,108 @@ class ComponentbuilderViewCompiler extends HtmlView 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']); + Html::_('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']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']); } } } } // add marked library - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/custom/marked.js"); + Html::_('script', 'administrator/components/com_componentbuilder/custom/marked.js', ['version' => 'auto']); // add the document default css file - JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/compiler.css', ['version' => 'auto']); + Html::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/compiler.css', ['version' => 'auto']); // Set the Custom JS script to view $this->document->addScriptDeclaration(" - function getComponentDetails_server(id){ - var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json&raw=true\"); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id; + function getComponentDetails_server(id) { + let getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json&raw=true\"); + let request = new URLSearchParams(); + if (token.length > 0 && id > 0) { + request.append(token, '1'); + request.append('id', id); } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false - }); + return fetch(getUrl + '&' + request.toString(), { + method: 'GET', + headers: { + 'Accept': 'application/json' + } + }).then(response => response.json()); } function getComponentDetails(id) { - getComponentDetails_server(id).done(function(result) { - if(result.html) { - jQuery('#component-details').html(result.html); + getComponentDetails_server(id).then(function(result) { + if (result.html) { + document.getElementById('component-details').innerHTML = result.html; } }); } - var noticeboard = \"https://vdm.bz/componentbuilder-noticeboard-md\"; - var proboard = \"https://vdm.bz/componentbuilder-pro-noticeboard-md\"; - jQuery(document).ready(function () { - jQuery.get(noticeboard) - .success(function(board) { - if (board.length > 5) { - jQuery(\".noticeboard-md\").html(marked.parse(board)); - getIS(1,board).done(function(result) { - if (result){ - jQuery(\".vdm-new-notice\").show(); - getIS(2,board); - } - }); - } else { - jQuery(\".noticeboard-md\").html(all_is_good); - } - }) - .error(function(jqXHR, textStatus, errorThrown) { - jQuery(\".noticeboard-md\").html(all_is_good); - }); - jQuery.get(proboard) - .success(function(board) { - if (board.length > 5) { - jQuery(\".proboard-md\").html(marked.parse(board)); - } else { - jQuery(\".proboard-md\").html(all_is_good); - } - }) - .error(function(jqXHR, textStatus, errorThrown) { - jQuery(\".proboard-md\").html(all_is_good); - }); + document.addEventListener('DOMContentLoaded', function() { + fetchNoticeboard(\"https://vdm.bz/componentbuilder-noticeboard-md\", \".noticeboard-md\", true); + fetchNoticeboard(\"https://vdm.bz/componentbuilder-pro-noticeboard-md\", \".proboard-md\", false); }); - // to check is READ/NEW - function getIS(type,notice){ - if (type == 1) { - var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true\"); - } else if (type == 2) { - var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true\"); - } - if(token.length > 0 && notice.length){ - var request = token+\"=1¬ice=\"+notice; - } - return jQuery.ajax({ - type: \"POST\", - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + function fetchNoticeboard(url, selector, processGetIS) { + fetch(url) + .then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.text(); + }) + .then(board => { + var elements = document.querySelectorAll(selector); + if (board.length > 5) { + let html_board = marked.parse(board); + elements.forEach(element => { + element.innerHTML = html_board; + }); + if (processGetIS) { + getIS(1, board).then(result => { + if (result) { + document.querySelectorAll(\".vdm-new-notice\").forEach(element => { + element.style.display = 'block'; + }); + getIS(2, board); + } + }); + } + } else { + elements.forEach(element => { + element.innerHTML = all_is_good; + }); + } + }) + .catch(error => { + console.error('There was an error!', error); + document.querySelectorAll(selector).forEach(element => { + element.innerHTML = all_is_good; + }); }); } - + // to check is READ/NEW + function getIS(type, notice) { + let getUrl = \"\"; + if (type === 1) { + getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true\"); + } else if (type === 2) { + getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true\"); + } + let request = new URLSearchParams(); + if (token.length > 0 && notice.length) { + request.append(token, \"1\"); + request.append(\"notice\", notice); + } + return fetch(getUrl, { + method: \"POST\", + headers: { + \"Content-Type\": \"application/x-www-form-urlencoded;charset=UTF-8\" + }, + body: request + }).then(response => response.json()); + } "); } @@ -718,41 +739,41 @@ class ComponentbuilderViewCompiler extends HtmlView // hide the main menu $this->app->input->set('hidemainmenu', true); // add title to the page - JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPILER'),'cogs'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_COMPILER'),'cogs'); // add cpanel button - JToolBarHelper::custom('compiler.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); + ToolbarHelper::custom('compiler.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); if ($this->canDo->get('compiler.run_expansion')) { // add Run Expansion button. - JToolBarHelper::custom('compiler.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('compiler.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('compiler.translate')) { // add Translate button. - JToolBarHelper::custom('compiler.runTranslator', 'comments-2 custom-button-runtranslator', '', 'COM_COMPONENTBUILDER_TRANSLATE', false); + ToolbarHelper::custom('compiler.runTranslator', 'comments-2 custom-button-runtranslator', '', 'COM_COMPONENTBUILDER_TRANSLATE', false); } if ($this->canDo->get('compiler.compiler_animations')) { // add Compiler Animations button. - JToolBarHelper::custom('compiler.getDynamicContent', 'download custom-button-getdynamiccontent', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false); + ToolbarHelper::custom('compiler.getDynamicContent', 'download custom-button-getdynamiccontent', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false); } if ($this->canDo->get('compiler.clear_tmp')) { // add Clear tmp button. - JToolBarHelper::custom('compiler.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); + ToolbarHelper::custom('compiler.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('compiler'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } } @@ -766,6 +787,16 @@ class ComponentbuilderViewCompiler extends HtmlView public function escape($var) { // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/component_admin_views/submitbutton.js b/admin/views/component_admin_views/submitbutton.js index 0f2245f95..33e198caa 100644 --- a/admin/views/component_admin_views/submitbutton.js +++ b/admin/views/component_admin_views/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/component_admin_views/tmpl/edit.php b/admin/views/component_admin_views/tmpl/edit.php index a2656f508..6950c9849 100644 --- a/admin/views/component_admin_views/tmpl/edit.php +++ b/admin/views/component_admin_views/tmpl/edit.php @@ -12,79 +12,78 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index 4c9274739..edf40602c 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Custom_codes @@ -35,7 +48,7 @@ class ComponentbuilderViewCustom_codes extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewCustom_codes extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('custom_code'); $this->canEdit = $this->canDo->get('custom_code.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewCustom_codes extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewCustom_codes extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CUSTOM_CODES'), 'shuffle'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=custom_codes'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CUSTOM_CODES'), 'shuffle'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('custom_code.add'); + ToolbarHelper::addNew('custom_code.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('custom_code.edit'); + ToolbarHelper::editList('custom_code.edit'); } if ($this->canState) { - JToolBarHelper::publishList('custom_codes.publish'); - JToolBarHelper::unpublishList('custom_codes.unpublish'); - JToolBarHelper::archiveList('custom_codes.archive'); + ToolbarHelper::publishList('custom_codes.publish'); + ToolbarHelper::unpublishList('custom_codes.unpublish'); + ToolbarHelper::archiveList('custom_codes.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('custom_codes.checkin'); + ToolbarHelper::checkin('custom_codes.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,49 +142,49 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'custom_codes.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'custom_codes.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('custom_codes.trash'); + ToolbarHelper::trash('custom_codes.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('custom_code.export')) { - JToolBarHelper::custom('custom_codes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('custom_codes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('custom_code.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('custom_codes.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('custom_codes.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('custom_code.import')) { - JToolBarHelper::custom('custom_codes.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('custom_codes.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('custom_codes'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -179,9 +192,9 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -189,19 +202,19 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Component System Name Selection - $this->componentSystem_nameOptions = JFormHelper::loadFieldType('Joomlacomponent')->options; + $this->componentSystem_nameOptions = FormHelper::loadFieldType('Joomlacomponent')->options; // We do some sanitation for Component System Name filter - if (ComponentbuilderHelper::checkArray($this->componentSystem_nameOptions) && + if (ArrayHelper::check($this->componentSystem_nameOptions) && isset($this->componentSystem_nameOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->componentSystem_nameOptions[0]->value)) + !StringHelper::check($this->componentSystem_nameOptions[0]->value)) { unset($this->componentSystem_nameOptions[0]); } // Component System Name Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL').' -', 'batch[component]', - JHtml::_('select.options', $this->componentSystem_nameOptions, 'value', 'text') + Html::_('select.options', $this->componentSystem_nameOptions, 'value', 'text') ); } @@ -209,19 +222,19 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Target Selection - $this->targetOptions = JFormHelper::loadFieldType('customcodesfiltertarget')->options; + $this->targetOptions = FormHelper::loadFieldType('customcodesfiltertarget')->options; // We do some sanitation for Target filter - if (ComponentbuilderHelper::checkArray($this->targetOptions) && + if (ArrayHelper::check($this->targetOptions) && isset($this->targetOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->targetOptions[0]->value)) + !StringHelper::check($this->targetOptions[0]->value)) { unset($this->targetOptions[0]); } // Target Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL').' -', 'batch[target]', - JHtml::_('select.options', $this->targetOptions, 'value', 'text') + Html::_('select.options', $this->targetOptions, 'value', 'text') ); } @@ -229,19 +242,19 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Type Selection - $this->typeOptions = JFormHelper::loadFieldType('customcodesfiltertype')->options; + $this->typeOptions = FormHelper::loadFieldType('customcodesfiltertype')->options; // We do some sanitation for Type filter - if (ComponentbuilderHelper::checkArray($this->typeOptions) && + if (ArrayHelper::check($this->typeOptions) && isset($this->typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + !StringHelper::check($this->typeOptions[0]->value)) { unset($this->typeOptions[0]); } // Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL').' -', 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') + Html::_('select.options', $this->typeOptions, 'value', 'text') ); } @@ -249,19 +262,19 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Comment Type Selection - $this->comment_typeOptions = JFormHelper::loadFieldType('customcodesfiltercommenttype')->options; + $this->comment_typeOptions = FormHelper::loadFieldType('customcodesfiltercommenttype')->options; // We do some sanitation for Comment Type filter - if (ComponentbuilderHelper::checkArray($this->comment_typeOptions) && + if (ArrayHelper::check($this->comment_typeOptions) && isset($this->comment_typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->comment_typeOptions[0]->value)) + !StringHelper::check($this->comment_typeOptions[0]->value)) { unset($this->comment_typeOptions[0]); } // Comment Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', 'batch[comment_type]', - JHtml::_('select.options', $this->comment_typeOptions, 'value', 'text') + Html::_('select.options', $this->comment_typeOptions, 'value', 'text') ); } } @@ -275,10 +288,10 @@ class ComponentbuilderViewCustom_codes extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CUSTOM_CODES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/custom_codes.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CUSTOM_CODES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/custom_codes.css", ['version' => 'auto']); } /** @@ -293,28 +306,39 @@ class ComponentbuilderViewCustom_codes extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'g.system_name' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL'), - 'a.path' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_PATH_LABEL'), - 'a.target' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL'), - 'a.type' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL'), - 'a.comment_type' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'g.system_name' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL'), + 'a.path' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_PATH_LABEL'), + 'a.target' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL'), + 'a.type' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL'), + 'a.comment_type' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL'), + 'a.joomla_version' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_JOOMLA_VERSION_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/dynamic_get/submitbutton.js b/admin/views/dynamic_get/submitbutton.js index 526acadac..5bae7f879 100644 --- a/admin/views/dynamic_get/submitbutton.js +++ b/admin/views/dynamic_get/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/dynamic_get/tmpl/edit.php b/admin/views/dynamic_get/tmpl/edit.php index 2077be177..c4941e710 100644 --- a/admin/views/dynamic_get/tmpl/edit.php +++ b/admin/views/dynamic_get/tmpl/edit.php @@ -12,120 +12,119 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -683,13 +682,13 @@ jQuery('#adminForm').on('change', '#jform_select_all',function (e) }); function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { @@ -699,16 +698,18 @@ function JRouter(link) { return url+link; } -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); diff --git a/admin/views/dynamic_get/view.html.php b/admin/views/dynamic_get/view.html.php index 8fc0761fc..177d93740 100644 --- a/admin/views/dynamic_get/view.html.php +++ b/admin/views/dynamic_get/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Dynamic_get Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewDynamic_get extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewDynamic_get extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('dynamic_get', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewDynamic_get extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewDynamic_get extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('dynamic_get.create') && $isNew) { // We can create the record. - JToolBarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('dynamic_get.edit')) { // We can save the record. - JToolBarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewDynamic_get extends HtmlView // For new records, check the create permission. if ($this->canDo->get('dynamic_get.create')) { - JToolBarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('dynamic_get.edit')) { // We can save the new record - JToolBarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('dynamic_get.create')) { - JToolBarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('dynamic_get.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('dynamic_get.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.dynamic_get', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.dynamic_get', $this->item->id); } if ($this->canDo->get('dynamic_get.create')) { - JToolBarHelper::custom('dynamic_get.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('dynamic_get.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('dynamic_get'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewDynamic_get extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,32 +196,38 @@ class ComponentbuilderViewDynamic_get extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/dynamic_get.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/dynamic_get.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/dynamic_get/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/dynamic_get/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); - JText::script('view not acceptable. Error'); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/dynamic_gets/tmpl/default.php b/admin/views/dynamic_gets/tmpl/default.php index 6bfab7288..7a760d1b6 100644 --- a/admin/views/dynamic_gets/tmpl/default.php +++ b/admin/views/dynamic_gets/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=dynamic_gets.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'dynamic_getList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'dynamic_getList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_DYNAMIC_GETS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_DYNAMIC_GETS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,27 +70,34 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/dynamic_gets/tmpl/default_batch_body.php b/admin/views/dynamic_gets/tmpl/default_batch_body.php index c3faa117c..c68e005c9 100644 --- a/admin/views/dynamic_gets/tmpl/default_batch_body.php +++ b/admin/views/dynamic_gets/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/dynamic_gets/tmpl/default_batch_footer.php b/admin/views/dynamic_gets/tmpl/default_batch_footer.php index 06f13551e..50bbc6789 100644 --- a/admin/views/dynamic_gets/tmpl/default_batch_footer.php +++ b/admin/views/dynamic_gets/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/dynamic_gets/tmpl/default_body.php b/admin/views/dynamic_gets/tmpl/default_body.php index 5f040a3d0..54a5a65d1 100644 --- a/admin/views/dynamic_gets/tmpl/default_body.php +++ b/admin/views/dynamic_gets/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('dynamic_get',$item,'dynamic_gets'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge get('dynamic_get.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge get('dynamic_get.edit')): ?> escape($item->name); ?> checked_out): ?> - name, $item->checked_out_time, 'dynamic_gets.', $canCheckin); ?> + name, $item->checked_out_time, 'dynamic_gets.', $canCheckin); ?> escape($item->name); ?> @@ -70,24 +74,24 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge
- main_source); ?> + main_source); ?> - gettype); ?> + gettype); ?> get('dynamic_get.edit.state')) : ?> checked_out) : ?> - published, $i, 'dynamic_gets.', true, 'cb'); ?> + published, $i, 'dynamic_gets.', true, 'cb'); ?> - published, $i, 'dynamic_gets.', false, 'cb'); ?> + published, $i, 'dynamic_gets.', false, 'cb'); ?> - published, $i, 'dynamic_gets.', true, 'cb'); ?> + published, $i, 'dynamic_gets.', true, 'cb'); ?> - published, $i, 'dynamic_gets.', false, 'cb'); ?> + published, $i, 'dynamic_gets.', false, 'cb'); ?> diff --git a/admin/views/dynamic_gets/tmpl/default_head.php b/admin/views/dynamic_gets/tmpl/default_head.php index b93c46469..c8c643dea 100644 --- a/admin/views/dynamic_gets/tmpl/default_head.php +++ b/admin/views/dynamic_gets/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,24 +33,24 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/dynamic_gets/tmpl/default_toolbar.php b/admin/views/dynamic_gets/tmpl/default_toolbar.php index 6035becc9..a678ad682 100644 --- a/admin/views/dynamic_gets/tmpl/default_toolbar.php +++ b/admin/views/dynamic_gets/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/dynamic_gets/view.html.php b/admin/views/dynamic_gets/view.html.php index c6c300e2d..2a25bad1c 100644 --- a/admin/views/dynamic_gets/view.html.php +++ b/admin/views/dynamic_gets/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Dynamic_gets @@ -35,7 +48,7 @@ class ComponentbuilderViewDynamic_gets extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewDynamic_gets extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('dynamic_get'); $this->canEdit = $this->canDo->get('dynamic_get.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewDynamic_gets extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewDynamic_gets extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_DYNAMIC_GETS'), 'database'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=dynamic_gets'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_DYNAMIC_GETS'), 'database'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('dynamic_get.add'); + ToolbarHelper::addNew('dynamic_get.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('dynamic_get.edit'); + ToolbarHelper::editList('dynamic_get.edit'); } if ($this->canState) { - JToolBarHelper::publishList('dynamic_gets.publish'); - JToolBarHelper::unpublishList('dynamic_gets.unpublish'); - JToolBarHelper::archiveList('dynamic_gets.archive'); + ToolbarHelper::publishList('dynamic_gets.publish'); + ToolbarHelper::unpublishList('dynamic_gets.unpublish'); + ToolbarHelper::archiveList('dynamic_gets.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('dynamic_gets.checkin'); + ToolbarHelper::checkin('dynamic_gets.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,49 +142,49 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'dynamic_gets.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'dynamic_gets.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('dynamic_gets.trash'); + ToolbarHelper::trash('dynamic_gets.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('dynamic_get.export')) { - JToolBarHelper::custom('dynamic_gets.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('dynamic_gets.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('dynamic_get.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('dynamic_gets.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('dynamic_gets.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('dynamic_get.import')) { - JToolBarHelper::custom('dynamic_gets.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('dynamic_gets.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('dynamic_gets'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -179,9 +192,9 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -189,19 +202,19 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Main Source Selection - $this->main_sourceOptions = JFormHelper::loadFieldType('dynamicgetsfiltermainsource')->options; + $this->main_sourceOptions = FormHelper::loadFieldType('dynamicgetsfiltermainsource')->options; // We do some sanitation for Main Source filter - if (ComponentbuilderHelper::checkArray($this->main_sourceOptions) && + if (ArrayHelper::check($this->main_sourceOptions) && isset($this->main_sourceOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->main_sourceOptions[0]->value)) + !StringHelper::check($this->main_sourceOptions[0]->value)) { unset($this->main_sourceOptions[0]); } // Main Source Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL').' -', 'batch[main_source]', - JHtml::_('select.options', $this->main_sourceOptions, 'value', 'text') + Html::_('select.options', $this->main_sourceOptions, 'value', 'text') ); } @@ -209,19 +222,19 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Gettype Selection - $this->gettypeOptions = JFormHelper::loadFieldType('dynamicgetsfiltergettype')->options; + $this->gettypeOptions = FormHelper::loadFieldType('dynamicgetsfiltergettype')->options; // We do some sanitation for Gettype filter - if (ComponentbuilderHelper::checkArray($this->gettypeOptions) && + if (ArrayHelper::check($this->gettypeOptions) && isset($this->gettypeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->gettypeOptions[0]->value)) + !StringHelper::check($this->gettypeOptions[0]->value)) { unset($this->gettypeOptions[0]); } // Gettype Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL').' -', 'batch[gettype]', - JHtml::_('select.options', $this->gettypeOptions, 'value', 'text') + Html::_('select.options', $this->gettypeOptions, 'value', 'text') ); } } @@ -235,10 +248,10 @@ class ComponentbuilderViewDynamic_gets extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_DYNAMIC_GETS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/dynamic_gets.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_DYNAMIC_GETS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/dynamic_gets.css", ['version' => 'auto']); } /** @@ -253,26 +266,36 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_NAME_LABEL'), - 'a.main_source' => JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL'), - 'a.gettype' => JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_NAME_LABEL'), + 'a.main_source' => Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL'), + 'a.gettype' => Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/field/submitbutton.js b/admin/views/field/submitbutton.js index f161b448b..555c1ba80 100644 --- a/admin/views/field/submitbutton.js +++ b/admin/views/field/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/field/tmpl/edit.php b/admin/views/field/tmpl/edit.php index 9f721a707..bd91ed5d4 100644 --- a/admin/views/field/tmpl/edit.php +++ b/admin/views/field/tmpl/edit.php @@ -12,108 +12,107 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -359,13 +358,13 @@ jQuery('#adminForm').on('change', '#jform_fieldtype',function (e) { function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { @@ -375,16 +374,18 @@ function JRouter(link) { return url+link; } -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); diff --git a/admin/views/field/view.html.php b/admin/views/field/view.html.php index 0804fecc5..012e66f65 100644 --- a/admin/views/field/view.html.php +++ b/admin/views/field/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Field Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewField extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewField extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('field', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewField extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewField extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('field.create') && $isNew) { // We can create the record. - JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('field.edit')) { // We can save the record. - JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewField extends HtmlView // For new records, check the create permission. if ($this->canDo->get('field.create')) { - JToolBarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('field.edit')) { // We can save the new record - JToolBarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('field.create')) { - JToolBarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('field.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('field.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.field', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.field', $this->item->id); } if ($this->canDo->get('field.create')) { - JToolBarHelper::custom('field.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('field.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('field'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewField extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,41 +196,47 @@ class ComponentbuilderViewField extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/field.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/field.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/field/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/field/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); // add the libs for subform (since not adding it via xml but ajax) - JHtml::_('jquery.ui', array('core', 'sortable')); - JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); + Html::_('jquery.ui', array('core', 'sortable')); + Html::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); // set some lang - JText::script('COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER'); - JText::script('COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS'); - JText::script('COM_COMPONENTBUILDER_NO_RESULTS_MATCH'); - JText::script('COM_COMPONENTBUILDER_SELECT_A_PROPERTY'); - JText::script('COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND'); - JText::script('view not acceptable. Error'); + Text::script('COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER'); + Text::script('COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS'); + Text::script('COM_COMPONENTBUILDER_NO_RESULTS_MATCH'); + Text::script('COM_COMPONENTBUILDER_SELECT_A_PROPERTY'); + Text::script('COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND'); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/fields/tmpl/default.php b/admin/views/fields/tmpl/default.php index ecc7a3d78..90a44ac31 100644 --- a/admin/views/fields/tmpl/default.php +++ b/admin/views/fields/tmpl/default.php @@ -12,18 +12,25 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleCategories', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_FIELDS_CATEGORIES') . ' -')); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleCategories', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_FIELDS_CATEGORIES') . ' -']); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=fields.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'fieldList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'fieldList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -34,13 +41,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -50,11 +57,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_FIELDS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_FIELDS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -64,27 +71,34 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/fields/tmpl/default_batch_body.php b/admin/views/fields/tmpl/default_batch_body.php index 48f0df1af..6393a0f5f 100644 --- a/admin/views/fields/tmpl/default_batch_body.php +++ b/admin/views/fields/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/fields/tmpl/default_batch_footer.php b/admin/views/fields/tmpl/default_batch_footer.php index 3c00bc099..407c6c742 100644 --- a/admin/views/fields/tmpl/default_batch_footer.php +++ b/admin/views/fields/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/fields/tmpl/default_body.php b/admin/views/fields/tmpl/default_body.php index 9d677174f..cfae9cbe9 100644 --- a/admin/views/fields/tmpl/default_body.php +++ b/admin/views/fields/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('field',$item,'fields'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; get('field.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; get('field.edit')): ?> escape($item->name); ?> checked_out): ?> - name, $item->checked_out_time, 'fields.', $canCheckin); ?> + name, $item->checked_out_time, 'fields.', $canCheckin); ?> escape($item->name); ?> @@ -79,16 +83,16 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; - datatype); ?> + datatype); ?> - indexes); ?> + indexes); ?> - null_switch); ?> + null_switch); ?> - store); ?> + store); ?>
@@ -103,15 +107,15 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; get('field.edit.state')) : ?> checked_out) : ?> - published, $i, 'fields.', true, 'cb'); ?> + published, $i, 'fields.', true, 'cb'); ?> - published, $i, 'fields.', false, 'cb'); ?> + published, $i, 'fields.', false, 'cb'); ?> - published, $i, 'fields.', true, 'cb'); ?> + published, $i, 'fields.', true, 'cb'); ?> - published, $i, 'fields.', false, 'cb'); ?> + published, $i, 'fields.', false, 'cb'); ?> diff --git a/admin/views/fields/tmpl/default_head.php b/admin/views/fields/tmpl/default_head.php index a15b460ef..ea7a8aa50 100644 --- a/admin/views/fields/tmpl/default_head.php +++ b/admin/views/fields/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,36 +33,36 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/fields/tmpl/default_toolbar.php b/admin/views/fields/tmpl/default_toolbar.php index 3d08c5650..cc0aff7c9 100644 --- a/admin/views/fields/tmpl/default_toolbar.php +++ b/admin/views/fields/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/fields/view.html.php b/admin/views/fields/view.html.php index e37e8b641..26f232d31 100644 --- a/admin/views/fields/view.html.php +++ b/admin/views/fields/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Fields @@ -35,7 +48,7 @@ class ComponentbuilderViewFields extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewFields extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('field'); $this->canEdit = $this->canDo->get('field.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewFields extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewFields extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_FIELDS'), 'lamp'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=fields'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_FIELDS'), 'lamp'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('field.add'); + ToolbarHelper::addNew('field.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('field.edit'); + ToolbarHelper::editList('field.edit'); } if ($this->canState) { - JToolBarHelper::publishList('fields.publish'); - JToolBarHelper::unpublishList('fields.unpublish'); - JToolBarHelper::archiveList('fields.archive'); + ToolbarHelper::publishList('fields.publish'); + ToolbarHelper::unpublishList('fields.unpublish'); + ToolbarHelper::archiveList('fields.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('fields.checkin'); + ToolbarHelper::checkin('fields.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,49 +142,49 @@ class ComponentbuilderViewFields extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'fields.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'fields.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('fields.trash'); + ToolbarHelper::trash('fields.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('field.export')) { - JToolBarHelper::custom('fields.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('fields.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('field.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('fields.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('fields.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('field.import')) { - JToolBarHelper::custom('fields.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('fields.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('fields'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -179,9 +192,9 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -189,9 +202,9 @@ class ComponentbuilderViewFields extends HtmlView { // Category Batch selection. JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), 'batch[category]', - JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.field'), 'value', 'text') + Html::_('select.options', Html::_('category.options', 'com_componentbuilder.field'), 'value', 'text') ); } @@ -199,19 +212,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Fieldtype Name Selection - $this->fieldtypeNameOptions = JFormHelper::loadFieldType('Fieldtypes')->options; + $this->fieldtypeNameOptions = FormHelper::loadFieldType('Fieldtypes')->options; // We do some sanitation for Fieldtype Name filter - if (ComponentbuilderHelper::checkArray($this->fieldtypeNameOptions) && + if (ArrayHelper::check($this->fieldtypeNameOptions) && isset($this->fieldtypeNameOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->fieldtypeNameOptions[0]->value)) + !StringHelper::check($this->fieldtypeNameOptions[0]->value)) { unset($this->fieldtypeNameOptions[0]); } // Fieldtype Name Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL').' -', 'batch[fieldtype]', - JHtml::_('select.options', $this->fieldtypeNameOptions, 'value', 'text') + Html::_('select.options', $this->fieldtypeNameOptions, 'value', 'text') ); } @@ -219,19 +232,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Datatype Selection - $this->datatypeOptions = JFormHelper::loadFieldType('fieldsfilterdatatype')->options; + $this->datatypeOptions = FormHelper::loadFieldType('fieldsfilterdatatype')->options; // We do some sanitation for Datatype filter - if (ComponentbuilderHelper::checkArray($this->datatypeOptions) && + if (ArrayHelper::check($this->datatypeOptions) && isset($this->datatypeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->datatypeOptions[0]->value)) + !StringHelper::check($this->datatypeOptions[0]->value)) { unset($this->datatypeOptions[0]); } // Datatype Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL').' -', 'batch[datatype]', - JHtml::_('select.options', $this->datatypeOptions, 'value', 'text') + Html::_('select.options', $this->datatypeOptions, 'value', 'text') ); } @@ -239,19 +252,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Indexes Selection - $this->indexesOptions = JFormHelper::loadFieldType('fieldsfilterindexes')->options; + $this->indexesOptions = FormHelper::loadFieldType('fieldsfilterindexes')->options; // We do some sanitation for Indexes filter - if (ComponentbuilderHelper::checkArray($this->indexesOptions) && + if (ArrayHelper::check($this->indexesOptions) && isset($this->indexesOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->indexesOptions[0]->value)) + !StringHelper::check($this->indexesOptions[0]->value)) { unset($this->indexesOptions[0]); } // Indexes Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL').' -', 'batch[indexes]', - JHtml::_('select.options', $this->indexesOptions, 'value', 'text') + Html::_('select.options', $this->indexesOptions, 'value', 'text') ); } @@ -259,19 +272,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Null Switch Selection - $this->null_switchOptions = JFormHelper::loadFieldType('fieldsfilternullswitch')->options; + $this->null_switchOptions = FormHelper::loadFieldType('fieldsfilternullswitch')->options; // We do some sanitation for Null Switch filter - if (ComponentbuilderHelper::checkArray($this->null_switchOptions) && + if (ArrayHelper::check($this->null_switchOptions) && isset($this->null_switchOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->null_switchOptions[0]->value)) + !StringHelper::check($this->null_switchOptions[0]->value)) { unset($this->null_switchOptions[0]); } // Null Switch Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL').' -', 'batch[null_switch]', - JHtml::_('select.options', $this->null_switchOptions, 'value', 'text') + Html::_('select.options', $this->null_switchOptions, 'value', 'text') ); } @@ -279,19 +292,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Store Selection - $this->storeOptions = JFormHelper::loadFieldType('fieldsfilterstore')->options; + $this->storeOptions = FormHelper::loadFieldType('fieldsfilterstore')->options; // We do some sanitation for Store filter - if (ComponentbuilderHelper::checkArray($this->storeOptions) && + if (ArrayHelper::check($this->storeOptions) && isset($this->storeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->storeOptions[0]->value)) + !StringHelper::check($this->storeOptions[0]->value)) { unset($this->storeOptions[0]); } // Store Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL').' -', 'batch[store]', - JHtml::_('select.options', $this->storeOptions, 'value', 'text') + Html::_('select.options', $this->storeOptions, 'value', 'text') ); } } @@ -305,10 +318,10 @@ class ComponentbuilderViewFields extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_FIELDS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/fields.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_FIELDS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/fields.css", ['version' => 'auto']); } /** @@ -323,30 +336,40 @@ class ComponentbuilderViewFields extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_FIELD_NAME_LABEL'), - 'g.name' => JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL'), - 'a.datatype' => JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL'), - 'a.indexes' => JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL'), - 'a.null_switch' => JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL'), - 'a.store' => JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'), - 'category_title' => JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_FIELD_NAME_LABEL'), + 'g.name' => Text::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL'), + 'a.datatype' => Text::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL'), + 'a.indexes' => Text::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL'), + 'a.null_switch' => Text::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL'), + 'a.store' => Text::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'), + 'category_title' => Text::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/fieldtype/submitbutton.js b/admin/views/fieldtype/submitbutton.js index 7880a9e25..b07e60d48 100644 --- a/admin/views/fieldtype/submitbutton.js +++ b/admin/views/fieldtype/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/fieldtype/tmpl/edit.php b/admin/views/fieldtype/tmpl/edit.php index 8259f6b6e..137bd76b0 100644 --- a/admin/views/fieldtype/tmpl/edit.php +++ b/admin/views/fieldtype/tmpl/edit.php @@ -12,100 +12,99 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/fieldtypes/view.html.php b/admin/views/fieldtypes/view.html.php index 9fa379881..b21c54966 100644 --- a/admin/views/fieldtypes/view.html.php +++ b/admin/views/fieldtypes/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Fieldtypes @@ -35,7 +48,7 @@ class ComponentbuilderViewFieldtypes extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewFieldtypes extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('fieldtype'); $this->canEdit = $this->canDo->get('fieldtype.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewFieldtypes extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewFieldtypes extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_FIELDTYPES'), 'power-cord'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=fieldtypes'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_FIELDTYPES'), 'power-cord'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('fieldtype.add'); + ToolbarHelper::addNew('fieldtype.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('fieldtype.edit'); + ToolbarHelper::editList('fieldtype.edit'); } if ($this->canState) { - JToolBarHelper::publishList('fieldtypes.publish'); - JToolBarHelper::unpublishList('fieldtypes.unpublish'); - JToolBarHelper::archiveList('fieldtypes.archive'); + ToolbarHelper::publishList('fieldtypes.publish'); + ToolbarHelper::unpublishList('fieldtypes.unpublish'); + ToolbarHelper::archiveList('fieldtypes.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('fieldtypes.checkin'); + ToolbarHelper::checkin('fieldtypes.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewFieldtypes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,44 +142,44 @@ class ComponentbuilderViewFieldtypes extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'fieldtypes.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'fieldtypes.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('fieldtypes.trash'); + ToolbarHelper::trash('fieldtypes.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('fieldtype.export')) { - JToolBarHelper::custom('fieldtypes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('fieldtypes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('fieldtype.import')) { - JToolBarHelper::custom('fieldtypes.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('fieldtypes.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('fieldtypes'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -174,9 +187,9 @@ class ComponentbuilderViewFieldtypes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -184,9 +197,9 @@ class ComponentbuilderViewFieldtypes extends HtmlView { // Category Batch selection. JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), 'batch[category]', - JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fieldtype'), 'value', 'text') + Html::_('select.options', Html::_('category.options', 'com_componentbuilder.fieldtype'), 'value', 'text') ); } } @@ -200,10 +213,10 @@ class ComponentbuilderViewFieldtypes extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_FIELDTYPES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/fieldtypes.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_FIELDTYPES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/fieldtypes.css", ['version' => 'auto']); } /** @@ -218,26 +231,36 @@ class ComponentbuilderViewFieldtypes extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL'), - 'a.short_description' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL'), - 'category_title' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL'), + 'a.short_description' => Text::_('COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL'), + 'category_title' => Text::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/get_snippets/tmpl/default.php b/admin/views/get_snippets/tmpl/default.php index 74cef80ce..9c896eb35 100644 --- a/admin/views/get_snippets/tmpl/default.php +++ b/admin/views/get_snippets/tmpl/default.php @@ -12,10 +12,15 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); ?> canDo->get('get_snippets.access')): ?> -

+

diff --git a/admin/views/get_snippets/view.html.php b/admin/views/get_snippets/view.html.php index af14e980b..857f0cbf7 100644 --- a/admin/views/get_snippets/view.html.php +++ b/admin/views/get_snippets/view.html.php @@ -12,7 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Filesystem\File; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -26,11 +33,11 @@ class ComponentbuilderViewGet_snippets extends HtmlView function display($tpl = null) { // get component params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // get the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('get_snippets'); // Initialise variables. @@ -49,7 +56,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView // Check for errors. if (count($errors = $this->get('Errors'))) { - throw new Exception(implode(PHP_EOL, $errors), 500); + throw new \Exception(implode(PHP_EOL, $errors), 500); } parent::display($tpl); @@ -64,15 +71,15 @@ class ComponentbuilderViewGet_snippets extends HtmlView // Only load jQuery if needed. (default is true) if ($this->params->get('add_jquery_framework', 1) == 1) { - JHtml::_('jquery.framework'); + Html::_('jquery.framework'); } // Load the header checker class. require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' ); // Initialize the header checker. - $HeaderCheck = new componentbuilderHeaderCheck; + $HeaderCheck = new componentbuilderHeaderCheck(); // Add View JavaScript File - JHtml::_('script', "administrator/components/com_componentbuilder/assets/js/get_snippets.js", ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/assets/js/get_snippets.js", ['version' => 'auto']); // Load uikit options. $uikit = $this->params->get('uikit_load'); @@ -84,27 +91,25 @@ class ComponentbuilderViewGet_snippets extends HtmlView // 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']); + Html::_('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']); + Html::_('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 = []; $uikitComp[] = 'data-uk-grid'; } // Load the needed uikit components in this view. - if ($uikit != 2 && isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp)) + if ($uikit != 2 && isset($uikitComp) && ArrayHelper::check($uikitComp)) { - // load just in case. - jimport('joomla.filesystem.file'); // loading... foreach ($uikitComp as $class) { @@ -114,13 +119,13 @@ class ComponentbuilderViewGet_snippets extends HtmlView 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']); + Html::_('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']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']); } } } @@ -137,9 +142,9 @@ class ComponentbuilderViewGet_snippets extends HtmlView } // Add the JavaScript for JStore - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jquery.json.min.js'); - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jstorage.min.js'); - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/strtotime.js'); + Html::_('script', 'media/com_componentbuilder/js/jquery.json.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/js/jstorage.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/js/strtotime.js', ['version' => 'auto']); // check if we should use browser storage $setBrowserStorage = $this->params->get('set_browser_storage', null); if ($setBrowserStorage) @@ -149,7 +154,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView if ('global' == $storageTimeToLive) { // use the global session time - $session = JFactory::getSession(); + $session = Factory::getSession(); // must have itin milliseconds $expire = ($session->getExpire()*60)* 1000; } @@ -183,59 +188,59 @@ class ComponentbuilderViewGet_snippets extends HtmlView $this->document->addScriptDeclaration("bulkItems.ahead = [];"); $this->document->addScriptDeclaration("bulkItems.behind = [];"); // set an error message if needed - $this->document->addScriptDeclaration("var returnError = '

".JText::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."!

".JText::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".

';"); + $this->document->addScriptDeclaration("var returnError = '

".Text::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."!

".Text::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".

';"); // need to add some language strings - JText::script('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS'); - JText::script('COM_COMPONENTBUILDER_SNIPPETS'); - JText::script('COM_COMPONENTBUILDER_SNIPPET'); - JText::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION'); - JText::script('COM_COMPONENTBUILDER_GET_SNIPPET'); - JText::script('COM_COMPONENTBUILDER_LOCAL_SNIPPET'); - JText::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION'); - JText::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY'); - JText::script('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION'); - JText::script('COM_COMPONENTBUILDER_USAGE'); - JText::script('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION'); - JText::script('COM_COMPONENTBUILDER_DESCRIPTION'); - JText::script('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION'); - JText::script('COM_COMPONENTBUILDER_VIEW_BLAME'); - JText::script('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET'); - JText::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL'); - JText::script('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED'); - JText::script('COM_COMPONENTBUILDER_SNIPPETS_COULD_NOT_BE_UPDATEDSAVED'); - JText::script('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR'); - JText::script('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS'); - JText::script('COM_COMPONENTBUILDER_JCB_COMMUNITY'); - JText::script('COM_COMPONENTBUILDER_COMPANY_NAME'); - JText::script('COM_COMPONENTBUILDER_AUTHOR_NAME'); - JText::script('COM_COMPONENTBUILDER_AUTHOR_EMAIL'); - JText::script('COM_COMPONENTBUILDER_AUTHOR_WEBSITE'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES'); - JText::script('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS'); + Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS'); + Text::script('COM_COMPONENTBUILDER_SNIPPETS'); + Text::script('COM_COMPONENTBUILDER_SNIPPET'); + Text::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION'); + Text::script('COM_COMPONENTBUILDER_GET_SNIPPET'); + Text::script('COM_COMPONENTBUILDER_LOCAL_SNIPPET'); + Text::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION'); + Text::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY'); + Text::script('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION'); + Text::script('COM_COMPONENTBUILDER_USAGE'); + Text::script('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION'); + Text::script('COM_COMPONENTBUILDER_DESCRIPTION'); + Text::script('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION'); + Text::script('COM_COMPONENTBUILDER_VIEW_BLAME'); + Text::script('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET'); + Text::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL'); + Text::script('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED'); + Text::script('COM_COMPONENTBUILDER_SNIPPETS_COULD_NOT_BE_UPDATEDSAVED'); + Text::script('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR'); + Text::script('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS'); + Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY'); + Text::script('COM_COMPONENTBUILDER_COMPANY_NAME'); + Text::script('COM_COMPONENTBUILDER_AUTHOR_NAME'); + Text::script('COM_COMPONENTBUILDER_AUTHOR_EMAIL'); + Text::script('COM_COMPONENTBUILDER_AUTHOR_WEBSITE'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES'); + Text::script('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS'); // add some lang verfy messages $this->document->addScriptDeclaration(" // set the snippet from gitHub function getConfirmUpdate(status) { switch(status) { case 'new': - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_ADD_THIS_NEW_JCB_COMMUNITY_SNIPPET_TO_YOUR_LOCAL_SNIPPETS')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_ADD_THIS_NEW_JCB_COMMUNITY_SNIPPET_TO_YOUR_LOCAL_SNIPPETS')."'; break; case 'behind': - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET')."'; break; case 'ahead': - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET')."'; break; case 'diverged': - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET')."'; break; default: - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE')."'; break; } } @@ -247,7 +252,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView $this->document->addScriptDeclaration("var local_snippets = ". json_encode($local_snippets).";"); } // add the document default css file - JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/get_snippets.css', ['version' => 'auto']); + Html::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/get_snippets.css', ['version' => 'auto']); } /** @@ -258,51 +263,51 @@ class ComponentbuilderViewGet_snippets extends HtmlView // hide the main menu $this->app->input->set('hidemainmenu', true); // add title to the page - JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_GET_SNIPPETS'),'search'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_GET_SNIPPETS'),'search'); // add cpanel button - JToolBarHelper::custom('get_snippets.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); + ToolbarHelper::custom('get_snippets.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); if ($this->canDo->get('get_snippets.custom_admin_views')) { // add Custom Admin Views button. - JToolBarHelper::custom('get_snippets.openCustomAdminViews', 'screen custom-button-opencustomadminviews', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false); + ToolbarHelper::custom('get_snippets.openCustomAdminViews', 'screen custom-button-opencustomadminviews', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false); } if ($this->canDo->get('get_snippets.site_views')) { // add Site Views button. - JToolBarHelper::custom('get_snippets.openSiteViews', 'palette custom-button-opensiteviews', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false); + ToolbarHelper::custom('get_snippets.openSiteViews', 'palette custom-button-opensiteviews', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false); } if ($this->canDo->get('get_snippets.templates')) { // add Templates button. - JToolBarHelper::custom('get_snippets.openTemplates', 'brush custom-button-opentemplates', '', 'COM_COMPONENTBUILDER_TEMPLATES', false); + ToolbarHelper::custom('get_snippets.openTemplates', 'brush custom-button-opentemplates', '', 'COM_COMPONENTBUILDER_TEMPLATES', false); } if ($this->canDo->get('get_snippets.layouts')) { // add Layouts button. - JToolBarHelper::custom('get_snippets.openLayouts', 'brush custom-button-openlayouts', '', 'COM_COMPONENTBUILDER_LAYOUTS', false); + ToolbarHelper::custom('get_snippets.openLayouts', 'brush custom-button-openlayouts', '', 'COM_COMPONENTBUILDER_LAYOUTS', false); } if ($this->canDo->get('get_snippets.snippets')) { // add Snippets button. - JToolBarHelper::custom('get_snippets.openSnippets', 'pin custom-button-opensnippets', '', 'COM_COMPONENTBUILDER_SNIPPETS', false); + ToolbarHelper::custom('get_snippets.openSnippets', 'pin custom-button-opensnippets', '', 'COM_COMPONENTBUILDER_SNIPPETS', false); } if ($this->canDo->get('get_snippets.libraries')) { // add Libraries button. - JToolBarHelper::custom('get_snippets.openLibraries', 'puzzle custom-button-openlibraries', '', 'COM_COMPONENTBUILDER_LIBRARIES', false); + ToolbarHelper::custom('get_snippets.openLibraries', 'puzzle custom-button-openlibraries', '', 'COM_COMPONENTBUILDER_LIBRARIES', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('get_snippets'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } } @@ -316,6 +321,16 @@ class ComponentbuilderViewGet_snippets extends HtmlView public function escape($var) { // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/help_document/submitbutton.js b/admin/views/help_document/submitbutton.js index 27198a162..25ea5a6b6 100644 --- a/admin/views/help_document/submitbutton.js +++ b/admin/views/help_document/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php index 27a49473d..8b16c8995 100644 --- a/admin/views/help_document/tmpl/edit.php +++ b/admin/views/help_document/tmpl/edit.php @@ -12,85 +12,84 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/help_document/view.html.php b/admin/views/help_document/view.html.php index 8549c7eaf..4615ce1e4 100644 --- a/admin/views/help_document/view.html.php +++ b/admin/views/help_document/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Help_document Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewHelp_document extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewHelp_document extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('help_document', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewHelp_document extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewHelp_document extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('help_document.create') && $isNew) { // We can create the record. - JToolBarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('help_document.edit')) { // We can save the record. - JToolBarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewHelp_document extends HtmlView // For new records, check the create permission. if ($this->canDo->get('help_document.create')) { - JToolBarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('help_document.edit')) { // We can save the new record - JToolBarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('help_document.create')) { - JToolBarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('help_document.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('help_document.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.help_document', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.help_document', $this->item->id); } if ($this->canDo->get('help_document.create')) { - JToolBarHelper::custom('help_document.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('help_document.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('help_document'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewHelp_document extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,14 +196,20 @@ class ComponentbuilderViewHelp_document extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/help_document.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/help_document/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - JText::script('view not acceptable. Error'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/help_document.css", ['version' => 'auto']); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/help_document/submitbutton.js", ['version' => 'auto']); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/help_documents/tmpl/default.php b/admin/views/help_documents/tmpl/default.php index 4a8dcb041..12011e52b 100644 --- a/admin/views/help_documents/tmpl/default.php +++ b/admin/views/help_documents/tmpl/default.php @@ -12,16 +12,23 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=help_documents.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -32,13 +39,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -48,11 +55,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -62,5 +69,5 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/help_documents/tmpl/default_batch_body.php b/admin/views/help_documents/tmpl/default_batch_body.php index d946ec995..38d5dac6a 100644 --- a/admin/views/help_documents/tmpl/default_batch_body.php +++ b/admin/views/help_documents/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/help_documents/tmpl/default_batch_footer.php b/admin/views/help_documents/tmpl/default_batch_footer.php index df213dcd9..232759e8d 100644 --- a/admin/views/help_documents/tmpl/default_batch_footer.php +++ b/admin/views/help_documents/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/help_documents/tmpl/default_body.php b/admin/views/help_documents/tmpl/default_body.php index e3ea244de..f8abd329e 100644 --- a/admin/views/help_documents/tmpl/default_body.php +++ b/admin/views/help_documents/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_document.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('help_document',$item,'help_documents'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc get('help_document.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc get('help_document.edit')): ?> escape($item->title); ?> checked_out): ?> - name, $item->checked_out_time, 'help_documents.', $canCheckin); ?> + name, $item->checked_out_time, 'help_documents.', $canCheckin); ?> escape($item->title); ?> @@ -70,13 +74,13 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc - type); ?> + type); ?> escape($item->groups); ?> - location); ?> + location); ?> escape($item->admin_view); ?> @@ -88,15 +92,15 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc get('help_document.edit.state')) : ?> checked_out) : ?> - published, $i, 'help_documents.', true, 'cb'); ?> + published, $i, 'help_documents.', true, 'cb'); ?> - published, $i, 'help_documents.', false, 'cb'); ?> + published, $i, 'help_documents.', false, 'cb'); ?> - published, $i, 'help_documents.', true, 'cb'); ?> + published, $i, 'help_documents.', true, 'cb'); ?> - published, $i, 'help_documents.', false, 'cb'); ?> + published, $i, 'help_documents.', false, 'cb'); ?> diff --git a/admin/views/help_documents/tmpl/default_head.php b/admin/views/help_documents/tmpl/default_head.php index c1097f4f3..69d0602cd 100644 --- a/admin/views/help_documents/tmpl/default_head.php +++ b/admin/views/help_documents/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,33 +33,33 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/help_documents/tmpl/default_toolbar.php b/admin/views/help_documents/tmpl/default_toolbar.php index a9b97a8ec..67dc8acb8 100644 --- a/admin/views/help_documents/tmpl/default_toolbar.php +++ b/admin/views/help_documents/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index 08b606523..249d9b311 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Help_documents @@ -35,7 +48,7 @@ class ComponentbuilderViewHelp_documents extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewHelp_documents extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('help_document'); $this->canEdit = $this->canDo->get('help_document.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewHelp_documents extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewHelp_documents extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS'), 'support'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=help_documents'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS'), 'support'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('help_document.add'); + ToolbarHelper::addNew('help_document.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('help_document.edit'); + ToolbarHelper::editList('help_document.edit'); } if ($this->canState) { - JToolBarHelper::publishList('help_documents.publish'); - JToolBarHelper::unpublishList('help_documents.unpublish'); - JToolBarHelper::archiveList('help_documents.archive'); + ToolbarHelper::publishList('help_documents.publish'); + ToolbarHelper::unpublishList('help_documents.unpublish'); + ToolbarHelper::archiveList('help_documents.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('help_documents.checkin'); + ToolbarHelper::checkin('help_documents.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,44 +142,44 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'help_documents.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'help_documents.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('help_documents.trash'); + ToolbarHelper::trash('help_documents.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('help_document.export')) { - JToolBarHelper::custom('help_documents.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('help_documents.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('help_document.import')) { - JToolBarHelper::custom('help_documents.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('help_documents.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('help_documents'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -174,19 +187,19 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Type Selection - $this->typeOptions = JFormHelper::loadFieldType('helpdocumentsfiltertype')->options; + $this->typeOptions = FormHelper::loadFieldType('helpdocumentsfiltertype')->options; // We do some sanitation for Type filter - if (ComponentbuilderHelper::checkArray($this->typeOptions) && + if (ArrayHelper::check($this->typeOptions) && isset($this->typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + !StringHelper::check($this->typeOptions[0]->value)) { unset($this->typeOptions[0]); } // Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL').' -', 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') + Html::_('select.options', $this->typeOptions, 'value', 'text') ); } @@ -194,19 +207,19 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Location Selection - $this->locationOptions = JFormHelper::loadFieldType('helpdocumentsfilterlocation')->options; + $this->locationOptions = FormHelper::loadFieldType('helpdocumentsfilterlocation')->options; // We do some sanitation for Location filter - if (ComponentbuilderHelper::checkArray($this->locationOptions) && + if (ArrayHelper::check($this->locationOptions) && isset($this->locationOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->locationOptions[0]->value)) + !StringHelper::check($this->locationOptions[0]->value)) { unset($this->locationOptions[0]); } // Location Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL').' -', 'batch[location]', - JHtml::_('select.options', $this->locationOptions, 'value', 'text') + Html::_('select.options', $this->locationOptions, 'value', 'text') ); } @@ -214,19 +227,19 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Admin View Selection - $this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->options; + $this->admin_viewOptions = FormHelper::loadFieldType('Adminviewfolderlist')->options; // We do some sanitation for Admin View filter - if (ComponentbuilderHelper::checkArray($this->admin_viewOptions) && + if (ArrayHelper::check($this->admin_viewOptions) && isset($this->admin_viewOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->admin_viewOptions[0]->value)) + !StringHelper::check($this->admin_viewOptions[0]->value)) { unset($this->admin_viewOptions[0]); } // Admin View Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', 'batch[admin_view]', - JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text') + Html::_('select.options', $this->admin_viewOptions, 'value', 'text') ); } @@ -234,19 +247,19 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Site View Selection - $this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->options; + $this->site_viewOptions = FormHelper::loadFieldType('Siteviewfolderlist')->options; // We do some sanitation for Site View filter - if (ComponentbuilderHelper::checkArray($this->site_viewOptions) && + if (ArrayHelper::check($this->site_viewOptions) && isset($this->site_viewOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->site_viewOptions[0]->value)) + !StringHelper::check($this->site_viewOptions[0]->value)) { unset($this->site_viewOptions[0]); } // Site View Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', 'batch[site_view]', - JHtml::_('select.options', $this->site_viewOptions, 'value', 'text') + Html::_('select.options', $this->site_viewOptions, 'value', 'text') ); } } @@ -260,10 +273,10 @@ class ComponentbuilderViewHelp_documents extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/help_documents.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/help_documents.css", ['version' => 'auto']); } /** @@ -278,28 +291,38 @@ class ComponentbuilderViewHelp_documents extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.title' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TITLE_LABEL'), - 'a.type' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL'), - 'a.location' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL'), - 'g.' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL'), - 'h.' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.title' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TITLE_LABEL'), + 'a.type' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL'), + 'a.location' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL'), + 'h.' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL'), + 'i.' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index 5f2f7198b..d9003da29 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -12,13 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?>
-
+ sidebar)) : ?>
@@ -132,13 +138,13 @@ jQuery(document).ready(function($) {
- hasPackage && ComponentbuilderHelper::checkArray($this->headerList) && ComponentbuilderHelper::checkArray($this->headers)) : ?> + hasPackage && ArrayHelper::check($this->headerList) && ArrayHelper::check($this->headers)) : ?>
- +
- +
- +
headerList as $name => $title): ?> @@ -146,72 +152,72 @@ jQuery(document).ready(function($) {
- +
- 'upload')); ?> - - + 'upload')); ?> + +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- - - + + +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- + - +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- - + + - +
\ No newline at end of file diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index b7669e5be..c7b9e03c4 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -12,7 +12,11 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Import Html View @@ -26,7 +30,7 @@ class ComponentbuilderViewImport extends HtmlView protected $dataType; public function display($tpl = null) - { + { if ($this->getLayout() !== 'modal') { // Include helper submenu @@ -39,7 +43,7 @@ class ComponentbuilderViewImport extends HtmlView $this->paths = &$paths; $this->state = &$state; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('import'); // We don't need toolbar in the modal window. @@ -50,18 +54,18 @@ class ComponentbuilderViewImport extends HtmlView } // get the session object - $session = JFactory::getSession(); + $session = Factory::getSession(); // check if it has package - $this->hasPackage = $session->get('hasPackage', false); - $this->dataType = $session->get('dataType', false); + $this->hasPackage = $session->get('hasPackage', false); + $this->dataType = $session->get('dataType', false); if($this->hasPackage && $this->dataType) { - $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); - $this->headers = ComponentbuilderHelper::getFileHeaders($this->dataType); + $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); + $this->headers = ComponentbuilderHelper::getFileHeaders($this->dataType); // clear the data type $session->clear('dataType'); } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -77,19 +81,19 @@ class ComponentbuilderViewImport extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=import'); if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('import'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/views/import_joomla_components/tmpl/default.php b/admin/views/import_joomla_components/tmpl/default.php index 59d07a8da..df2744172 100644 --- a/admin/views/import_joomla_components/tmpl/default.php +++ b/admin/views/import_joomla_components/tmpl/default.php @@ -11,12 +11,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use VDM\Joomla\Utilities\ArrayHelper; -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\ArrayHelper; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?> dataType === 'smart_package') ? '.zip' : 'none'; ?>
-
+ sidebar)) : ?>
@@ -165,8 +177,8 @@ jQuery('
')
@@ -185,14 +197,14 @@ jQuery('
') $hasOwner = (isset($this->packageInfo['getKeyFrom']) && ArrayHelper::check($this->packageInfo['getKeyFrom'])) ? true:false; $class1 = ($hasOwner) ? 'span6' : 'span12'; ?> -

-

- 'advanced')); ?> +

+

+ 'advanced')); ?> - +
- + formPackage): ?> formPackage as $field): ?>
@@ -203,13 +215,13 @@ jQuery('
')
- - + +
-

+

@@ -217,78 +229,78 @@ jQuery('
') owner($this->packageInfo); ?>
- + packageInfo['name']) && ArrayHelper::check($this->packageInfo['name'])) : ?> - + components($this->packageInfo); ?> - + - + dataType === 'smart_package'): ?> -

-

+

+

- 'upload')); ?> + 'upload')); ?> - +
- +
- +
-     () +     ()
- + - +
- +
- +
-     () +     ()
- + - +
- +
- +
-     () +     ()
- + vdmPackages) && ArrayHelper::check($this->vdmPackages)): ?> - +
-

-

-

+

+

+

- + vdmPackages as $field): ?>
label;?>
@@ -296,9 +308,9 @@ jQuery('
')
-     +    
-
+
@@ -307,19 +319,19 @@ jQuery('
')
- + jcbPackages) && ArrayHelper::check($this->jcbPackages)) : ?> - +
-

-

-

+

+

+

- + jcbPackages as $field): ?>
label;?>
@@ -327,9 +339,9 @@ jQuery('
')
-     +    
-
+
@@ -338,15 +350,15 @@ jQuery('
')
- + - + - +
@@ -518,27 +530,29 @@ jQuery('#adminForm').on('change', '#haskey',function (e) } }); -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { diff --git a/admin/views/import_joomla_components/view.html.php b/admin/views/import_joomla_components/view.html.php index 32f4bf1b4..0b09262c0 100644 --- a/admin/views/import_joomla_components/view.html.php +++ b/admin/views/import_joomla_components/view.html.php @@ -12,7 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\FormHelper as UtilitiesFormHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -39,9 +46,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView ComponentbuilderHelper::addSubmenu('import'); } // get component params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); - $paths = new stdClass; + $paths = new \stdClass; $paths->first = ''; $state = $this->get('state'); @@ -50,7 +57,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('import'); // load the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') @@ -58,12 +65,12 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); // add title to the page - JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT'), 'upload'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT'), 'upload'); // add refesh button. - JToolBarHelper::custom('joomla_component.refresh', 'refresh', '', 'COM_COMPONENTBUILDER_REFRESH', false); + ToolbarHelper::custom('joomla_component.refresh', 'refresh', '', 'COM_COMPONENTBUILDER_REFRESH', false); } // get the session object - $session = JFactory::getSession(); + $session = Factory::getSession(); // check if it has package $this->hasPackage = $session->get('hasPackage', false); $this->dataType = $session->get('dataType', false); @@ -116,14 +123,14 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView protected function setDocument() { // always make sure jquery is loaded. - JHtml::_('jquery.framework'); + Html::_('jquery.framework'); // Add the JavaScript for JStore - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jquery.json.min.js'); - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jstorage.min.js'); - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/strtotime.js'); + Html::_('script', 'media/com_componentbuilder/js/jquery.json.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/js/jstorage.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/js/strtotime.js', ['version' => 'auto']); // add marked library - $this->document->addScript(JURI::root() . "media/com_componentbuilder/js/marked.js"); + Html::_('script', "media/com_componentbuilder/js/marked.js", ['version' => 'auto']); // check if we should use browser storage $setBrowserStorage = $this->params->get('set_browser_storage', null); if ($setBrowserStorage) @@ -133,7 +140,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if ('global' == $storageTimeToLive) { // use the global session time - $session = JFactory::getSession(); + $session = Factory::getSession(); // must have itin milliseconds $expire = ($session->getExpire()*60)* 1000; } @@ -156,21 +163,21 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView // Set the Time To Live To JavaScript $this->document->addScriptDeclaration("var expire = ". (int) $expire.";"); - $this->document->addScriptDeclaration("var all_is_good = '".JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME')."';"); + $this->document->addScriptDeclaration("var all_is_good = '".Text::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME')."';"); // add a token on the page for javascript $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); } public function _getForm($type) @@ -179,9 +186,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if ('smart_package' === $type) { // get the force_update radio field - $force_update = JFormHelper::loadFieldType('radio',true); - // start force_update xml - $force_updateXML = new SimpleXMLElement(''); + $force_update = FormHelper::loadFieldType('radio',true); + // start force_update xl + $force_updateXML = new \SimpleXMLElement(''); // force_update attributes $force_updateAttributes = array( 'type' => 'radio', @@ -191,22 +198,22 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED', 'default' => '0'); // load the force_update attributes - ComponentbuilderHelper::xmlAddAttributes($force_updateXML, $force_updateAttributes); + UtilitiesFormHelper::attributes($force_updateXML, $force_updateAttributes); // set the force_update options $force_updateOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the force_update options - ComponentbuilderHelper::xmlAddOptions($force_updateXML, $force_updateOptions); + UtilitiesFormHelper::options($force_updateXML, $force_updateOptions); // setup the force_update radio field $force_update->setup($force_updateXML,0); // add to form $form[] = $force_update; // get the more_info radio field - $more_info = JFormHelper::loadFieldType('radio',true); + $more_info = FormHelper::loadFieldType('radio',true); // start more_info xml - $more_infoXML = new SimpleXMLElement(''); + $more_infoXML = new \SimpleXMLElement(''); // more_info attributes $more_infoAttributes = array( 'type' => 'radio', @@ -216,22 +223,22 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_BE_SHOWING_MORE_ELABORATE_INFORMATION_DURING_IMPORT', 'default' => '0'); // load the more_info attributes - ComponentbuilderHelper::xmlAddAttributes($more_infoXML, $more_infoAttributes); + UtilitiesFormHelper::attributes($more_infoXML, $more_infoAttributes); // set the more_info options $more_infoOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the more_info options - ComponentbuilderHelper::xmlAddOptions($more_infoXML, $more_infoOptions); + UtilitiesFormHelper::options($more_infoXML, $more_infoOptions); // setup the more_info radio field $more_info->setup($more_infoXML,0); // add to form $form[] = $more_info; // get the merge radio field - $merge = JFormHelper::loadFieldType('radio',true); + $merge = FormHelper::loadFieldType('radio',true); // start merge xml - $mergeXML = new SimpleXMLElement(''); + $mergeXML = new \SimpleXMLElement(''); // merge attributes $mergeAttributes = array( 'type' => 'radio', @@ -241,22 +248,22 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_MERGE_THE_COMPONENTS_WITH_SIMILAR_LOCAL_COMPONENTS_MERGING_THE_COMPONENTS_USE_TO_BE_THE_DEFAULT_BEHAVIOUR_BUT_NOW_YOU_CAN_IMPORT_THE_COMPONENTS_AND_FORCE_IT_NOT_TO_MERGE_THE_FOLLOWING_AREAS_VALIDATION_RULE_FIELDTYPE_SNIPPET_LANGUAGE_LANGUAGE_TRANSLATION_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_CLASS_PROPERTY_CLASS_METHOD_BMUST_AND_WILL_STILLB_MERGE_EVEN_OF_YOUR_SELECTION_IS_BNOB_BECAUSE_OF_THE_SINGULAR_NATURE_OF_THOSE_AREAS', 'default' => '1'); // load the merge attributes - ComponentbuilderHelper::xmlAddAttributes($mergeXML, $mergeAttributes); + UtilitiesFormHelper::attributes($mergeXML, $mergeAttributes); // set the merge options $mergeOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the merge options - ComponentbuilderHelper::xmlAddOptions($mergeXML, $mergeOptions); + UtilitiesFormHelper::options($mergeXML, $mergeOptions); // setup the merge radio field $merge->setup($mergeXML,1); // add to form $form[] = $merge; // get the import_guid_only radio field - $import_guid_only = JFormHelper::loadFieldType('radio',true); + $import_guid_only = FormHelper::loadFieldType('radio',true); // start import_guid_only xml - $import_guid_onlyXML = new SimpleXMLElement(''); + $import_guid_onlyXML = new \SimpleXMLElement(''); // import_guid_only attributes $import_guid_onlyAttributes = array( 'type' => 'radio', @@ -266,13 +273,13 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'description' => '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', 'default' => '1'); // load the import_guid_only attributes - ComponentbuilderHelper::xmlAddAttributes($import_guid_onlyXML, $import_guid_onlyAttributes); + UtilitiesFormHelper::attributes($import_guid_onlyXML, $import_guid_onlyAttributes); // set the import_guid_only options $import_guid_onlyOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the import_guid_only options - ComponentbuilderHelper::xmlAddOptions($import_guid_onlyXML, $import_guid_onlyOptions); + UtilitiesFormHelper::options($import_guid_onlyXML, $import_guid_onlyOptions); // setup the import_guid_only radio field $import_guid_only->setup($import_guid_onlyXML, $this->params->get('import_guid_only', 0)); // add to form @@ -286,9 +293,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if (!$this->packageInfo) { // get the haskey radio field - $haskey = JFormHelper::loadFieldType('radio',true); + $haskey = FormHelper::loadFieldType('radio',true); // start haskey xml - $haskeyXML = new SimpleXMLElement(''); + $haskeyXML = new \SimpleXMLElement(''); // haskey attributes $haskeyAttributes = array( 'type' => 'radio', @@ -299,13 +306,13 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'default' => '1', 'filter' => 'INT'); // load the haskey attributes - ComponentbuilderHelper::xmlAddAttributes($haskeyXML, $haskeyAttributes); + UtilitiesFormHelper::attributes($haskeyXML, $haskeyAttributes); // set the haskey options $haskeyOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the haskey options - ComponentbuilderHelper::xmlAddOptions($haskeyXML, $haskeyOptions); + UtilitiesFormHelper::options($haskeyXML, $haskeyOptions); // setup the haskey radio field $haskey->setup($haskeyXML,1); // add to form @@ -316,9 +323,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView } // get the sleutle password field - $sleutle = JFormHelper::loadFieldType('password',true); + $sleutle = FormHelper::loadFieldType('password',true); // start sleutle xml - $sleutleXML = new SimpleXMLElement(''); + $sleutleXML = new \SimpleXMLElement(''); // sleutle attributes $sleutleAttributes = array( 'type' => 'password', @@ -335,7 +342,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView $sleutleAttributes['required'] = 'true'; } // load the sleutle attributes - ComponentbuilderHelper::xmlAddAttributes($sleutleXML, $sleutleAttributes); + UtilitiesFormHelper::attributes($sleutleXML, $sleutleAttributes); // setup the sleutle password field $sleutle->setup($sleutleXML,''); // add to form @@ -347,9 +354,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if (ArrayHelper::check($vdmListObjects)) { // get the vdm_package list field - $vdm_package = JFormHelper::loadFieldType('list',true); + $vdm_package = FormHelper::loadFieldType('list',true); // start vdm_package xml - $vdm_packageXML = new SimpleXMLElement(''); + $vdm_packageXML = new \SimpleXMLElement(''); // vdm_package attributes $vdm_packageAttributes = array( 'type' => 'list', @@ -361,7 +368,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView // load the list $load = false; // load the vdm_package attributes - ComponentbuilderHelper::xmlAddAttributes($vdm_packageXML, $vdm_packageAttributes); + UtilitiesFormHelper::attributes($vdm_packageXML, $vdm_packageAttributes); // start the vdm_package options $vdm_packageOptions = array(); $vdm_packageOptions[''] = 'COM_COMPONENTBUILDER__SELECT_PACKAGE_'; @@ -378,7 +385,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if ($load) { // load the vdm_package options - ComponentbuilderHelper::xmlAddOptions($vdm_packageXML, $vdm_packageOptions); + UtilitiesFormHelper::options($vdm_packageXML, $vdm_packageOptions); // setup the vdm_package radio field $vdm_package->setup($vdm_packageXML,''); // add to form @@ -391,9 +398,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if (ArrayHelper::check($jcbListObjects)) { // get the jcb_package list field - $jcb_package = JFormHelper::loadFieldType('list',true); + $jcb_package = FormHelper::loadFieldType('list',true); // start jcb_package xml - $jcb_packageXML = new SimpleXMLElement(''); + $jcb_packageXML = new \SimpleXMLElement(''); // jcb_package attributes $jcb_packageAttributes = array( 'type' => 'list', @@ -405,7 +412,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView // load the list $load = false; // load the jcb_package attributes - ComponentbuilderHelper::xmlAddAttributes($jcb_packageXML, $jcb_packageAttributes); + UtilitiesFormHelper::attributes($jcb_packageXML, $jcb_packageAttributes); // start the jcb_package options $jcb_packageOptions = array(); $jcb_packageOptions[''] = 'COM_COMPONENTBUILDER__SELECT_PACKAGE_'; @@ -422,7 +429,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if ($load) { // load the jcb_package options - ComponentbuilderHelper::xmlAddOptions($jcb_packageXML, $jcb_packageOptions); + UtilitiesFormHelper::options($jcb_packageXML, $jcb_packageOptions); // setup the jcb_package radio field $jcb_package->setup($jcb_packageXML,''); // add to form @@ -444,19 +451,19 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=import_joomla_components'); if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('import_joomla_components'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/views/import_language_translations/tmpl/default.php b/admin/views/import_language_translations/tmpl/default.php index fb97b080e..b335fdfba 100644 --- a/admin/views/import_language_translations/tmpl/default.php +++ b/admin/views/import_language_translations/tmpl/default.php @@ -12,13 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\ArrayHelper; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?> @@ -754,13 +753,13 @@ jQuery('#adminForm').on('change', '#jform_translation_tool',function (e) function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { @@ -770,17 +769,19 @@ function JRouter(link) { return url+link; } -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); // check when dashboard switch changes jQuery('#adminForm').on('change', '#jform_dashboard_type',function (e) diff --git a/admin/views/joomla_component/view.html.php b/admin/views/joomla_component/view.html.php index 227818cdc..215914612 100644 --- a/admin/views/joomla_component/view.html.php +++ b/admin/views/joomla_component/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Joomla_component Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewJoomla_component extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewJoomla_component extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('joomla_component', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewJoomla_component extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewJoomla_component extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('joomla_component.create') && $isNew) { // We can create the record. - JToolBarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('joomla_component.edit')) { // We can save the record. - JToolBarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewJoomla_component extends HtmlView // For new records, check the create permission. if ($this->canDo->get('joomla_component.create')) { - JToolBarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('joomla_component.edit')) { // We can save the new record - JToolBarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('joomla_component.create')) { - JToolBarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('joomla_component.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('joomla_component.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.joomla_component', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.joomla_component', $this->item->id); } if ($this->canDo->get('joomla_component.create')) { - JToolBarHelper::custom('joomla_component.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('joomla_component.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_component'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewJoomla_component extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,32 +196,38 @@ class ComponentbuilderViewJoomla_component extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_component.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_component.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/joomla_component/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/joomla_component/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); - JText::script('view not acceptable. Error'); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/joomla_components/tmpl/default.php b/admin/views/joomla_components/tmpl/default.php index de80fb824..510c97226 100644 --- a/admin/views/joomla_components/tmpl/default.php +++ b/admin/views/joomla_components/tmpl/default.php @@ -12,19 +12,26 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleJoomlacomponentsfiltercompanyname', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_COMPANY_NAME') . ' -')); -JHtml::_('formbehavior.chosen', '.multipleJoomlacomponentsfilterauthor', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_AUTHOR') . ' -')); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleJoomlacomponentsfiltercompanyname', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_COMPANY_NAME') . ' -']); +Html::_('formbehavior.chosen', '.multipleJoomlacomponentsfilterauthor', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_AUTHOR') . ' -']); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_components.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'joomla_componentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'joomla_componentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -35,13 +42,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -51,11 +58,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -65,45 +72,52 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/joomla_components/tmpl/default_batch_body.php b/admin/views/joomla_components/tmpl/default_batch_body.php index 1c10b1805..acd442afc 100644 --- a/admin/views/joomla_components/tmpl/default_batch_body.php +++ b/admin/views/joomla_components/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/joomla_components/tmpl/default_batch_footer.php b/admin/views/joomla_components/tmpl/default_batch_footer.php index 1f073cecc..4955ef396 100644 --- a/admin/views/joomla_components/tmpl/default_batch_footer.php +++ b/admin/views/joomla_components/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/joomla_components/tmpl/default_body.php b/admin/views/joomla_components/tmpl/default_body.php index 5c046d245..d2e492452 100644 --- a/admin/views/joomla_components/tmpl/default_body.php +++ b/admin/views/joomla_components/tmpl/default_body.php @@ -11,7 +11,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\StringHelper; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; @@ -20,7 +25,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components'); ?> @@ -30,7 +35,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -48,12 +53,12 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml get('joomla_component.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -64,7 +69,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml get('joomla_component.edit')): ?> escape($item->system_name); ?> checked_out): ?> - name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> + name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> escape($item->system_name); ?> @@ -75,7 +80,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml // always make sure the $this->return_here is set if (!isset($this->return_here)) { - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); } // setup the buttons if (!isset($_buttons) || !ArrayHelper::check($_buttons)) @@ -85,78 +90,84 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml array( 'view' => 'component_admin_views', 'views' => 'components_admin_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'), 'icon' => 'stack'), array( 'view' => 'component_custom_admin_views', 'views' => 'components_custom_admin_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS'), 'icon' => 'screen'), array( 'view' => 'component_site_views', 'views' => 'components_site_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS'), 'icon' => 'palette'), + array( + 'view' => 'component_router', + 'views' => 'components_routers', + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_ROUTER'), + 'icon' => 'tree-2'), array( 'view' => 'component_config', 'views' => 'components_config', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG'), 'icon' => 'options') ); $_buttons[1] = array( array( 'view' => 'component_placeholders', 'views' => 'components_placeholders', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS'), 'icon' => 'search'), array( 'view' => 'component_updates', 'views' => 'components_updates', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES'), 'icon' => 'database'), array( 'view' => 'component_mysql_tweaks', 'views' => 'components_mysql_tweaks', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS'), 'icon' => 'screwdriver'), array( 'view' => 'component_files_folders', 'views' => 'components_files_folders', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS'), 'icon' => 'briefcase') ); $_buttons[2] = array( array( 'view' => 'component_custom_admin_menus', 'views' => 'components_custom_admin_menus', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS'), 'icon' => 'plus'), array( 'view' => 'component_dashboard', 'views' => 'components_dashboard', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'), 'icon' => 'dashboard'), array( 'view' => 'component_modules', 'views' => 'components_modules', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'), 'icon' => 'cube'), array( 'view' => 'component_plugins', 'views' => 'components_plugins', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS'), 'icon' => 'power-cord') ); } ?>
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> - + +
@@ -165,7 +176,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> @@ -179,7 +190,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> @@ -193,13 +204,13 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml escape($item->author); ?>
email) && StringHelper::check($item->author)) : ?> - + escape($item->email); ?>
website) && StringHelper::check($item->author)) : ?> - + escape($item->website); ?> @@ -209,15 +220,15 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml get('joomla_component.edit.state')) : ?> checked_out) : ?> - published, $i, 'joomla_components.', true, 'cb'); ?> + published, $i, 'joomla_components.', true, 'cb'); ?> - published, $i, 'joomla_components.', false, 'cb'); ?> + published, $i, 'joomla_components.', false, 'cb'); ?> - published, $i, 'joomla_components.', true, 'cb'); ?> + published, $i, 'joomla_components.', true, 'cb'); ?> - published, $i, 'joomla_components.', false, 'cb'); ?> + published, $i, 'joomla_components.', false, 'cb'); ?> diff --git a/admin/views/joomla_components/tmpl/default_head.php b/admin/views/joomla_components/tmpl/default_head.php index e148c450f..401c650c6 100644 --- a/admin/views/joomla_components/tmpl/default_head.php +++ b/admin/views/joomla_components/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,27 +33,27 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/joomla_components/tmpl/default_toolbar.php b/admin/views/joomla_components/tmpl/default_toolbar.php index b6f171729..4c706e988 100644 --- a/admin/views/joomla_components/tmpl/default_toolbar.php +++ b/admin/views/joomla_components/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php index 8d2b4f833..186173199 100644 --- a/admin/views/joomla_components/view.html.php +++ b/admin/views/joomla_components/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Joomla_components @@ -35,7 +48,7 @@ class ComponentbuilderViewJoomla_components extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewJoomla_components extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('joomla_component'); $this->canEdit = $this->canDo->get('joomla_component.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewJoomla_components extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewJoomla_components extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=joomla_components'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('joomla_component.add'); + ToolbarHelper::addNew('joomla_component.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('joomla_component.edit'); + ToolbarHelper::editList('joomla_component.edit'); } if ($this->canState) { - JToolBarHelper::publishList('joomla_components.publish'); - JToolBarHelper::unpublishList('joomla_components.unpublish'); - JToolBarHelper::archiveList('joomla_components.archive'); + ToolbarHelper::publishList('joomla_components.publish'); + ToolbarHelper::unpublishList('joomla_components.unpublish'); + ToolbarHelper::archiveList('joomla_components.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('joomla_components.checkin'); + ToolbarHelper::checkin('joomla_components.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,74 +142,74 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->user->authorise('joomla_component.clone', 'com_componentbuilder')) { // add Clone button. - JToolBarHelper::custom('joomla_components.cloner', 'save-copy custom-button-cloner', '', 'COM_COMPONENTBUILDER_CLONE', 'true'); + ToolbarHelper::custom('joomla_components.cloner', 'save-copy custom-button-cloner', '', 'COM_COMPONENTBUILDER_CLONE', 'true'); } if ($this->user->authorise('joomla_component.export_jcb_packages', 'com_componentbuilder')) { // add Export JCB Packages button. - JToolBarHelper::custom('joomla_components.smartExport', 'download custom-button-smartexport', '', 'COM_COMPONENTBUILDER_EXPORT_JCB_PACKAGES', 'true'); + ToolbarHelper::custom('joomla_components.smartExport', 'download custom-button-smartexport', '', 'COM_COMPONENTBUILDER_EXPORT_JCB_PACKAGES', 'true'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'joomla_components.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'joomla_components.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('joomla_components.trash'); + ToolbarHelper::trash('joomla_components.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('joomla_component.export')) { - JToolBarHelper::custom('joomla_components.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('joomla_components.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('joomla_component.import_jcb_packages', 'com_componentbuilder')) { // add Import JCB Packages button. - JToolBarHelper::custom('joomla_components.smartImport', 'upload custom-button-smartimport', '', 'COM_COMPONENTBUILDER_IMPORT_JCB_PACKAGES', false); + ToolbarHelper::custom('joomla_components.smartImport', 'upload custom-button-smartimport', '', 'COM_COMPONENTBUILDER_IMPORT_JCB_PACKAGES', false); } if ($this->user->authorise('joomla_component.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('joomla_components.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('joomla_components.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->user->authorise('joomla_component.backup', 'com_componentbuilder')) { // add Backup button. - JToolBarHelper::custom('joomla_components.backup', 'archive custom-button-backup', '', 'COM_COMPONENTBUILDER_BACKUP', false); + ToolbarHelper::custom('joomla_components.backup', 'archive custom-button-backup', '', 'COM_COMPONENTBUILDER_BACKUP', false); } if ($this->user->authorise('joomla_component.clear_tmp', 'com_componentbuilder')) { // add Clear tmp button. - JToolBarHelper::custom('joomla_components.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); + ToolbarHelper::custom('joomla_components.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); } if ($this->canDo->get('core.import') && $this->canDo->get('joomla_component.import')) { - JToolBarHelper::custom('joomla_components.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('joomla_components.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_components'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -204,9 +217,9 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -214,19 +227,19 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Companyname Selection - $this->companynameOptions = JFormHelper::loadFieldType('joomlacomponentsfiltercompanyname')->options; + $this->companynameOptions = FormHelper::loadFieldType('joomlacomponentsfiltercompanyname')->options; // We do some sanitation for Companyname filter - if (ComponentbuilderHelper::checkArray($this->companynameOptions) && + if (ArrayHelper::check($this->companynameOptions) && isset($this->companynameOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->companynameOptions[0]->value)) + !StringHelper::check($this->companynameOptions[0]->value)) { unset($this->companynameOptions[0]); } // Companyname Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL').' -', 'batch[companyname]', - JHtml::_('select.options', $this->companynameOptions, 'value', 'text') + Html::_('select.options', $this->companynameOptions, 'value', 'text') ); } @@ -234,19 +247,19 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Author Selection - $this->authorOptions = JFormHelper::loadFieldType('joomlacomponentsfilterauthor')->options; + $this->authorOptions = FormHelper::loadFieldType('joomlacomponentsfilterauthor')->options; // We do some sanitation for Author filter - if (ComponentbuilderHelper::checkArray($this->authorOptions) && + if (ArrayHelper::check($this->authorOptions) && isset($this->authorOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->authorOptions[0]->value)) + !StringHelper::check($this->authorOptions[0]->value)) { unset($this->authorOptions[0]); } // Author Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL').' -', 'batch[author]', - JHtml::_('select.options', $this->authorOptions, 'value', 'text') + Html::_('select.options', $this->authorOptions, 'value', 'text') ); } } @@ -260,10 +273,10 @@ class ComponentbuilderViewJoomla_components extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_components.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_components.css", ['version' => 'auto']); } /** @@ -278,29 +291,39 @@ class ComponentbuilderViewJoomla_components extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.system_name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_LABEL'), - 'a.name_code' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL'), - 'a.short_description' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_LABEL'), - 'a.companyname' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL'), - 'a.created' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATED_LABEL'), - 'a.modified' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MODIFIED_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.system_name' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_LABEL'), + 'a.name_code' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL'), + 'a.short_description' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_LABEL'), + 'a.companyname' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL'), + 'a.created' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATED_LABEL'), + 'a.modified' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MODIFIED_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/joomla_module/submitbutton.js b/admin/views/joomla_module/submitbutton.js index 15089b320..79c9b133a 100644 --- a/admin/views/joomla_module/submitbutton.js +++ b/admin/views/joomla_module/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/joomla_module/tmpl/edit.php b/admin/views/joomla_module/tmpl/edit.php index cb6da1ee7..a7a02fef5 100644 --- a/admin/views/joomla_module/tmpl/edit.php +++ b/admin/views/joomla_module/tmpl/edit.php @@ -12,155 +12,154 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/joomla_modules_updates/view.html.php b/admin/views/joomla_modules_updates/view.html.php index da3e8a64f..d84f6e6eb 100644 --- a/admin/views/joomla_modules_updates/view.html.php +++ b/admin/views/joomla_modules_updates/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Joomla_modules_updates @@ -35,7 +48,7 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('joomla_module_updates'); $this->canEdit = $this->canDo->get('joomla_module_updates.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=joomla_modules_updates'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('joomla_module_updates.add'); + ToolbarHelper::addNew('joomla_module_updates.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('joomla_module_updates.edit'); + ToolbarHelper::editList('joomla_module_updates.edit'); } if ($this->canState) { - JToolBarHelper::publishList('joomla_modules_updates.publish'); - JToolBarHelper::unpublishList('joomla_modules_updates.unpublish'); - JToolBarHelper::archiveList('joomla_modules_updates.archive'); + ToolbarHelper::publishList('joomla_modules_updates.publish'); + ToolbarHelper::unpublishList('joomla_modules_updates.unpublish'); + ToolbarHelper::archiveList('joomla_modules_updates.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('joomla_modules_updates.checkin'); + ToolbarHelper::checkin('joomla_modules_updates.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,34 +142,34 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'joomla_modules_updates.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'joomla_modules_updates.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('joomla_modules_updates.trash'); + ToolbarHelper::trash('joomla_modules_updates.trash'); } } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules_updates'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -164,9 +177,9 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } } @@ -180,10 +193,10 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_modules_updates.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_modules_updates.css", ['version' => 'auto']); } /** @@ -198,23 +211,33 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/joomla_plugin/submitbutton.js b/admin/views/joomla_plugin/submitbutton.js index f078a60c1..44f507308 100644 --- a/admin/views/joomla_plugin/submitbutton.js +++ b/admin/views/joomla_plugin/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/joomla_plugin/tmpl/edit.php b/admin/views/joomla_plugin/tmpl/edit.php index 3e0069787..b25dc89cc 100644 --- a/admin/views/joomla_plugin/tmpl/edit.php +++ b/admin/views/joomla_plugin/tmpl/edit.php @@ -12,123 +12,122 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/languages/view.html.php b/admin/views/languages/view.html.php index 86b8ac1c7..8cc07ae04 100644 --- a/admin/views/languages/view.html.php +++ b/admin/views/languages/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Languages @@ -35,7 +48,7 @@ class ComponentbuilderViewLanguages extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewLanguages extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('language'); $this->canEdit = $this->canDo->get('language.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewLanguages extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewLanguages extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_LANGUAGES'), 'comment'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=languages'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_LANGUAGES'), 'comment'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('language.add'); + ToolbarHelper::addNew('language.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('language.edit'); + ToolbarHelper::editList('language.edit'); } if ($this->canState) { - JToolBarHelper::publishList('languages.publish'); - JToolBarHelper::unpublishList('languages.unpublish'); - JToolBarHelper::archiveList('languages.archive'); + ToolbarHelper::publishList('languages.publish'); + ToolbarHelper::unpublishList('languages.unpublish'); + ToolbarHelper::archiveList('languages.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('languages.checkin'); + ToolbarHelper::checkin('languages.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewLanguages extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,49 +142,49 @@ class ComponentbuilderViewLanguages extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'languages.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'languages.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('languages.trash'); + ToolbarHelper::trash('languages.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('language.export')) { - JToolBarHelper::custom('languages.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('languages.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('language.build', 'com_componentbuilder')) { // add Build button. - JToolBarHelper::custom('languages.buildLanguages', 'joomla custom-button-buildlanguages', '', 'COM_COMPONENTBUILDER_BUILD', false); + ToolbarHelper::custom('languages.buildLanguages', 'joomla custom-button-buildlanguages', '', 'COM_COMPONENTBUILDER_BUILD', false); } if ($this->canDo->get('core.import') && $this->canDo->get('language.import')) { - JToolBarHelper::custom('languages.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('languages.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('languages'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::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'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -179,9 +192,9 @@ class ComponentbuilderViewLanguages extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } } @@ -195,10 +208,10 @@ class ComponentbuilderViewLanguages extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_LANGUAGES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/languages.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_LANGUAGES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/languages.css", ['version' => 'auto']); } /** @@ -213,25 +226,35 @@ class ComponentbuilderViewLanguages extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_NAME_LABEL'), - 'a.langtag' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_LANGUAGE_NAME_LABEL'), + 'a.langtag' => Text::_('COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/layout/submitbutton.js b/admin/views/layout/submitbutton.js index d0f44b6c8..d2214e1a3 100644 --- a/admin/views/layout/submitbutton.js +++ b/admin/views/layout/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/layout/tmpl/edit.php b/admin/views/layout/tmpl/edit.php index 2b9d6aae8..bc19fb8b3 100644 --- a/admin/views/layout/tmpl/edit.php +++ b/admin/views/layout/tmpl/edit.php @@ -12,87 +12,86 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -187,8 +187,8 @@ jQuery(document).ready(function() { getLayoutDetails(item->id) ? $this->item->id:9999; ?>); }); // some lang strings -var select_a_snippet = ''; -var create_a_snippet = ''; +var select_a_snippet = ''; +var create_a_snippet = ''; jQuery.fn.selText = function() { var obj = this[0]; @@ -210,13 +210,13 @@ jQuery.fn.selText = function() { } function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { diff --git a/admin/views/layout/view.html.php b/admin/views/layout/view.html.php index a02210e2e..9a9109204 100644 --- a/admin/views/layout/view.html.php +++ b/admin/views/layout/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Layout Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewLayout extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewLayout extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('layout', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewLayout extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewLayout extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('core.create') && $isNew) { // We can create the record. - JToolBarHelper::save('layout.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('core.edit')) { // We can save the record. - JToolBarHelper::save('layout.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewLayout extends HtmlView // For new records, check the create permission. if ($this->canDo->get('core.create')) { - JToolBarHelper::apply('layout.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('layout.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('layout.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('core.edit')) { // We can save the new record - JToolBarHelper::apply('layout.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('layout.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('layout.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('core.create')) { - JToolBarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('layout.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('core.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.layout', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.layout', $this->item->id); } if ($this->canDo->get('core.create')) { - JToolBarHelper::custom('layout.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('layout.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('layout'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewLayout extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,32 +196,38 @@ class ComponentbuilderViewLayout extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/layout.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/layout.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/layout/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/layout/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); - JText::script('view not acceptable. Error'); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/layouts/tmpl/default.php b/admin/views/layouts/tmpl/default.php index 94d8ba26f..8af410455 100644 --- a/admin/views/layouts/tmpl/default.php +++ b/admin/views/layouts/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=layouts.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'layoutList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'layoutList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_LAYOUTS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_LAYOUTS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,7 +70,7 @@ if ($this->saveOrder)
- +
@@ -575,13 +574,13 @@ jQuery(document).ready(function(){ }); function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { @@ -591,16 +590,18 @@ function JRouter(link) { return url+link; } -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); diff --git a/admin/views/library/view.html.php b/admin/views/library/view.html.php index d013e61b7..ec20a5255 100644 --- a/admin/views/library/view.html.php +++ b/admin/views/library/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Library Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewLibrary extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewLibrary extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('library', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewLibrary extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewLibrary extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('library.create') && $isNew) { // We can create the record. - JToolBarHelper::save('library.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('library.edit')) { // We can save the record. - JToolBarHelper::save('library.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewLibrary extends HtmlView // For new records, check the create permission. if ($this->canDo->get('library.create')) { - JToolBarHelper::apply('library.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('library.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('library.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('library.edit')) { // We can save the new record - JToolBarHelper::apply('library.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('library.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('library.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('library.create')) { - JToolBarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('library.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('library.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.library', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.library', $this->item->id); } if ($this->canDo->get('library.create')) { - JToolBarHelper::custom('library.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('library.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('library'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewLibrary extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,32 +196,38 @@ class ComponentbuilderViewLibrary extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/library.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/library.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/library/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/library/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); - JText::script('view not acceptable. Error'); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/library_config/submitbutton.js b/admin/views/library_config/submitbutton.js index d866dc9e0..c2dbcfab2 100644 --- a/admin/views/library_config/submitbutton.js +++ b/admin/views/library_config/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/library_config/tmpl/edit.php b/admin/views/library_config/tmpl/edit.php index f5273842d..f77861e0d 100644 --- a/admin/views/library_config/tmpl/edit.php +++ b/admin/views/library_config/tmpl/edit.php @@ -12,71 +12,70 @@ // 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'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> '; $tmp .= PHP_EOL . $_tab . Indent::_(2) . '
'; $tmp .= PHP_EOL . $_tab . Indent::_(1) - . ""; + . ""; // update html $tab['html'] = $tmp; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/JoomlaThree/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/JoomlaThree/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/JoomlaThree/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Router.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Router.php new file mode 100644 index 000000000..87f106613 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Router.php @@ -0,0 +1,330 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Router as Builder; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; + + +/** + * Model Component Site Router Class + * + * @since 3.2.0 + */ +class Router +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * The Router Class. + * + * @var Builder + * @since 3.2.0 + */ + protected Builder $builder; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'component_router', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * The field targets + * + * @var array + * @since 3.2.0 + */ + protected array $targets = [ + 'before' => 'constructor_before_parent', + 'after' => 'constructor_after_parent', + 'method' => 'methods' + ]; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Dispenser $dispenser The Dispenser Class. + * @param Builder $builder The Router Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Dispenser $dispenser, Builder $builder) + { + $this->config = $config; + $this->dispenser = $dispenser; + $this->builder = $builder; + } + + /** + * Set Router + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $this->config->lang_target = 'site'; + foreach ($this->targets as $target) + { + // add the code + if ($item->{"router_mode_{$target}"} == 3 + && StringHelper::check($item->{"router_{$target}_code"})) + { + // update GUI mapper field + $this->guiMapper['field'] = "{$target}_code"; + $this->dispenser->set( + $item->{"router_{$target}_code"}, + "_site_router_", + $target, + null, + $this->guiMapper + ); + } + unset($item->{"router_{$target}_code"}); + } + + // get the site views + $views = $this->getSiteViews($item->site_views ?? [], $item->admin_views ?? []); + $edit_views = $this->getSiteEditViews($item->admin_views); + + // get the edit site views + $this->builder->set('views', + ArrayHelper::merge([$views, $edit_views]) + ); + + if ($item->router_mode_constructor_before_parent == 2 + && JsonHelper::check($item->router_constructor_before_parent_manual)) + { + // build and validate the constructor before parent call code + $this->builder->set('manual', + json_decode($item->router_constructor_before_parent_manual) + ); + } + + // clear the data from the item + foreach ($this->targets as $key => $target) + { + // set the modes + $this->builder->set("mode_{$key}", + (int) $item->{"router_mode_{$target}"} + ); + + unset($item->{"router_mode_{$target}"}); + } + + unset($item->router_constructor_before_parent_manual); + } + + /** + * Get the array of site views with additional details. + * + * This method processes each site view to enrich it with additional details such as the associated table, + * alias keys, and other relevant information. The enrichment is based on the view's settings and the admin views. + * + * @param array $siteViews The site views to be processed. + * @param array $adminViews The admin views used for fetching additional data. + * + * @return array An array of objects, each representing a site view with enriched details. + * @since 3.2.0 + */ + protected function getSiteViews(array $siteViews, array $adminViews): array + { + return array_map(function ($view) use ($adminViews) { + // Attempt to get the main selection details from the view's settings. + $selection = $this->getMainSelection($view['settings']->main_get->main_get ?? null); + + // We can only work with ID if the [main get] is a [getItem] dynamicGet for this site view. + $key = ($view['settings']->main_get->gettype == 1) ? 'id' : null; + + // Construct the enriched view object. + return (object) [ + 'view' => $view['settings']->code, + 'View' => $view['settings']->Code, + 'stable' => ($selection['view'] === $view['settings']->code), // sanity check + 'target_view' => $selection['view'], + 'table' => $selection['table'], + 'table_name' => $selection['name'], + 'alias' => $this->getSiteViewAliasKey($selection['name'] ?? null, $adminViews), + 'key' => $key, + 'form' => false + ]; + }, $siteViews); + } + + /** + * Get the array of site edit views + * + * This method processes the provided admin views to extract and return an array of site edit views. + * Each site edit view is constructed based on specific conditions from the admin view's settings. + * + * @param array|null $views The admin views to process. + * + * @return array An array of site edit views, each as an object with view, table, alias, key, and form properties. + * @since 3.2.0 + */ + protected function getSiteEditViews(?array $views): array + { + $siteEditViews = []; + + // Return early if no views are provided. + if (empty($views)) + { + return $siteEditViews; + } + + foreach ($views as $view) + { + // Check if the view is marked for edit/create on the site. + if (!empty($view['edit_create_site_view'])) + { + $siteEditViews[] = (object) [ + 'view' => $view['settings']->name_single_code, + 'View' => StringHelper::safe($view['settings']->name_single_code, 'F'), + 'stable' => true, + 'target_view' => $view['settings']->name_single_code, + 'table' => '#__' . $this->config->component_code_name . '_' . $view['settings']->name_single_code, + 'alias' => $this->getSiteEditViewAliasKey($view['settings']->fields ?? null), + 'key' => 'id', + 'form' => true + ]; + } + } + + return $siteEditViews; + } + + /** + * Get the site edit view alias key value + * + * This method fetches the alias keys for a given site edit view by matching the view name + * against a list of admin views. It processes the admin views to find a match and then + * retrieves the alias keys from the matched view's settings. + * + * @param string|null $viewName The view name to match. + * @param array $adminViews The admin views to search within. + * + * @return string|null The alias key for the site edit view, or null if not found. + * @since 3.2.0 + */ + protected function getSiteViewAliasKey(?string $viewName, array $adminViews): ?string + { + // Return early if no view name is provided or admin views are empty. + if ($viewName === null || empty($adminViews)) + { + return null; + } + + foreach ($adminViews as $view) + { + // Check if the current view matches the specified view name and has fields defined. + if ($view['settings']->name_single_code === $viewName && is_array($view['settings']->fields ?? null)) + { + // If a match is found, retrieve and return the site edit view alias keys. + return $this->getSiteEditViewAliasKey($view['settings']->fields); + } + } + + // Return an empty array if no matching view is found. + return null; + } + + /** + * Get the site view alias key value + * + * @param array|null $fields The main get object + * + * @return string|null + * @since 3.2.0 + */ + protected function getSiteEditViewAliasKey(?array $fields): ?string + { + if ($fields !== null) + { + foreach ($fields as $field) + { + if (isset($field['alias']) && $field['alias'] && $field['type_name'] === 'text') + { + return $field['base_name']; + } + } + } + + return null; + } + + /** + * Get the view (main selection) table and view name value + * from the main get object + * + * @param array|null $gets The main get objects + * + * @return array + * @since 3.2.0 + */ + protected function getMainSelection(?array $gets): array + { + if ($gets !== null) + { + foreach ($gets as $get) + { + // get the main table + if (isset($get['as']) + && $get['as'] === 'a' + && isset($get['selection']) + && ArrayHelper::check($get['selection']) + && isset($get['selection']['select_gets']) + && ArrayHelper::check($get['selection']['select_gets']) + && isset($get['selection']['name']) && isset($get['selection']['table'])) + { + $name = $get['selection']['name']; + $view = $get['selection']['view']; + $table = $get['selection']['table']; + + return ['table' => $table, 'view' => $view, 'name' => $name]; + } + } + } + + return []; + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Sqldump.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Sqldump.php index e6ed67572..bc76ac23e 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Sqldump.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Sqldump.php @@ -38,10 +38,9 @@ class Sqldump /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -51,10 +50,10 @@ class Sqldump * @since 3.2.0 */ - public function __construct(?Registry $registry = null, ?\JDatabaseDriver $db = null) + public function __construct(?Registry $registry = null) { $this->registry = $registry ?: Compiler::_('Registry'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** 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 314ae6a25..738ec5684 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php @@ -144,18 +144,16 @@ class Power implements PowerInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. @@ -165,23 +163,20 @@ class Power implements PowerInterface * @param Customcode|null $customcode The compiler customcode object. * @param Gui|null $gui The compiler customcode gui object. * @param Superpower|null $superpower The JCB superpower 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, ?Placeholder $placeholder = null, - ?Customcode $customcode = null, ?Gui $gui = null, ?Superpower $superpower = null, - ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + ?Customcode $customcode = null, ?Gui $gui = null, ?Superpower $superpower = null) { $this->config = $config ?: Compiler::_('Config'); $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); $this->customcode = $customcode ?: Compiler::_('Customcode'); $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->superpower = $superpower ?: Compiler::_('Superpower'); - $this->db = $db ?: Factory::getDbo(); - $this->app = $app ?: Factory::getApplication(); + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php index 2a0dec87e..5135b5088 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php @@ -282,8 +282,8 @@ class Autoloader // we start building the spl_autoload_register function call $autoload_method = []; $autoload_method[] = Indent::_($tabSpace) . '//' - . Line::_(__Line__, __Class__) . ' register this component namespace'; - $autoload_method[] = Indent::_($tabSpace) . 'spl_autoload_register(function ($class) {'; + . Line::_(__Line__, __Class__) . ' register additional namespace'; + $autoload_method[] = Indent::_($tabSpace) . '\spl_autoload_register(function ($class) {'; $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$search = ['; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Extractor.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Extractor.php index b1b0c5287..8dafcfb60 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Extractor.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Extractor.php @@ -41,20 +41,18 @@ final class Extractor /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor * - * @param \JDatabaseDriver|null $db The database object. * @since 3.2.0 */ - public function __construct(?\JDatabaseDriver $db = null) + public function __construct() { - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Infusion.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Infusion.php index ed1ed4100..41e97e7d4 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Infusion.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Infusion.php @@ -16,7 +16,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Power; use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne as Content; use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti as Contents; -use VDM\Joomla\Componentbuilder\Compiler\Power\Autoloader; use VDM\Joomla\Componentbuilder\Compiler\Power\Parser; use VDM\Joomla\Componentbuilder\Compiler\Power\Repo\Readme as RepoReadme; use VDM\Joomla\Componentbuilder\Compiler\Power\Repos\Readme as ReposReadme; @@ -65,14 +64,6 @@ class Infusion */ protected Contents $contents; - /** - * The Autoloader Class. - * - * @var Autoloader - * @since 3.2.0 - */ - protected Autoloader $autoloader; - /** * The Parser Class. * @@ -140,6 +131,30 @@ class Infusion 'unchanged_licensing_template' => 'licensing_template' ]; + /** + * Power Infusion Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $done = []; + + /** + * Power Content Infusion Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $content_done = []; + + /** + * Path Infusion Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $path_done = []; + /** * Constructor. * @@ -147,7 +162,6 @@ class Infusion * @param Power $power The Power Class. * @param Content $content The ContentOne Class. * @param Contents $contents The ContentMulti Class. - * @param Autoloader $autoloader The Autoloader Class. * @param Parser $parser The Parser Class. * @param RepoReadme $reporeadme The Readme Class. * @param ReposReadme $reposreadme The Readme Class. @@ -157,8 +171,7 @@ class Infusion * @since 3.2.0 */ public function __construct(Config $config, Power $power, Content $content, - Contents $contents, Autoloader $autoloader, - Parser $parser, RepoReadme $reporeadme, + Contents $contents, Parser $parser, RepoReadme $reporeadme, ReposReadme $reposreadme, Placeholder $placeholder, Event $event) { @@ -166,7 +179,6 @@ class Infusion $this->power = $power; $this->content = $content; $this->contents = $contents; - $this->autoloader = $autoloader; $this->parser = $parser; $this->reporeadme = $reporeadme; $this->reposreadme = $reposreadme; @@ -203,8 +215,13 @@ class Infusion // we only do this if super powers are active if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers)) { - foreach ($this->power->active as $n => &$power) + foreach ($this->power->active as $guid => &$power) { + if (isset($this->done[$guid])) + { + continue; + } + if (ObjectHelper::check($power) && isset($power->main_class_code) && StringHelper::check($power->main_class_code)) { @@ -215,6 +232,9 @@ class Infusion $power->parsed_class_code = $this->parser->code($power->main_class_code); } } + + // do each power just once + $this->done[$guid] = true; } } } @@ -230,17 +250,18 @@ class Infusion // infuse super powers details if set if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers)) { - // TODO we need to update the event signatures - $context = $this->config->component_context; - foreach ($this->power->superpowers as $path => $powers) { + if (isset($this->path_done[$path])) + { + continue; + } + $key = StringHelper::safe($path); // Trigger Event: jcb_ce_onBeforeInfuseSuperPowerDetails $this->event->trigger( - 'jcb_ce_onBeforeInfuseSuperPowerDetails', - array(&$context, &$path, &$key, &$powers) + 'jcb_ce_onBeforeInfuseSuperPowerDetails', [&$path, &$key, &$powers] ); // we add and all missing powers @@ -260,9 +281,11 @@ class Infusion // Trigger Event: jcb_ce_onAfterInfuseSuperPowerDetails $this->event->trigger( - 'jcb_ce_onAfterInfuseSuperPowerDetails', - array(&$context, &$path, &$key, &$powers) + 'jcb_ce_onAfterInfuseSuperPowerDetails', [&$path, &$key, &$powers] ); + + // do each path just once + $this->path_done[$path] = true; } } } @@ -306,17 +329,18 @@ class Infusion // infuse powers data if set if (ArrayHelper::check($this->power->active)) { - // TODO we need to update the event signatures - $context = $this->config->component_context; - - foreach ($this->power->active as $power) + foreach ($this->power->active as $guid => $power) { + if (isset($this->content_done[$guid])) + { + continue; + } + if (ObjectHelper::check($power)) { // Trigger Event: jcb_ce_onBeforeInfusePowerData $this->event->trigger( - 'jcb_ce_onBeforeInfusePowerData', - array(&$context, &$power) + 'jcb_ce_onBeforeInfusePowerData', [&$power] ); // POWERCODE @@ -333,14 +357,13 @@ class Infusion // Trigger Event: jcb_ce_onAfterInfusePowerData $this->event->trigger( - 'jcb_ce_onAfterInfusePowerData', - array(&$context, &$power) + 'jcb_ce_onAfterInfusePowerData', [&$power] ); } - } - // now set the power autoloader - $this->autoloader->set(); + // do each power just once + $this->content_done[$guid] = true; + } } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Injector.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Injector.php index e650f4b71..246a7acfd 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Injector.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Injector.php @@ -81,6 +81,22 @@ final class Injector */ protected array $traits = []; + /** + * Other Statements + * + * @var array + * @since 3.2.0 + */ + protected array $other = []; + + /** + * Duplicate Statements + * + * @var array + * @since 3.2.0 + */ + protected array $duplicate = []; + /** * Constructor. * @@ -138,6 +154,8 @@ final class Injector $this->map = []; $this->useStatements = []; $this->traits = []; + $this->other = []; + $this->duplicate = []; foreach ($guids as $key => $guid) { @@ -165,168 +183,200 @@ final class Injector } /** - * inspect the super power + * Inspect the super power to determine the necessary class name based on use statements and traits. + * It checks if the given power (class, trait, etc.) already has a corresponding use statement + * and handles the naming accordingly to avoid conflicts. * - * @param object|null $power The power object. - * @param array|null $useStatements The code use statments - * @param array|null $traits The code traits use statments + * @param object $power The power object containing type, namespace, and class name. + * @param array|null $useStatements Array of existing use statements in the code. + * @param array|null $traits Array of existing traits used in the code. * - * @return string|null The class name (or as name) + * @return string|null The determined class name, or null if the type is not valid. * @since 3.2.0 */ protected function inspect(object $power, ?array $useStatements, ?array $traits): ?string { - if (isset($power->type) && in_array($power->type, ['class', 'abstract class', 'final class', 'trait'])) - { - $statement = 'use ' . $power->_namespace . '\\' . $power->class_name; - // other class names - $use_other = []; - $trait_other = []; - // some tracker globals - $has_use_statement = false; // add if not found - $has_trait_statement = !('trait' === $power->type); // don't add if not trait - $name = null; - $trait_name = null; + $namespaceStatement = $this->buildNamespaceStatment($power); - // check if the name space is loaded - if ($useStatements !== null) + $use_extracted = $this->extractUseStatements($namespaceStatement, $power->class_name, $useStatements); + + $name = $use_extracted['found'] ?? $power->class_name; + + $name = $this->getUniqueName($name, $power); + + $this->handleTraitLogic($name, $power, $traits); + + if (!$use_extracted['hasStatement']) + { + $this->addUseStatement($name, $power->class_name, $namespaceStatement); + } + + return $name; + } + + /** + * Builds the namespace statement from the power object's namespace and class name. + * + * @param object $power The power object. + * + * @return string The constructed use statement. + * @since 3.2.0 + */ + protected function buildNamespaceStatment(object $power): string + { + return $power->_namespace . '\\' . $power->class_name; + } + + /** + * Extracts and processes use statements to find if the current class name is already used. + * It identifies any potential naming conflicts. + * + * @param string $useStatement The search statement of the current class. + * @param string $className The class name of the power object. + * @param array|null $useStatements The existing use statements. + * + * @return array An array with keys 'found' and 'hasStatement'. + * @since 3.2.0 + */ + protected function extractUseStatements(string $useStatement, string $className, ?array $useStatements): array + { + $results = ['found' => null, 'hasStatement' => false]; + + if ($useStatements !== null) + { + foreach ($useStatements as $use_statement) { - foreach ($useStatements as $use_statement) + $class_name = $this->extractClassNameOrAlias($use_statement); + + if ($this->isUseStatementEqual($use_statement, $useStatement)) { - if ($use_statement === $statement . ';' || strpos($use_statement, $statement . ' as ') !== false) + if ($results['found'] === null) { - $name = $this->getName($use_statement); - $has_use_statement = true; + $results['found'] = $class_name; + $results['hasStatement'] = true; } else { - $tmp = $this->getName($use_statement); - if ($power->class_name === $tmp) - { - $use_other[$tmp] = $tmp; - } + // TODO we need to backport fix these + $this->duplicate[$use_statement] = $class_name; } } - } - - // check if the trait is loaded - if (!$has_trait_statement && $traits !== null) - { - $trait_statement = $name ?? $power->class_name; - - foreach ($traits as $trait) + elseif ($className === $class_name) { - if ($trait === $trait_statement) - { - $trait_name = $trait; - $has_trait_statement = true; - } + $this->other[$className] = $class_name; } } - - // build the name - $name = $trait_name ?? $name ?? $power->class_name; - - // if we have a trait we may need to add use and trait - if ('trait' === $power->type) - { - if (!$has_trait_statement) - { - $this->traits[$name] = 'use ' . $name . ';'; - } - } - - // check if we need to update the name - if ($use_other !== []) - { - // set search namespace - $namespace = ($name !== $power->class_name) ? $power->_namespace . '\\' . $power->class_name : $power->_namespace; - - // get the unique name - $name = $this->getUniqueName($name, $namespace, $use_other); - } - - if (!$has_use_statement) - { - // if the name is not the same as class name - if ($name !== $power->class_name) - { - $statement .= ' as ' . $name . ';'; - } - else - { - $statement .= ';'; - } - - $this->useStatements[$name] = $statement; - } - - return $name; } - return null; + return $results; } /** - * Extracts the class name from a use statement. + * Checks if the namespace statement is already declared in the current use statements. * - * @param string $useStatement The use statement from which to extract the class name + * This method uses a regular expression to check for an exact match of the full statement, + * taking into account the possibility of an alias being used. * - * @return string|null The class name or null if not found + * @param string $useStatement The existing use statement to check against. + * @param string $namespaceStatement The search statement to search for (without the trailing semicolon, or use prefix). + * + * @return bool True if the full statement is found, false otherwise. + */ + protected function isUseStatementEqual(string $useStatement, string $namespaceStatement): bool + { + // Create a regular expression pattern to match the full statement + // The pattern checks for the start of the statement, optional whitespace, + // and an optional alias after the full statement. + $pattern = '/^use\s+' . preg_quote($namespaceStatement, '/') . '(?:\s+as\s+\w+)?;$/'; + + // Perform the regex match to check if the use statement is equal to the search statment + return (bool) preg_match($pattern, $useStatement); + } + + /** + * Extracts the class name or alias from a use statement. + * + * This method parses a PHP 'use' statement and extracts either the class name or its alias. + * If the statement doesn't match the expected format, or if no class name or alias is found, + * the method returns null. + * + * Example: + * - 'use Namespace\ClassName;' -> returns 'ClassName' + * - 'use Namespace\ClassName as Alias;' -> returns 'Alias' + * + * @param string $useStatement The use statement from which to extract the class name or alias. + * + * @return string|null The class name or alias if found, null otherwise. * @since 3.2.0 */ - protected function getName(string $useStatement): ?string + protected function extractClassNameOrAlias(string $useStatement): ?string { - // If the input doesn't start with 'use ', assume it's a class name without a use statement + // If the input doesn't start with 'use ', assume it's just the namespace without a use statement if (strpos($useStatement, 'use ') !== 0) { - $parts = explode('\\', $useStatement); - $result = end($parts); - - // Remove '\\' from the beginning and end of the resulting string - $result = trim($result, '\\'); - - // If the resulting string is empty, return null - return empty($result) ? null : $result; + return $this->extractLastNameFromNamespace($useStatement); } - $pattern = '/use\s+([\w\\\\]+)(?:\s+as\s+)?([\w]+)?;/'; + // Regular expression to extract the class name and alias from the use statement + $pattern = '/use\s+(?P[\w\\\\]+?)(?:\s+as\s+(?P\w+))?;/'; if (preg_match($pattern, $useStatement, $matches)) { - // If there's an alias, return it - if (!empty($matches[2])) - { - return $matches[2]; - } - - // If there's no alias, extract the class name from the namespace - $parts = explode('\\', $matches[1]); - return end($parts); + // Return the alias if it exists; otherwise, return the last part of the namespace (class name) + return $matches['alias'] ?? $this->extractLastNameFromNamespace($matches['namespace']); } + // Return null if no match is found return null; } /** - * Removes the last space from the namespace. + * Ensures the name for the use statement is unique, avoiding conflicts with other classes. * - * @param string $name The current name - * @param string $namespace The namespace - * @param array $useOther The other use names + * @param string $name The current name + * @param object $power The power object containing type, namespace, and class name. * - * @return string The namespace shortened + * @return string The unique name * @since 3.2.0 */ - protected function getUniqueName(string $name, string $namespace, array $useOther): string + protected function getUniqueName(string $name, object $power): string { - // if the name is already used - while (isset($useOther[$name])) + // set search namespace + $namespace = ($name !== $power->class_name) ? $this->buildNamespaceStatment($power) : $power->_namespace; + + // check if we need to update the name + if (isset($this->other[$name])) { - if (($tmp = $this->getName($namespace)) !== null) + // if the name is already used + while (isset($this->other[$name])) { - $name = ucfirst($tmp) . $name; - $namespace = $this->removeLastSpace($namespace); + if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null) + { + $name = ucfirst($tmp) . $name; + $namespace = $this->removeLastNameFromNamespace($namespace); + } + else + { + $name = 'Unique' . $name; + } + } + } + + // also loop new found use statements + if (isset($this->useStatements[$name])) + { + // if the name is already used + while (isset($this->useStatements[$name])) + { + if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null) + { + $name = ucfirst($tmp) . $name; + $namespace = $this->removeLastNameFromNamespace($namespace); + } + else + { + $name = 'Unique' . $name; + } } } @@ -334,14 +384,34 @@ final class Injector } /** - * Removes the last space from the namespace. + * Extracts the last part of a namespace string, which is typically the class name. + * + * @param string $namespace The namespace string to extract from. + * + * @return string|null The extracted class name. + * @since 3.2.0 + */ + protected function extractLastNameFromNamespace(string $namespace): ?string + { + $parts = explode('\\', $namespace); + $result = end($parts); + + // Remove '\\' from the beginning and end of the resulting string + $result = trim($result, '\\'); + + // If the resulting string is empty, return null + return empty($result) ? null : $result; + } + + /** + * Removes the last name from the namespace. * * @param string $namespace The namespace * * @return string The namespace shortened * @since 3.2.0 */ - protected function removeLastSpace(string $namespace): string + protected function removeLastNameFromNamespace(string $namespace): string { // Remove '\\' from the beginning and end of the resulting string $namespace = trim($namespace, '\\'); @@ -355,6 +425,69 @@ final class Injector return implode('\\', $parts); } + /** + * Determines whether a trait statement should be added. + * + * @param object $power The power object. + * + * @return bool True if a trait statement should be added, false otherwise. + * @since 3.2.0 + */ + protected function shouldAddTraitStatement(object $power): bool + { + return $power->type === 'trait'; + } + + /** + * Handles specific logic for traits, such as checking if the trait is already used. + * + * @param string $name The current name. + * @param object $power The power object containing type, namespace, and class name. + * @param array|null $traits The traits used in the code. + * + * @return void + * @since 3.2.0 + */ + protected function handleTraitLogic(string $name, object $power, ?array $traits): void + { + if ($this->shouldAddTraitStatement($power) && $traits !== null) + { + foreach ($traits as $trait) + { + if ($trait === $name) + { + return; + } + } + } + + // add the trait + $this->traits[$name] = 'use ' . $name . ';'; + } + + /** + * Adds a use statement to the class if it's not already present. + * + * @param string $name The name to use. + * @param string $className The class name of the power object. + * @param string $namespaceStatement The search statement to search for (without the trailing semicolon, or use prefix). + * + * @since 3.2.0 + */ + protected function addUseStatement(string &$name, string $className, string $namespaceStatement): void + { + if ($name !== $className) + { + $statement = 'use ' . $namespaceStatement . ' as ' . $name . ';'; + } + else + { + $statement = 'use ' . $namespaceStatement . ';'; + } + + $this->useStatements[$name] = $statement; + } + /** * Insert a line before the class declaration in the given class code. * @@ -405,7 +538,7 @@ final class Injector // Find the position of the comment block right before the class declaration $comment_pattern = '/\s*\*\/\s*$/m'; $insert_pos = null; - if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, 0, $last_newline_pos)) + if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, $last_newline_pos)) { $insert_pos = (int) $comment_matches[0][1] + strlen($comment_matches[0][0]); } @@ -413,7 +546,7 @@ final class Injector { // Find the last empty line before the class declaration $empty_line_pattern = '/(^|\r\n|\r|\n)[\s]*($|\r\n|\r|\n)/'; - if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, 0, $last_newline_pos)) + if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, $last_newline_pos)) { $insert_pos = (int) $empty_line_matches[0][1] + strlen($empty_line_matches[0][0]); } @@ -444,7 +577,9 @@ final class Injector // Patterns to match the defined('_JEXEC') and defined('JPATH_BASE') lines $patterns = [ "/defined\('_JEXEC'\)(.*?)\s*;/", + "/\\defined\('_JEXEC'\)(.*?)\s*;/", "/defined\('JPATH_BASE'\)(.*?)\s*;/", + "/\\defined\('JPATH_BASE'\)(.*?)\s*;/", ]; $insert_pos = null; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php index 6178083d6..da6862daa 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php @@ -48,6 +48,22 @@ class Structure **/ protected array $htaccess = []; + /** + * Power Build Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $done = []; + + /** + * Path Build Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $path_done = []; + /** * Power Objects * @@ -172,22 +188,21 @@ class Structure { if (ArrayHelper::check($this->power->active)) { - // for plugin event TODO change event api signatures - $powers = $this->power->active; - $component_context = $this->config->component_context; // Trigger Event: jcb_ce_onBeforeSetModules $this->event->trigger( - 'jcb_ce_onBeforeBuildPowers', - array(&$component_context, &$powers) + 'jcb_ce_onBeforeBuildPowers' ); - // for plugin event TODO change event api signatures - $this->power->active = $powers; // set super power details $this->setSuperPowerDetails(); - foreach ($this->power->active as $power) + foreach ($this->power->active as $guid => $power) { + if (isset($this->done[$guid])) + { + continue; + } + if (ObjectHelper::check($power) && isset($power->path) && StringHelper::check( @@ -232,6 +247,9 @@ class Structure // set htaccess once per path $this->setHtaccess($power); + + // do each power just once + $this->done[$guid] = true; } } } @@ -347,6 +365,14 @@ class Structure // check if we should add the dynamic folder moving script to the installer script if (!$this->registry->get('set_move_folders_install_script')) { + $function = 'setDynamicF0ld3rs'; + $script = 'script.php'; + if ($this->config->get('joomla_version', 3) != 3) + { + $function = 'moveFolders'; + $script = 'ComponentnameInstallerScript.php'; + } + // add the setDynamicF0ld3rs() method to the install script.php file $this->registry->set('set_move_folders_install_script', true); @@ -356,7 +382,9 @@ class Structure 'Notice' ); $this->app->enqueueMessage( - Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_SETDYNAMICFZEROLDTHREERS_WAS_ADDED_TO_THE_INSTALL_BSCRIPTPHPB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED'), + Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_S_WAS_ADDED_TO_THE_INSTALL_BSB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED', + $function, $script + ), 'Notice' ); } @@ -374,6 +402,11 @@ class Structure { foreach ($this->power->superpowers as $path => $powers) { + if (isset($this->path_done[$path])) + { + continue; + } + // get existing files $this->loadExistingSuperPower($path); @@ -389,6 +422,9 @@ class Structure // set the super power index file $this->createFile(Placefix::_h('POWERINDEX'), $path, 'super-powers.json', $key); + + // do each path just once + $this->path_done[$path] = true; } } } @@ -440,7 +476,7 @@ class Structure */ private function loadExistingSuperPower(string $repository) { - if (($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null && + if (!isset($this->power->old_superpowers[$repository]) && ($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null && JsonHelper::check($content)) { $this->power->old_superpowers[$repository] = json_decode($content, true); diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureController.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureController.php new file mode 100644 index 000000000..dbe542e52 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureController.php @@ -0,0 +1,177 @@ + + * @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\Architecture\Controller\AllowAddInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowAdd as J4ControllerAllowAdd; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowAdd as J3ControllerAllowAdd; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowEdit as J4ControllerAllowEdit; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowEdit as J3ControllerAllowEdit; + + +/** + * Architecture Controller Service Provider + * + * @since 3.2.0 + */ +class ArchitectureController 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(AllowAddInterface::class, 'Architecture.Controller.AllowAdd') + ->share('Architecture.Controller.AllowAdd', [$this, 'getAllowAdd'], true); + + $container->alias(J4ControllerAllowAdd::class, 'Architecture.Controller.J4.AllowAdd') + ->share('Architecture.Controller.J4.AllowAdd', [$this, 'getJ4ControllerAllowAdd'], true); + + $container->alias(J3ControllerAllowAdd::class, 'Architecture.Controller.J3.AllowAdd') + ->share('Architecture.Controller.J3.AllowAdd', [$this, 'getJ3ControllerAllowAdd'], true); + + $container->alias(AllowEditInterface::class, 'Architecture.Controller.AllowEdit') + ->share('Architecture.Controller.AllowEdit', [$this, 'getAllowEdit'], true); + + $container->alias(J4ControllerAllowEdit::class, 'Architecture.Controller.J4.AllowEdit') + ->share('Architecture.Controller.J4.AllowEdit', [$this, 'getJ4ControllerAllowEdit'], true); + + $container->alias(J3ControllerAllowEdit::class, 'Architecture.Controller.J3.AllowEdit') + ->share('Architecture.Controller.J3.AllowEdit', [$this, 'getJ3ControllerAllowEdit'], true); + } + + /** + * Get The AllowAddInterface Class. + * + * @param Container $container The DI container. + * + * @return AllowAddInterface + * @since 3.2.0 + */ + public function getAllowAdd(Container $container): AllowAddInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowAdd'); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J4ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ4ControllerAllowAdd(Container $container): J4ControllerAllowAdd + { + return new J4ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J3ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ3ControllerAllowAdd(Container $container): J3ControllerAllowAdd + { + return new J3ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowEditInterface Class. + * + * @param Container $container The DI container. + * + * @return AllowEditInterface + * @since 3.2.0 + */ + public function getAllowEdit(Container $container): AllowEditInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowEdit'); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J4ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ4ControllerAllowEdit(Container $container): J4ControllerAllowEdit + { + return new J4ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J3ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ3ControllerAllowEdit(Container $container): J3ControllerAllowEdit + { + return new J3ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureModel.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureModel.php new file mode 100644 index 000000000..5e87d154d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureModel.php @@ -0,0 +1,169 @@ + + * @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\Architecture\Model\CanDeleteInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanDelete as J4ModelCanDelete; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanDelete as J3ModelCanDelete; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanEditState as J4ModelCanEditState; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanEditState as J3ModelCanEditState; + + +/** + * Architecture Model Service Provider + * + * @since 3.2.0 + */ +class ArchitectureModel 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(J3ModelCanDelete::class, 'Architecture.Model.J3.CanDelete') + ->share('Architecture.Model.J3.CanDelete', [$this, 'getJ3ModelCanDelete'], true); + + $container->alias(J4ModelCanDelete::class, 'Architecture.Model.J4.CanDelete') + ->share('Architecture.Model.J4.CanDelete', [$this, 'getJ4ModelCanDelete'], true); + + $container->alias(CanDeleteInterface::class, 'Architecture.Model.CanDelete') + ->share('Architecture.Model.CanDelete', [$this, 'getModelCanDelete'], true); + + $container->alias(J3ModelCanEditState::class, 'Architecture.Model.J3.CanEditState') + ->share('Architecture.Model.J3.CanEditState', [$this, 'getJ3ModelCanEditState'], true); + + $container->alias(J4ModelCanEditState::class, 'Architecture.Model.J4.CanEditState') + ->share('Architecture.Model.J4.CanEditState', [$this, 'getJ4ModelCanEditState'], true); + + $container->alias(CanEditStateInterface::class, 'Architecture.Model.CanEditState') + ->share('Architecture.Model.CanEditState', [$this, 'getModelCanEditState'], true); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return CanDeleteInterface + * @since 3.2.0 + */ + public function getModelCanDelete(Container $container): CanDeleteInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanDelete'); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J4ModelCanDelete + * @since 3.2.0 + */ + public function getJ4ModelCanDelete(Container $container): J4ModelCanDelete + { + return new J4ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J3ModelCanDelete + * @since 3.2.0 + */ + public function getJ3ModelCanDelete(Container $container): J3ModelCanDelete + { + return new J3ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return CanEditStateInterface + * @since 3.2.0 + */ + public function getModelCanEditState(Container $container): CanEditStateInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanEditState'); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J4ModelCanEditState + * @since 3.2.0 + */ + public function getJ4ModelCanEditState(Container $container): J4ModelCanEditState + { + return new J4ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J3ModelCanEditState + * @since 3.2.0 + */ + public function getJ3ModelCanEditState(Container $container): J3ModelCanEditState + { + return new J3ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderAJ.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderAJ.php new file mode 100644 index 000000000..61eae650f --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderAJ.php @@ -0,0 +1,870 @@ + + * @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\Builder\AccessSwitch; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AssetsRules; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Alias; +use VDM\Joomla\Componentbuilder\Compiler\Builder\BaseSixFour; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryCode; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CheckBox; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ComponentFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Contributors; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomAlias; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomField; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomFieldLinks; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseKeys; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseTables; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueGuid; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueKeys; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUninstall; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DoNotEscape; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DynamicFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionCustomFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldNames; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldRelations; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FootableScripts; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FrontendParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GetAsLookup; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GetModule; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GoogleChart; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HasMenuGlobal; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HasPermissions; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HiddenFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\History; +use VDM\Joomla\Componentbuilder\Compiler\Builder\IntegerFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodEximportString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodListString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItem; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItemArray; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonString; + + +/** + * Builder A-J Service Provider + * + * @since 3.2.0 + */ +class BuilderAJ 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(AccessSwitch::class, 'Compiler.Builder.Access.Switch') + ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); + + $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') + ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); + + $container->alias(AssetsRules::class, 'Compiler.Builder.Assets.Rules') + ->share('Compiler.Builder.Assets.Rules', [$this, 'getAssetsRules'], true); + + $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') + ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); + + $container->alias(Alias::class, 'Compiler.Builder.Alias') + ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); + + $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') + ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); + + $container->alias(Category::class, 'Compiler.Builder.Category') + ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); + + $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') + ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); + + $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') + ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); + + $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') + ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); + + $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') + ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Builder.Config.Fieldsets') + ->share('Compiler.Builder.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Builder.Config.Fieldsets.Customfield') + ->share('Compiler.Builder.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') + ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); + + $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') + ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); + + $container->alias(Contributors::class, 'Compiler.Builder.Contributors') + ->share('Compiler.Builder.Contributors', [$this, 'getContributors'], true); + + $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') + ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); + + $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') + ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); + + $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') + ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); + + $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') + ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); + + $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') + ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); + + $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') + ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); + + $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') + ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); + + $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') + ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); + + $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') + ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); + + $container->alias(DatabaseUninstall::class, 'Compiler.Builder.Database.Uninstall') + ->share('Compiler.Builder.Database.Uninstall', [$this, 'getDatabaseUninstall'], true); + + $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') + ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); + + $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') + ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); + + $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') + ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); + + $container->alias(ExtensionsParams::class, 'Compiler.Builder.Extensions.Params') + ->share('Compiler.Builder.Extensions.Params', [$this, 'getExtensionsParams'], true); + + $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') + ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); + + $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') + ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); + + $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') + ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); + + $container->alias(Filter::class, 'Compiler.Builder.Filter') + ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); + + $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') + ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); + + $container->alias(FrontendParams::class, 'Compiler.Builder.Frontend.Params') + ->share('Compiler.Builder.Frontend.Params', [$this, 'getFrontendParams'], true); + + $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') + ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); + + $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') + ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); + + $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') + ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); + + $container->alias(HasMenuGlobal::class, 'Compiler.Builder.Has.Menu.Global') + ->share('Compiler.Builder.Has.Menu.Global', [$this, 'getHasMenuGlobal'], true); + + $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') + ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); + + $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') + ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); + + $container->alias(History::class, 'Compiler.Builder.History') + ->share('Compiler.Builder.History', [$this, 'getHistory'], true); + + $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') + ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); + + $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') + ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); + + $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') + ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); + + $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') + ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); + + $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') + ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); + + $container->alias(JsonString::class, 'Compiler.Builder.Json.String') + ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); + } + + /** + * Get The AccessSwitch Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitch + * @since 3.2.0 + */ + public function getAccessSwitch(Container $container): AccessSwitch + { + return new AccessSwitch(); + } + + /** + * Get The AccessSwitchList Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitchList + * @since 3.2.0 + */ + public function getAccessSwitchList(Container $container): AccessSwitchList + { + return new AccessSwitchList(); + } + + /** + * Get The AssetsRules Class. + * + * @param Container $container The DI container. + * + * @return AssetsRules + * @since 3.2.0 + */ + public function getAssetsRules(Container $container): AssetsRules + { + return new AssetsRules(); + } + + /** + * Get The AdminFilterType Class. + * + * @param Container $container The DI container. + * + * @return AdminFilterType + * @since 3.2.0 + */ + public function getAdminFilterType(Container $container): AdminFilterType + { + return new AdminFilterType(); + } + + /** + * Get The Alias Class. + * + * @param Container $container The DI container. + * + * @return Alias + * @since 3.2.0 + */ + public function getAlias(Container $container): Alias + { + return new Alias(); + } + + /** + * Get The BaseSixFour Class. + * + * @param Container $container The DI container. + * + * @return BaseSixFour + * @since 3.2.0 + */ + public function getBaseSixFour(Container $container): BaseSixFour + { + return new BaseSixFour(); + } + + /** + * Get The Category Class. + * + * @param Container $container The DI container. + * + * @return Category + * @since 3.2.0 + */ + public function getCategory(Container $container): Category + { + return new Category(); + } + + /** + * Get The CategoryCode Class. + * + * @param Container $container The DI container. + * + * @return CategoryCode + * @since 3.2.0 + */ + public function getCategoryCode(Container $container): CategoryCode + { + return new CategoryCode(); + } + + /** + * Get The CategoryOtherName Class. + * + * @param Container $container The DI container. + * + * @return CategoryOtherName + * @since 3.2.0 + */ + public function getCategoryOtherName(Container $container): CategoryOtherName + { + return new CategoryOtherName(); + } + + /** + * Get The CheckBox Class. + * + * @param Container $container The DI container. + * + * @return CheckBox + * @since 3.2.0 + */ + public function getCheckBox(Container $container): CheckBox + { + return new CheckBox(); + } + + /** + * Get The ComponentFields Class. + * + * @param Container $container The DI container. + * + * @return ComponentFields + * @since 3.2.0 + */ + public function getComponentFields(Container $container): ComponentFields + { + return new ComponentFields(); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets(); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield(); + } + + /** + * Get The ContentMulti Class. + * + * @param Container $container The DI container. + * + * @return ContentMulti + * @since 3.2.0 + */ + public function getContentMulti(Container $container): ContentMulti + { + return new ContentMulti(); + } + + /** + * Get The ContentOne Class. + * + * @param Container $container The DI container. + * + * @return ContentOne + * @since 3.2.0 + */ + public function getContentOne(Container $container): ContentOne + { + return new ContentOne(); + } + + /** + * Get The Contributors Class. + * + * @param Container $container The DI container. + * + * @return Contributors + * @since 3.2.0 + */ + public function getContributors(Container $container): Contributors + { + return new Contributors(); + } + + /** + * Get The CustomAlias Class. + * + * @param Container $container The DI container. + * + * @return CustomAlias + * @since 3.2.0 + */ + public function getCustomAlias(Container $container): CustomAlias + { + return new CustomAlias(); + } + + /** + * Get The CustomField Class. + * + * @param Container $container The DI container. + * + * @return CustomField + * @since 3.2.0 + */ + public function getCustomField(Container $container): CustomField + { + return new CustomField(); + } + + /** + * Get The CustomFieldLinks Class. + * + * @param Container $container The DI container. + * + * @return CustomFieldLinks + * @since 3.2.0 + */ + public function getCustomFieldLinks(Container $container): CustomFieldLinks + { + return new CustomFieldLinks(); + } + + /** + * Get The CustomList Class. + * + * @param Container $container The DI container. + * + * @return CustomList + * @since 3.2.0 + */ + public function getCustomList(Container $container): CustomList + { + return new CustomList(); + } + + /** + * Get The CustomTabs Class. + * + * @param Container $container The DI container. + * + * @return CustomTabs + * @since 3.2.0 + */ + public function getCustomTabs(Container $container): CustomTabs + { + return new CustomTabs(); + } + + /** + * Get The DatabaseKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseKeys + * @since 3.2.0 + */ + public function getDatabaseKeys(Container $container): DatabaseKeys + { + return new DatabaseKeys(); + } + + /** + * Get The DatabaseTables Class. + * + * @param Container $container The DI container. + * + * @return DatabaseTables + * @since 3.2.0 + */ + public function getDatabaseTables(Container $container): DatabaseTables + { + return new DatabaseTables(); + } + + /** + * Get The DatabaseUniqueGuid Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueGuid + * @since 3.2.0 + */ + public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid + { + return new DatabaseUniqueGuid(); + } + + /** + * Get The DatabaseUniqueKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueKeys + * @since 3.2.0 + */ + public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys + { + return new DatabaseUniqueKeys(); + } + + /** + * Get The DatabaseUninstall Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUninstall + * @since 3.2.0 + */ + public function getDatabaseUninstall(Container $container): DatabaseUninstall + { + return new DatabaseUninstall(); + } + + /** + * Get The DoNotEscape Class. + * + * @param Container $container The DI container. + * + * @return DoNotEscape + * @since 3.2.0 + */ + public function getDoNotEscape(Container $container): DoNotEscape + { + return new DoNotEscape(); + } + + /** + * Get The DynamicFields Class. + * + * @param Container $container The DI container. + * + * @return DynamicFields + * @since 3.2.0 + */ + public function getDynamicFields(Container $container): DynamicFields + { + return new DynamicFields(); + } + + /** + * Get The ExtensionCustomFields Class. + * + * @param Container $container The DI container. + * + * @return ExtensionCustomFields + * @since 3.2.0 + */ + public function getExtensionCustomFields(Container $container): ExtensionCustomFields + { + return new ExtensionCustomFields(); + } + + /** + * Get The ExtensionsParams Class. + * + * @param Container $container The DI container. + * + * @return ExtensionsParams + * @since 3.2.0 + */ + public function getExtensionsParams(Container $container): ExtensionsParams + { + return new ExtensionsParams(); + } + + /** + * Get The FieldGroupControl Class. + * + * @param Container $container The DI container. + * + * @return FieldGroupControl + * @since 3.2.0 + */ + public function getFieldGroupControl(Container $container): FieldGroupControl + { + return new FieldGroupControl(); + } + + /** + * Get The FieldNames Class. + * + * @param Container $container The DI container. + * + * @return FieldNames + * @since 3.2.0 + */ + public function getFieldNames(Container $container): FieldNames + { + return new FieldNames(); + } + + /** + * Get The FieldRelations Class. + * + * @param Container $container The DI container. + * + * @return FieldRelations + * @since 3.2.0 + */ + public function getFieldRelations(Container $container): FieldRelations + { + return new FieldRelations(); + } + + /** + * Get The Filter Class. + * + * @param Container $container The DI container. + * + * @return Filter + * @since 3.2.0 + */ + public function getFilter(Container $container): Filter + { + return new Filter(); + } + + /** + * Get The FootableScripts Class. + * + * @param Container $container The DI container. + * + * @return FootableScripts + * @since 3.2.0 + */ + public function getFootableScripts(Container $container): FootableScripts + { + return new FootableScripts(); + } + + /** + * Get The FrontendParams Class. + * + * @param Container $container The DI container. + * + * @return FrontendParams + * @since 3.2.0 + */ + public function getFrontendParams(Container $container): FrontendParams + { + return new FrontendParams(); + } + + /** + * Get The GetAsLookup Class. + * + * @param Container $container The DI container. + * + * @return GetAsLookup + * @since 3.2.0 + */ + public function getGetAsLookup(Container $container): GetAsLookup + { + return new GetAsLookup(); + } + + /** + * Get The GetModule Class. + * + * @param Container $container The DI container. + * + * @return GetModule + * @since 3.2.0 + */ + public function getGetModule(Container $container): GetModule + { + return new GetModule(); + } + + /** + * Get The GoogleChart Class. + * + * @param Container $container The DI container. + * + * @return GoogleChart + * @since 3.2.0 + */ + public function getGoogleChart(Container $container): GoogleChart + { + return new GoogleChart(); + } + + /** + * Get The HasMenuGlobal Class. + * + * @param Container $container The DI container. + * + * @return HasMenuGlobal + * @since 3.2.0 + */ + public function getHasMenuGlobal(Container $container): HasMenuGlobal + { + return new HasMenuGlobal(); + } + + /** + * Get The HasPermissions Class. + * + * @param Container $container The DI container. + * + * @return HasPermissions + * @since 3.2.0 + */ + public function getHasPermissions(Container $container): HasPermissions + { + return new HasPermissions(); + } + + /** + * Get The HiddenFields Class. + * + * @param Container $container The DI container. + * + * @return HiddenFields + * @since 3.2.0 + */ + public function getHiddenFields(Container $container): HiddenFields + { + return new HiddenFields(); + } + + /** + * Get The History Class. + * + * @param Container $container The DI container. + * + * @return History + * @since 3.2.0 + */ + public function getHistory(Container $container): History + { + return new History(); + } + + /** + * Get The IntegerFields Class. + * + * @param Container $container The DI container. + * + * @return IntegerFields + * @since 3.2.0 + */ + public function getIntegerFields(Container $container): IntegerFields + { + return new IntegerFields(); + } + + /** + * Get The ItemsMethodEximportString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodEximportString + * @since 3.2.0 + */ + public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString + { + return new ItemsMethodEximportString(); + } + + /** + * Get The ItemsMethodListString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodListString + * @since 3.2.0 + */ + public function getItemsMethodListString(Container $container): ItemsMethodListString + { + return new ItemsMethodListString(); + } + + /** + * Get The JsonItem Class. + * + * @param Container $container The DI container. + * + * @return JsonItem + * @since 3.2.0 + */ + public function getJsonItem(Container $container): JsonItem + { + return new JsonItem(); + } + + /** + * Get The JsonItemArray Class. + * + * @param Container $container The DI container. + * + * @return JsonItemArray + * @since 3.2.0 + */ + public function getJsonItemArray(Container $container): JsonItemArray + { + return new JsonItemArray(); + } + + /** + * Get The JsonString Class. + * + * @param Container $container The DI container. + * + * @return JsonString + * @since 3.2.0 + */ + public function getJsonString(Container $container): JsonString + { + return new JsonString(); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Builder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderLZ.php similarity index 54% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Builder.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderLZ.php index 8e5f73592..b6421dd92 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Builder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderLZ.php @@ -14,47 +14,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitch; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Alias; -use VDM\Joomla\Componentbuilder\Compiler\Builder\BaseSixFour; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryCode; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CheckBox; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ComponentFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomAlias; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomField; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomFieldLinks; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomList; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseKeys; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseTables; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueGuid; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueKeys; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DoNotEscape; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DynamicFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionCustomFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldNames; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldRelations; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FootableScripts; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GetAsLookup; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GetModule; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GoogleChart; -use VDM\Joomla\Componentbuilder\Compiler\Builder\HasPermissions; -use VDM\Joomla\Componentbuilder\Compiler\Builder\HiddenFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\History; -use VDM\Joomla\Componentbuilder\Compiler\Builder\IntegerFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodEximportString; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodListString; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItem; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItemArray; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\LanguageMessages; use VDM\Joomla\Componentbuilder\Compiler\Builder\Layout; use VDM\Joomla\Componentbuilder\Compiler\Builder\LayoutData; use VDM\Joomla\Componentbuilder\Compiler\Builder\LibraryManager; @@ -83,8 +43,11 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionAction; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionComponent; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionCore; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionDashboard; +use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionFields; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionGlobalAction; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionViews; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Request; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Router; use VDM\Joomla\Componentbuilder\Compiler\Builder\ScriptMediaSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\ScriptUserSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\Search; @@ -103,14 +66,15 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\TemplateData; use VDM\Joomla\Componentbuilder\Compiler\Builder\Title; use VDM\Joomla\Componentbuilder\Compiler\Builder\UikitComp; use VDM\Joomla\Componentbuilder\Compiler\Builder\UpdateMysql; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ViewsDefaultOrdering; /** - * Builder Service Provider + * Builder L-Z Service Provider * * @since 3.2.0 */ -class Builder implements ServiceProviderInterface +class BuilderLZ implements ServiceProviderInterface { /** * Registers the service provider with a DI container. @@ -122,128 +86,8 @@ class Builder implements ServiceProviderInterface */ public function register(Container $container) { - $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') - ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); - - $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') - ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); - - $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') - ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); - - $container->alias(Alias::class, 'Compiler.Builder.Alias') - ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); - - $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') - ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); - - $container->alias(Category::class, 'Compiler.Builder.Category') - ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); - - $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') - ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); - - $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') - ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); - - $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') - ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); - - $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') - ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); - - $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') - ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); - - $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') - ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); - - $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') - ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); - - $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') - ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); - - $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') - ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); - - $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') - ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); - - $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') - ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); - - $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') - ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); - - $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') - ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); - - $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') - ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); - - $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') - ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); - - $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') - ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); - - $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') - ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); - - $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') - ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); - - $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') - ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); - - $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') - ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); - - $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') - ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); - - $container->alias(Filter::class, 'Compiler.Builder.Filter') - ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); - - $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') - ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); - - $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') - ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); - - $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') - ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); - - $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') - ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); - - $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') - ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); - - $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') - ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); - - $container->alias(History::class, 'Compiler.Builder.History') - ->share('Compiler.Builder.History', [$this, 'getHistory'], true); - - $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') - ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); - - $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') - ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); - - $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') - ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); - - $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') - ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); - - $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') - ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); - - $container->alias(JsonString::class, 'Compiler.Builder.Json.String') - ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); + $container->alias(LanguageMessages::class, 'Compiler.Builder.Language.Messages') + ->share('Compiler.Builder.Language.Messages', [$this, 'getLanguageMessages'], true); $container->alias(Layout::class, 'Compiler.Builder.Layout') ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); @@ -329,12 +173,21 @@ class Builder implements ServiceProviderInterface $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); + $container->alias(PermissionFields::class, 'Compiler.Builder.Permission.Fields') + ->share('Compiler.Builder.Permission.Fields', [$this, 'getPermissionFields'], true); + $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); + $container->alias(Request::class, 'Compiler.Builder.Request') + ->share('Compiler.Builder.Request', [$this, 'getRequest'], true); + + $container->alias(Router::class, 'Compiler.Builder.Router') + ->share('Compiler.Builder.Router', [$this, 'getRouter'], true); + $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); @@ -388,539 +241,22 @@ class Builder implements ServiceProviderInterface $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); + + $container->alias(ViewsDefaultOrdering::class, 'Compiler.Builder.Views.Default.Ordering') + ->share('Compiler.Builder.Views.Default.Ordering', [$this, 'getViewsDefaultOrdering'], true); } /** - * Get The AccessSwitch Class. + * Get The LanguageMessages Class. * * @param Container $container The DI container. * - * @return AccessSwitch + * @return LanguageMessages * @since 3.2.0 */ - public function getAccessSwitch(Container $container): AccessSwitch + public function getLanguageMessages(Container $container): LanguageMessages { - return new AccessSwitch(); - } - - /** - * Get The AccessSwitchList Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitchList - * @since 3.2.0 - */ - public function getAccessSwitchList(Container $container): AccessSwitchList - { - return new AccessSwitchList(); - } - - /** - * Get The AdminFilterType Class. - * - * @param Container $container The DI container. - * - * @return AdminFilterType - * @since 3.2.0 - */ - public function getAdminFilterType(Container $container): AdminFilterType - { - return new AdminFilterType(); - } - - /** - * Get The Alias Class. - * - * @param Container $container The DI container. - * - * @return Alias - * @since 3.2.0 - */ - public function getAlias(Container $container): Alias - { - return new Alias(); - } - - /** - * Get The BaseSixFour Class. - * - * @param Container $container The DI container. - * - * @return BaseSixFour - * @since 3.2.0 - */ - public function getBaseSixFour(Container $container): BaseSixFour - { - return new BaseSixFour(); - } - - /** - * Get The Category Class. - * - * @param Container $container The DI container. - * - * @return Category - * @since 3.2.0 - */ - public function getCategory(Container $container): Category - { - return new Category(); - } - - /** - * Get The CategoryCode Class. - * - * @param Container $container The DI container. - * - * @return CategoryCode - * @since 3.2.0 - */ - public function getCategoryCode(Container $container): CategoryCode - { - return new CategoryCode(); - } - - /** - * Get The CategoryOtherName Class. - * - * @param Container $container The DI container. - * - * @return CategoryOtherName - * @since 3.2.0 - */ - public function getCategoryOtherName(Container $container): CategoryOtherName - { - return new CategoryOtherName(); - } - - /** - * Get The CheckBox Class. - * - * @param Container $container The DI container. - * - * @return CheckBox - * @since 3.2.0 - */ - public function getCheckBox(Container $container): CheckBox - { - return new CheckBox(); - } - - /** - * Get The ComponentFields Class. - * - * @param Container $container The DI container. - * - * @return ComponentFields - * @since 3.2.0 - */ - public function getComponentFields(Container $container): ComponentFields - { - return new ComponentFields(); - } - - /** - * Get The ContentMulti Class. - * - * @param Container $container The DI container. - * - * @return ContentMulti - * @since 3.2.0 - */ - public function getContentMulti(Container $container): ContentMulti - { - return new ContentMulti(); - } - - /** - * Get The ContentOne Class. - * - * @param Container $container The DI container. - * - * @return ContentOne - * @since 3.2.0 - */ - public function getContentOne(Container $container): ContentOne - { - return new ContentOne(); - } - - /** - * Get The CustomAlias Class. - * - * @param Container $container The DI container. - * - * @return CustomAlias - * @since 3.2.0 - */ - public function getCustomAlias(Container $container): CustomAlias - { - return new CustomAlias(); - } - - /** - * Get The CustomField Class. - * - * @param Container $container The DI container. - * - * @return CustomField - * @since 3.2.0 - */ - public function getCustomField(Container $container): CustomField - { - return new CustomField(); - } - - /** - * Get The CustomFieldLinks Class. - * - * @param Container $container The DI container. - * - * @return CustomFieldLinks - * @since 3.2.0 - */ - public function getCustomFieldLinks(Container $container): CustomFieldLinks - { - return new CustomFieldLinks(); - } - - /** - * Get The CustomList Class. - * - * @param Container $container The DI container. - * - * @return CustomList - * @since 3.2.0 - */ - public function getCustomList(Container $container): CustomList - { - return new CustomList(); - } - - /** - * Get The CustomTabs Class. - * - * @param Container $container The DI container. - * - * @return CustomTabs - * @since 3.2.0 - */ - public function getCustomTabs(Container $container): CustomTabs - { - return new CustomTabs(); - } - - /** - * Get The DatabaseKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseKeys - * @since 3.2.0 - */ - public function getDatabaseKeys(Container $container): DatabaseKeys - { - return new DatabaseKeys(); - } - - /** - * Get The DatabaseTables Class. - * - * @param Container $container The DI container. - * - * @return DatabaseTables - * @since 3.2.0 - */ - public function getDatabaseTables(Container $container): DatabaseTables - { - return new DatabaseTables(); - } - - /** - * Get The DatabaseUniqueGuid Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueGuid - * @since 3.2.0 - */ - public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid - { - return new DatabaseUniqueGuid(); - } - - /** - * Get The DatabaseUniqueKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueKeys - * @since 3.2.0 - */ - public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys - { - return new DatabaseUniqueKeys(); - } - - /** - * Get The DoNotEscape Class. - * - * @param Container $container The DI container. - * - * @return DoNotEscape - * @since 3.2.0 - */ - public function getDoNotEscape(Container $container): DoNotEscape - { - return new DoNotEscape(); - } - - /** - * Get The DynamicFields Class. - * - * @param Container $container The DI container. - * - * @return DynamicFields - * @since 3.2.0 - */ - public function getDynamicFields(Container $container): DynamicFields - { - return new DynamicFields(); - } - - /** - * Get The ExtensionCustomFields Class. - * - * @param Container $container The DI container. - * - * @return ExtensionCustomFields - * @since 3.2.0 - */ - public function getExtensionCustomFields(Container $container): ExtensionCustomFields - { - return new ExtensionCustomFields(); - } - - /** - * Get The FieldGroupControl Class. - * - * @param Container $container The DI container. - * - * @return FieldGroupControl - * @since 3.2.0 - */ - public function getFieldGroupControl(Container $container): FieldGroupControl - { - return new FieldGroupControl(); - } - - /** - * Get The FieldNames Class. - * - * @param Container $container The DI container. - * - * @return FieldNames - * @since 3.2.0 - */ - public function getFieldNames(Container $container): FieldNames - { - return new FieldNames(); - } - - /** - * Get The FieldRelations Class. - * - * @param Container $container The DI container. - * - * @return FieldRelations - * @since 3.2.0 - */ - public function getFieldRelations(Container $container): FieldRelations - { - return new FieldRelations(); - } - - /** - * Get The Filter Class. - * - * @param Container $container The DI container. - * - * @return Filter - * @since 3.2.0 - */ - public function getFilter(Container $container): Filter - { - return new Filter(); - } - - /** - * Get The FootableScripts Class. - * - * @param Container $container The DI container. - * - * @return FootableScripts - * @since 3.2.0 - */ - public function getFootableScripts(Container $container): FootableScripts - { - return new FootableScripts(); - } - - /** - * Get The GetAsLookup Class. - * - * @param Container $container The DI container. - * - * @return GetAsLookup - * @since 3.2.0 - */ - public function getGetAsLookup(Container $container): GetAsLookup - { - return new GetAsLookup(); - } - - /** - * Get The GetModule Class. - * - * @param Container $container The DI container. - * - * @return GetModule - * @since 3.2.0 - */ - public function getGetModule(Container $container): GetModule - { - return new GetModule(); - } - - /** - * Get The GoogleChart Class. - * - * @param Container $container The DI container. - * - * @return GoogleChart - * @since 3.2.0 - */ - public function getGoogleChart(Container $container): GoogleChart - { - return new GoogleChart(); - } - - /** - * Get The HasPermissions Class. - * - * @param Container $container The DI container. - * - * @return HasPermissions - * @since 3.2.0 - */ - public function getHasPermissions(Container $container): HasPermissions - { - return new HasPermissions(); - } - - /** - * Get The HiddenFields Class. - * - * @param Container $container The DI container. - * - * @return HiddenFields - * @since 3.2.0 - */ - public function getHiddenFields(Container $container): HiddenFields - { - return new HiddenFields(); - } - - /** - * Get The History Class. - * - * @param Container $container The DI container. - * - * @return History - * @since 3.2.0 - */ - public function getHistory(Container $container): History - { - return new History(); - } - - /** - * Get The IntegerFields Class. - * - * @param Container $container The DI container. - * - * @return IntegerFields - * @since 3.2.0 - */ - public function getIntegerFields(Container $container): IntegerFields - { - return new IntegerFields(); - } - - /** - * Get The ItemsMethodEximportString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodEximportString - * @since 3.2.0 - */ - public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString - { - return new ItemsMethodEximportString(); - } - - /** - * Get The ItemsMethodListString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodListString - * @since 3.2.0 - */ - public function getItemsMethodListString(Container $container): ItemsMethodListString - { - return new ItemsMethodListString(); - } - - /** - * Get The JsonItem Class. - * - * @param Container $container The DI container. - * - * @return JsonItem - * @since 3.2.0 - */ - public function getJsonItem(Container $container): JsonItem - { - return new JsonItem(); - } - - /** - * Get The JsonItemArray Class. - * - * @param Container $container The DI container. - * - * @return JsonItemArray - * @since 3.2.0 - */ - public function getJsonItemArray(Container $container): JsonItemArray - { - return new JsonItemArray(); - } - - /** - * Get The JsonString Class. - * - * @param Container $container The DI container. - * - * @return JsonString - * @since 3.2.0 - */ - public function getJsonString(Container $container): JsonString - { - return new JsonString(); + return new LanguageMessages(); } /** @@ -1287,6 +623,19 @@ class Builder implements ServiceProviderInterface return new PermissionDashboard(); } + /** + * Get The PermissionFields Class. + * + * @param Container $container The DI container. + * + * @return PermissionFields + * @since 3.2.0 + */ + public function getPermissionFields(Container $container): PermissionFields + { + return new PermissionFields(); + } + /** * Get The PermissionGlobalAction Class. * @@ -1313,6 +662,32 @@ class Builder implements ServiceProviderInterface return new PermissionViews(); } + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request(); + } + + /** + * Get The Router Class. + * + * @param Container $container The DI container. + * + * @return Router + * @since 3.2.0 + */ + public function getRouter(Container $container): Router + { + return new Router(); + } + /** * Get The ScriptMediaSwitch Class. * @@ -1545,6 +920,19 @@ class Builder implements ServiceProviderInterface public function getUpdateMysql(Container $container): UpdateMysql { return new UpdateMysql(); + } + + /** + * Get The ViewsDefaultOrdering Class. + * + * @param Container $container The DI container. + * + * @return ViewsDefaultOrdering + * @since 3.2.0 + */ + public function getViewsDefaultOrdering(Container $container): ViewsDefaultOrdering + { + return new ViewsDefaultOrdering(); } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php index b6e9b6759..0d8c7fcd8 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php @@ -15,13 +15,15 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Component as CompilerComponent; -use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree\Settings as J3Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour\Settings as J4Settings; use VDM\Joomla\Componentbuilder\Compiler\Component\Dashboard; use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder; use VDM\Joomla\Componentbuilder\Compiler\Component\Data; use VDM\Joomla\Componentbuilder\Compiler\Component\Structure; use VDM\Joomla\Componentbuilder\Compiler\Component\Structuresingle; use VDM\Joomla\Componentbuilder\Compiler\Component\Structuremultiple; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings; /** @@ -31,6 +33,14 @@ use VDM\Joomla\Componentbuilder\Compiler\Component\Structuremultiple; */ class Component implements ServiceProviderInterface { + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + /** * Registers the service provider with a DI container. * @@ -42,10 +52,13 @@ class Component implements ServiceProviderInterface public function register(Container $container) { $container->alias(CompilerComponent::class, 'Component') - ->share('Component', [$this, 'getComponent'], true); + ->share('Component', [$this, 'getCompilerComponent'], true); - $container->alias(Settings::class, 'Component.Settings') - ->share('Component.Settings', [$this, 'getSettings'], true); + $container->alias(J3Settings::class, 'Component.J3.Settings') + ->share('Component.J3.Settings', [$this, 'getJ3Settings'], true); + + $container->alias(J4Settings::class, 'Component.J4.Settings') + ->share('Component.J4.Settings', [$this, 'getJ4Settings'], true); $container->alias(Dashboard::class, 'Component.Dashboard') ->share('Component.Dashboard', [$this, 'getDashboard'], true); @@ -64,17 +77,20 @@ class Component implements ServiceProviderInterface $container->alias(Structuremultiple::class, 'Component.Structure.Multiple') ->share('Component.Structure.Multiple', [$this, 'getStructuremultiple'], true); + + $container->alias(Settings::class, 'Component.Settings') + ->share('Component.Settings', [$this, 'getSettings'], true); } /** - * Get the Component + * Get The Component Class. * * @param Container $container The DI container. * * @return CompilerComponent * @since 3.2.0 */ - public function getComponent(Container $container): CompilerComponent + public function getCompilerComponent(Container $container): CompilerComponent { return new CompilerComponent( $container->get('Component.Data') @@ -82,16 +98,16 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Component (version) Settings + * Get The Settings Class. * * @param Container $container The DI container. * - * @return Settings + * @return J3Settings * @since 3.2.0 */ - public function getSettings(Container $container): Settings + public function getJ3Settings(Container $container): J3Settings { - return new Settings( + return new J3Settings( $container->get('Config'), $container->get('Registry'), $container->get('Event'), @@ -104,7 +120,29 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Component Dynamic Dashboard + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return J4Settings + * @since 3.2.0 + */ + public function getJ4Settings(Container $container): J4Settings + { + return new J4Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + + /** + * Get The Dashboard Class. * * @param Container $container The DI container. * @@ -120,7 +158,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Component Placeholders + * Get The Placeholder Class. * * @param Container $container The DI container. * @@ -135,7 +173,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Component Data + * Get The Data Class. * * @param Container $container The DI container. * @@ -164,12 +202,13 @@ class Component implements ServiceProviderInterface $container->get('Model.Customadminviews'), $container->get('Model.Updateserver'), $container->get('Model.Joomlamodules'), - $container->get('Model.Joomlaplugins') + $container->get('Model.Joomlaplugins'), + $container->get('Model.Router') ); } /** - * Get the Compiler Structure + * Get The Structure Class. * * @param Container $container The DI container. * @@ -186,7 +225,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Structure Single + * Get The Structuresingle Class. * * @param Container $container The DI container. * @@ -198,6 +237,7 @@ class Component implements ServiceProviderInterface return new Structuresingle( $container->get('Config'), $container->get('Registry'), + $container->get('Placeholder'), $container->get('Component.Settings'), $container->get('Component'), $container->get('Compiler.Builder.Content.One'), @@ -208,7 +248,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Structure Multiple + * Get The Structuremultiple Class. * * @param Container $container The DI container. * @@ -227,6 +267,23 @@ class Component implements ServiceProviderInterface $container->get('Utilities.Structure') ); } - + + /** + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return Settings + * @since 3.2.0 + */ + public function getSettings(Container $container): Settings + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Component.J' . $this->targetVersion . '.Settings'); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Creator.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Creator.php index 67b743786..36aa47485 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Creator.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Creator.php @@ -14,11 +14,30 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSections; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSectionsCategory; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSectionsJoomlaFields; use VDM\Joomla\Componentbuilder\Compiler\Creator\Builders; use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomFieldTypeFile; +use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomButtonPermissions; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsCustomfield; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEmailHelper; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEncryption; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGlobal; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGooglechart; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGroupControl; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsSiteControl; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsUikit; use VDM\Joomla\Componentbuilder\Compiler\Creator\Layout; use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; use VDM\Joomla\Componentbuilder\Compiler\Creator\SiteFieldData; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Request; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Router; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorDefault; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorManual; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsDefault; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsManual; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetString; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetXML; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetDynamic; @@ -47,12 +66,51 @@ class Creator implements ServiceProviderInterface */ public function register(Container $container) { + $container->alias(AccessSections::class, 'Compiler.Creator.Access.Sections') + ->share('Compiler.Creator.Access.Sections', [$this, 'getAccessSections'], true); + + $container->alias(AccessSectionsCategory::class, 'Compiler.Creator.Access.Sections.Category') + ->share('Compiler.Creator.Access.Sections.Category', [$this, 'getAccessSectionsCategory'], true); + + $container->alias(AccessSectionsJoomlaFields::class, 'Compiler.Creator.Access.Sections.Joomla.Fields') + ->share('Compiler.Creator.Access.Sections.Joomla.Fields', [$this, 'getAccessSectionsJoomlaFields'], true); + $container->alias(Builders::class, 'Compiler.Creator.Builders') ->share('Compiler.Creator.Builders', [$this, 'getBuilders'], true); $container->alias(CustomFieldTypeFile::class, 'Compiler.Creator.Custom.Field.Type.File') ->share('Compiler.Creator.Custom.Field.Type.File', [$this, 'getCustomFieldTypeFile'], true); + $container->alias(CustomButtonPermissions::class, 'Compiler.Creator.Custom.Button.Permissions') + ->share('Compiler.Creator.Custom.Button.Permissions', [$this, 'getCustomButtonPermissions'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Creator.Config.Fieldsets') + ->share('Compiler.Creator.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Creator.Config.Fieldsets.Customfield') + ->share('Compiler.Creator.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ConfigFieldsetsEmailHelper::class, 'Compiler.Creator.Config.Fieldsets.Email.Helper') + ->share('Compiler.Creator.Config.Fieldsets.Email.Helper', [$this, 'getConfigFieldsetsEmailHelper'], true); + + $container->alias(ConfigFieldsetsEncryption::class, 'Compiler.Creator.Config.Fieldsets.Encryption') + ->share('Compiler.Creator.Config.Fieldsets.Encryption', [$this, 'getConfigFieldsetsEncryption'], true); + + $container->alias(ConfigFieldsetsGlobal::class, 'Compiler.Creator.Config.Fieldsets.Global') + ->share('Compiler.Creator.Config.Fieldsets.Global', [$this, 'getConfigFieldsetsGlobal'], true); + + $container->alias(ConfigFieldsetsGooglechart::class, 'Compiler.Creator.Config.Fieldsets.Googlechart') + ->share('Compiler.Creator.Config.Fieldsets.Googlechart', [$this, 'getConfigFieldsetsGooglechart'], true); + + $container->alias(ConfigFieldsetsGroupControl::class, 'Compiler.Creator.Config.Fieldsets.Group.Control') + ->share('Compiler.Creator.Config.Fieldsets.Group.Control', [$this, 'getConfigFieldsetsGroupControl'], true); + + $container->alias(ConfigFieldsetsSiteControl::class, 'Compiler.Creator.Config.Fieldsets.Site.Control') + ->share('Compiler.Creator.Config.Fieldsets.Site.Control', [$this, 'getConfigFieldsetsSiteControl'], true); + + $container->alias(ConfigFieldsetsUikit::class, 'Compiler.Creator.Config.Fieldsets.Uikit') + ->share('Compiler.Creator.Config.Fieldsets.Uikit', [$this, 'getConfigFieldsetsUikit'], true); + $container->alias(Layout::class, 'Compiler.Creator.Layout') ->share('Compiler.Creator.Layout', [$this, 'getLayout'], true); @@ -62,6 +120,24 @@ class Creator implements ServiceProviderInterface $container->alias(SiteFieldData::class, 'Compiler.Creator.Site.Field.Data') ->share('Compiler.Creator.Site.Field.Data', [$this, 'getSiteFieldData'], true); + $container->alias(Request::class, 'Compiler.Creator.Request') + ->share('Compiler.Creator.Request', [$this, 'getRequest'], true); + + $container->alias(Router::class, 'Compiler.Creator.Router') + ->share('Compiler.Creator.Router', [$this, 'getRouter'], true); + + $container->alias(RouterConstructorDefault::class, 'Compiler.Creator.Router.Constructor.Default') + ->share('Compiler.Creator.Router.Constructor.Default', [$this, 'getRouterConstructorDefault'], true); + + $container->alias(RouterConstructorManual::class, 'Compiler.Creator.Router.Constructor.Manual') + ->share('Compiler.Creator.Router.Constructor.Manual', [$this, 'getRouterConstructorManual'], true); + + $container->alias(RouterMethodsDefault::class, 'Compiler.Creator.Router.Methods.Default') + ->share('Compiler.Creator.Router.Methods.Default', [$this, 'getRouterMethodsDefault'], true); + + $container->alias(RouterMethodsManual::class, 'Compiler.Creator.Router.Methods.Manual') + ->share('Compiler.Creator.Router.Methods.Manual', [$this, 'getRouterMethodsManual'], true); + $container->alias(FieldsetString::class, 'Compiler.Creator.Fieldset.String') ->share('Compiler.Creator.Fieldset.String', [$this, 'getFieldsetString'], true); @@ -90,6 +166,62 @@ class Creator implements ServiceProviderInterface ->share('Compiler.Creator.Fieldset', [$this, 'getFieldset'], true); } + /** + * Get The AccessSections Class. + * + * @param Container $container The DI container. + * + * @return AccessSections + * @since 3.2.0 + */ + public function getAccessSections(Container $container): AccessSections + { + return new AccessSections( + $container->get('Config'), + $container->get('Event'), + $container->get('Language'), + $container->get('Component'), + $container->get('Field.Name'), + $container->get('Field.Type.Name'), + $container->get('Utilities.Counter'), + $container->get('Compiler.Creator.Permission'), + $container->get('Compiler.Builder.Assets.Rules'), + $container->get('Compiler.Builder.Custom.Tabs'), + $container->get('Compiler.Builder.Permission.Views'), + $container->get('Compiler.Builder.Permission.Fields'), + $container->get('Compiler.Builder.Permission.Component'), + $container->get('Compiler.Creator.Custom.Button.Permissions') + ); + } + + /** + * Get The AccessSectionsCategory Class. + * + * @param Container $container The DI container. + * + * @return AccessSectionsCategory + * @since 3.2.0 + */ + public function getAccessSectionsCategory(Container $container): AccessSectionsCategory + { + return new AccessSectionsCategory( + $container->get('Compiler.Builder.Category.Code') + ); + } + + /** + * Get The AccessSectionsJoomlaFields Class. + * + * @param Container $container The DI container. + * + * @return AccessSectionsJoomlaFields + * @since 3.2.0 + */ + public function getAccessSectionsJoomlaFields(Container $container): AccessSectionsJoomlaFields + { + return new AccessSectionsJoomlaFields(); + } + /** * Get The Builders Class. * @@ -102,6 +234,7 @@ class Creator implements ServiceProviderInterface { return new Builders( $container->get('Config'), + $container->get('Power'), $container->get('Language'), $container->get('Placeholder'), $container->get('Compiler.Creator.Layout'), @@ -171,7 +304,212 @@ class Creator implements ServiceProviderInterface $container->get('Utilities.Structure'), $container->get('Field.Input.Button'), $container->get('Compiler.Builder.Field.Group.Control'), - $container->get('Compiler.Builder.Extension.Custom.Fields') + $container->get('Compiler.Builder.Extension.Custom.Fields'), + $container->get('Header'), + $container->get('Field.Core.Field') + ); + } + + /** + * Get The CustomButtonPermissions Class. + * + * @param Container $container The DI container. + * + * @return CustomButtonPermissions + * @since 3.2.0 + */ + public function getCustomButtonPermissions(Container $container): CustomButtonPermissions + { + return new CustomButtonPermissions( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Permission.Component'), + $container->get('Utilities.Counter') + ); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets( + $container->get('Config'), + $container->get('Component'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component.Placeholder'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Creator.Field.As.String'), + $container->get('Compiler.Creator.Config.Fieldsets.Global'), + $container->get('Compiler.Creator.Config.Fieldsets.Site.Control'), + $container->get('Compiler.Creator.Config.Fieldsets.Group.Control'), + $container->get('Compiler.Creator.Config.Fieldsets.Uikit'), + $container->get('Compiler.Creator.Config.Fieldsets.Googlechart'), + $container->get('Compiler.Creator.Config.Fieldsets.Email.Helper'), + $container->get('Compiler.Creator.Config.Fieldsets.Encryption'), + $container->get('Compiler.Creator.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Config.Fieldsets') + ); + } + + /** + * Get The ConfigFieldsetsEmailHelper Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsEmailHelper + * @since 3.2.0 + */ + public function getConfigFieldsetsEmailHelper(Container $container): ConfigFieldsetsEmailHelper + { + return new ConfigFieldsetsEmailHelper( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsEncryption Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsEncryption + * @since 3.2.0 + */ + public function getConfigFieldsetsEncryption(Container $container): ConfigFieldsetsEncryption + { + return new ConfigFieldsetsEncryption( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsGlobal Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGlobal + * @since 3.2.0 + */ + public function getConfigFieldsetsGlobal(Container $container): ConfigFieldsetsGlobal + { + return new ConfigFieldsetsGlobal( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Contributors'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsGooglechart Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGooglechart + * @since 3.2.0 + */ + public function getConfigFieldsetsGooglechart(Container $container): ConfigFieldsetsGooglechart + { + return new ConfigFieldsetsGooglechart( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Extensions.Params') + ); + } + + /** + * Get The ConfigFieldsetsGroupControl Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGroupControl + * @since 3.2.0 + */ + public function getConfigFieldsetsGroupControl(Container $container): ConfigFieldsetsGroupControl + { + return new ConfigFieldsetsGroupControl( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Field.Group.Control'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsSiteControl Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsSiteControl + * @since 3.2.0 + */ + public function getConfigFieldsetsSiteControl(Container $container): ConfigFieldsetsSiteControl + { + return new ConfigFieldsetsSiteControl( + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Has.Menu.Global'), + $container->get('Compiler.Builder.Frontend.Params'), + $container->get('Compiler.Creator.Request') + ); + } + + /** + * Get The ConfigFieldsetsUikit Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsUikit + * @since 3.2.0 + */ + public function getConfigFieldsetsUikit(Container $container): ConfigFieldsetsUikit + { + return new ConfigFieldsetsUikit( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') ); } @@ -235,6 +573,102 @@ class Creator implements ServiceProviderInterface ); } + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request( + $container->get('Compiler.Builder.Request') + ); + } + + /** + * Get The Router Class. + * + * @param Container $container The DI container. + * + * @return Router + * @since 3.2.0 + */ + public function getRouter(Container $container): Router + { + return new Router( + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Request'), + $container->get('Compiler.Builder.Router'), + $container->get('Compiler.Creator.Router.Constructor.Default'), + $container->get('Compiler.Creator.Router.Constructor.Manual'), + $container->get('Compiler.Creator.Router.Methods.Default'), + $container->get('Compiler.Creator.Router.Methods.Manual') + ); + } + + /** + * Get The RouterConstructorDefault Class. + * + * @param Container $container The DI container. + * + * @return RouterConstructorDefault + * @since 3.2.0 + */ + public function getRouterConstructorDefault(Container $container): RouterConstructorDefault + { + return new RouterConstructorDefault( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterConstructorManual Class. + * + * @param Container $container The DI container. + * + * @return RouterConstructorManual + * @since 3.2.0 + */ + public function getRouterConstructorManual(Container $container): RouterConstructorManual + { + return new RouterConstructorManual( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterMethodsDefault Class. + * + * @param Container $container The DI container. + * + * @return RouterMethodsDefault + * @since 3.2.0 + */ + public function getRouterMethodsDefault(Container $container): RouterMethodsDefault + { + return new RouterMethodsDefault( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterMethodsManual Class. + * + * @param Container $container The DI container. + * + * @return RouterMethodsManual + * @since 3.2.0 + */ + public function getRouterMethodsManual(Container $container): RouterMethodsManual + { + return new RouterMethodsManual( + $container->get('Compiler.Builder.Router') + ); + } + /** * Get The FieldsetString Class. * 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 091f7c2ea..156a2937f 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 @@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Event as J4Event; /** @@ -47,6 +48,9 @@ class Event implements ServiceProviderInterface $container->alias(J3Event::class, 'J3.Event') ->share('J3.Event', [$this, 'getJ3Event'], true); + $container->alias(J4Event::class, 'J4.Event') + ->share('J4.Event', [$this, 'getJ4Event'], true); + $container->alias(EventInterface::class, 'Event') ->share('Event', [$this, 'getEvent'], true); } @@ -81,6 +85,18 @@ class Event implements ServiceProviderInterface { return new J3Event(); } - + + /** + * Get the Joomla 4 Event + * + * @param Container $container The DI container. + * + * @return J4Event + * @since 3.2.0 + */ + public function getJ4Event(Container $container): J4Event + { + return new J4Event(); + } } 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 50d751bae..4eadc98af 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 @@ -16,6 +16,7 @@ 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; +use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour\InstallScript as J4InstallScript; /** @@ -48,6 +49,9 @@ class Extension implements ServiceProviderInterface $container->alias(J3InstallScript::class, 'J3.Extension.InstallScript') ->share('J3.Extension.InstallScript', [$this, 'getJ3ExtensionInstallScript'], true); + + $container->alias(J4InstallScript::class, 'J4.Extension.InstallScript') + ->share('J4.Extension.InstallScript', [$this, 'getJ4ExtensionInstallScript'], true); } /** @@ -63,6 +67,19 @@ class Extension implements ServiceProviderInterface return new J3InstallScript(); } + /** + * Get the Joomla 4 Extension Install Script + * + * @param Container $container The DI container. + * + * @return J4InstallScript + * @since 3.2.0 + */ + public function getJ4ExtensionInstallScript(Container $container): J4InstallScript + { + return new J4InstallScript(); + } + /** * Get the Joomla Extension Install Script * 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 index e3ba24db5..b2b8a79c6 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.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\Field as CompilerField; use VDM\Joomla\Componentbuilder\Compiler\Field\Data; use VDM\Joomla\Componentbuilder\Compiler\Field\Groups; @@ -21,12 +22,18 @@ use VDM\Joomla\Componentbuilder\Compiler\Field\Attributes; 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\Rule; use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode; use VDM\Joomla\Componentbuilder\Compiler\Field\DatabaseName; -use VDM\Joomla\Componentbuilder\Compiler\Field\InputButton; -use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreValidation as J3CoreValidation; -use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreRule as J3CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreRule as J4CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreField as J3CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreField as J4CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\InputButton as J3InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\InputButton as J4InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface as CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface as CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface as InputButton; /** @@ -44,6 +51,14 @@ class Field implements ServiceProviderInterface **/ protected $targetVersion; + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + /** * Registers the service provider with a DI container. * @@ -55,7 +70,7 @@ class Field implements ServiceProviderInterface public function register(Container $container) { $container->alias(CompilerField::class, 'Field') - ->share('Field', [$this, 'getField'], true); + ->share('Field', [$this, 'getCompilerField'], true); $container->alias(Data::class, 'Field.Data') ->share('Field.Data', [$this, 'getData'], true); @@ -66,43 +81,61 @@ class Field implements ServiceProviderInterface $container->alias(Attributes::class, 'Field.Attributes') ->share('Field.Attributes', [$this, 'getAttributes'], true); - $container->alias(Validation::class, 'Field.Validation') - ->share('Field.Validation', [$this, 'getValidation'], true); + $container->alias(Name::class, 'Field.Name') + ->share('Field.Name', [$this, 'getName'], true); - $container->alias(J3CoreValidation::class, 'J3.Field.Core.Validation') - ->share('J3.Field.Core.Validation', [$this, 'getJ3CoreValidation'], true); + $container->alias(TypeName::class, 'Field.Type.Name') + ->share('Field.Type.Name', [$this, 'getTypeName'], true); - $container->alias(CoreValidationInterface::class, 'Field.Core.Validation') - ->share('Field.Core.Validation', [$this, 'getCoreValidation'], true); + $container->alias(UniqueName::class, 'Field.Unique.Name') + ->share('Field.Unique.Name', [$this, 'getUniqueName'], true); + + $container->alias(Rule::class, 'Field.Rule') + ->share('Field.Rule', [$this, 'getRule'], 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); + ->share('Field.Database.Name', [$this, 'getDatabaseName'], true); + + $container->alias(J3CoreRule::class, 'J3.Field.Core.Rule') + ->share('J3.Field.Core.Rule', [$this, 'getJ3CoreRule'], true); + + $container->alias(J4CoreRule::class, 'J4.Field.Core.Rule') + ->share('J4.Field.Core.Rule', [$this, 'getJ4CoreRule'], true); + + $container->alias(J3CoreField::class, 'J3.Field.Core.Field') + ->share('J3.Field.Core.Field', [$this, 'getJ3CoreField'], true); + + $container->alias(J4CoreField::class, 'J4.Field.Core.Field') + ->share('J4.Field.Core.Field', [$this, 'getJ4CoreField'], true); + + $container->alias(J3InputButton::class, 'J3.Field.Input.Button') + ->share('J3.Field.Input.Button', [$this, 'getJ3InputButton'], true); + + $container->alias(J4InputButton::class, 'J4.Field.Input.Button') + ->share('J4.Field.Input.Button', [$this, 'getJ4InputButton'], true); + + $container->alias(CoreField::class, 'Field.Core.Field') + ->share('Field.Core.Field', [$this, 'getCoreField'], true); + + $container->alias(CoreRule::class, 'Field.Core.Rule') + ->share('Field.Core.Rule', [$this, 'getCoreRule'], true); $container->alias(InputButton::class, 'Field.Input.Button') ->share('Field.Input.Button', [$this, 'getInputButton'], true); } /** - * Get the Compiler Field + * Get The Field Class. * * @param Container $container The DI container. * * @return CompilerField * @since 3.2.0 */ - public function getField(Container $container): CompilerField + public function getCompilerField(Container $container): CompilerField { return new CompilerField( $container->get('Field.Data'), @@ -113,7 +146,7 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Data + * Get The Data Class. * * @param Container $container The DI container. * @@ -129,12 +162,12 @@ class Field implements ServiceProviderInterface $container->get('Placeholder'), $container->get('Customcode'), $container->get('Field.Customcode'), - $container->get('Field.Validation') + $container->get('Field.Rule') ); } /** - * Get the Compiler Field Groups + * Get The Groups Class. * * @param Container $container The DI container. * @@ -147,7 +180,7 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Attributes + * Get The Attributes Class. * * @param Container $container The DI container. * @@ -169,57 +202,71 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Validation + * Get The Name Class. * * @param Container $container The DI container. * - * @return Validation + * @return Name * @since 3.2.0 */ - public function getValidation(Container $container): Validation + public function getName(Container $container): Name { - return new Validation( - $container->get('Registry'), - $container->get('Customcode.Gui'), + return new Name( $container->get('Placeholder'), - $container->get('Customcode'), - $container->get('Field.Core.Validation') + $container->get('Field.Unique.Name'), + $container->get('Compiler.Builder.Category.Other.Name') ); } /** - * Get the Compiler Field Joomla 3 Validation + * Get The TypeName Class. * * @param Container $container The DI container. * - * @return J3CoreValidation + * @return TypeName * @since 3.2.0 */ - public function getJ3CoreValidation(Container $container): J3CoreValidation + public function getTypeName(Container $container): TypeName { - return new J3CoreValidation(); + return new TypeName(); } /** - * Get the Compiler Field Core Validation + * Get The UniqueName Class. * * @param Container $container The DI container. * - * @return CoreValidationInterface + * @return UniqueName * @since 3.2.0 */ - public function getCoreValidation(Container $container): CoreValidationInterface + public function getUniqueName(Container $container): UniqueName { - if (empty($this->targetVersion)) - { - $this->targetVersion = $container->get('Config')->joomla_version; - } - - return $container->get('J' . $this->targetVersion . '.Field.Core.Validation'); + return new UniqueName( + $container->get('Registry') + ); } /** - * Get the Compiler Field Customcode + * Get The Rule Class. + * + * @param Container $container The DI container. + * + * @return Rule + * @since 3.2.0 + */ + public function getRule(Container $container): Rule + { + return new Rule( + $container->get('Registry'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Field.Core.Rule') + ); + } + + /** + * Get The Customcode Class. * * @param Container $container The DI container. * @@ -234,59 +281,14 @@ class Field implements ServiceProviderInterface } /** - * 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('Compiler.Builder.Category.Other.Name') - ); - } - - /** - * 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 + * Get The DatabaseName Class. * * @param Container $container The DI container. * * @return DatabaseName * @since 3.2.0 */ - public function getFieldDatabaseName(Container $container): DatabaseName + public function getDatabaseName(Container $container): DatabaseName { return new DatabaseName( $container->get('Compiler.Builder.Lists'), @@ -294,6 +296,128 @@ class Field implements ServiceProviderInterface ); } + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J3CoreRule + * @since 3.2.0 + */ + public function getJ3CoreRule(Container $container): J3CoreRule + { + return new J3CoreRule(); + } + + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J4CoreRule + * @since 3.2.0 + */ + public function getJ4CoreRule(Container $container): J4CoreRule + { + return new J4CoreRule(); + } + + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J3CoreField + * @since 3.2.0 + */ + public function getJ3CoreField(Container $container): J3CoreField + { + return new J3CoreField(); + } + + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J4CoreField + * @since 3.2.0 + */ + public function getJ4CoreField(Container $container): J4CoreField + { + return new J4CoreField(); + } + + /** + * Get The J3InputButton Class. + * + * @param Container $container The DI container. + * + * @return J3InputButton + * @since 3.2.0 + */ + public function getJ3InputButton(Container $container): J3InputButton + { + return new J3InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The J4InputButton Class. + * + * @param Container $container The DI container. + * + * @return J4InputButton + * @since 3.2.0 + */ + public function getJ4InputButton(Container $container): J4InputButton + { + return new J4InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The CoreFieldInterface Class. + * + * @param Container $container The DI container. + * + * @return CoreField + * @since 3.2.0 + */ + public function getCoreField(Container $container): CoreField + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Field.Core.Field'); + } + + /** + * Get The CoreRuleInterface Class. + * + * @param Container $container The DI container. + * + * @return CoreRule + * @since 3.2.0 + */ + public function getCoreRule(Container $container): CoreRule + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Field.Core.Rule'); + } + /** * Get The InputButton Class. * @@ -304,11 +428,12 @@ class Field implements ServiceProviderInterface */ public function getInputButton(Container $container): InputButton { - return new InputButton( - $container->get('Config'), - $container->get('Placeholder'), - $container->get('Compiler.Creator.Permission') - ); + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Field.Input.Button'); } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Header.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Header.php new file mode 100644 index 000000000..d8e3f45dd --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Header.php @@ -0,0 +1,123 @@ + + * @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\HeaderInterface; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Header as J3Header; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Header as J4Header; + + +/** + * Header Service Provider + * + * @since 3.2.0 + */ +class Header 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(J3Header::class, 'J3.Header') + ->share('J3.Header', [$this, 'getJ3Header'], true); + + $container->alias(J4Header::class, 'J4.Header') + ->share('J4.Header', [$this, 'getJ4Header'], true); + + $container->alias(HeaderInterface::class, 'Header') + ->share('Header', [$this, 'getHeader'], true); + } + + /** + * Get the Header + * + * @param Container $container The DI container. + * + * @return HeaderInterface + * @since 3.2.0 + */ + public function getHeader(Container $container): HeaderInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Header'); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J3Header + * @since 3.2.0 + */ + public function getJ3Header(Container $container): J3Header + { + return new J3Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J4Header + * @since 3.2.0 + */ + public function getJ4Header(Container $container): J4Header + { + return new J4Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } +} + 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 index 7b3a67d4e..031d3f730 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php @@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\History as J3History; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\History as J4History; /** @@ -47,6 +48,9 @@ class History implements ServiceProviderInterface $container->alias(J3History::class, 'J3.History') ->share('J3.History', [$this, 'getJ3History'], true); + $container->alias(J4History::class, 'J4.History') + ->share('J4.History', [$this, 'getJ4History'], true); + $container->alias(HistoryInterface::class, 'History') ->share('History', [$this, 'getHistory'], true); } @@ -83,6 +87,20 @@ class History implements ServiceProviderInterface $container->get('Config') ); } - + + /** + * Get the Joomla 4 History + * + * @param Container $container The DI container. + * + * @return J4History + * @since 3.2.0 + */ + public function getJ4History(Container $container): J4History + { + return new J4History( + $container->get('Config') + ); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php index fe9caea63..510fd6147 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php @@ -44,7 +44,9 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Conditions; use VDM\Joomla\Componentbuilder\Compiler\Model\Fields; use VDM\Joomla\Componentbuilder\Compiler\Model\Updatesql; use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs; -use VDM\Joomla\Componentbuilder\Compiler\Model\Customtabs; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface as Customtabs; +use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaThree\Customtabs as CustomtabsJ3; +use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFour\Customtabs as CustomtabsJ4; use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews; use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking; use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump; @@ -52,6 +54,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Whmcs; use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders; use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate; use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate; +use VDM\Joomla\Componentbuilder\Compiler\Model\Router; use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver; @@ -62,6 +65,14 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver; */ class Model implements ServiceProviderInterface { + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + /** * Registers the service provider with a DI container. * @@ -72,107 +83,119 @@ class Model implements ServiceProviderInterface */ public function register(Container $container) { + $container->alias(ServerLoad::class, 'Model.Server.Load') + ->share('Model.Server.Load', [$this, 'getServerLoad'], true); + $container->alias(Joomlaplugins::class, 'Model.Joomlaplugins') - ->share('Model.Joomlaplugins', [$this, 'getModelJoomlaplugins'], true); + ->share('Model.Joomlaplugins', [$this, 'getJoomlaplugins'], true); $container->alias(Joomlamodules::class, 'Model.Joomlamodules') - ->share('Model.Joomlamodules', [$this, 'getModelJoomlamodules'], true); + ->share('Model.Joomlamodules', [$this, 'getJoomlamodules'], true); $container->alias(Historycomponent::class, 'Model.Historycomponent') - ->share('Model.Historycomponent', [$this, 'getModelHistorycomponent'], true); + ->share('Model.Historycomponent', [$this, 'getHistorycomponent'], true); $container->alias(Customadminviews::class, 'Model.Customadminviews') - ->share('Model.Customadminviews', [$this, 'getModelCustomadminviews'], true); + ->share('Model.Customadminviews', [$this, 'getCustomadminviews'], true); $container->alias(Ajaxcustomview::class, 'Model.Ajaxcustomview') - ->share('Model.Ajaxcustomview', [$this, 'getModelAjaxcustomview'], true); + ->share('Model.Ajaxcustomview', [$this, 'getAjaxcustomview'], true); $container->alias(Javascriptcustomview::class, 'Model.Javascriptcustomview') - ->share('Model.Javascriptcustomview', [$this, 'getModelJavascriptcustomview'], true); + ->share('Model.Javascriptcustomview', [$this, 'getJavascriptcustomview'], true); $container->alias(Csscustomview::class, 'Model.Csscustomview') - ->share('Model.Csscustomview', [$this, 'getModelCsscustomview'], true); + ->share('Model.Csscustomview', [$this, 'getCsscustomview'], true); $container->alias(Phpcustomview::class, 'Model.Phpcustomview') - ->share('Model.Phpcustomview', [$this, 'getModelPhpcustomview'], true); + ->share('Model.Phpcustomview', [$this, 'getPhpcustomview'], true); $container->alias(Dynamicget::class, 'Model.Dynamicget') - ->share('Model.Dynamicget', [$this, 'getModelDynamicget'], true); + ->share('Model.Dynamicget', [$this, 'getDynamicget'], true); $container->alias(Libraries::class, 'Model.Libraries') - ->share('Model.Libraries', [$this, 'getModelLibraries'], true); + ->share('Model.Libraries', [$this, 'getLibraries'], true); $container->alias(Siteviews::class, 'Model.Siteviews') - ->share('Model.Siteviews', [$this, 'getModelSiteviews'], true); + ->share('Model.Siteviews', [$this, 'getSiteviews'], true); $container->alias(Permissions::class, 'Model.Permissions') - ->share('Model.Permissions', [$this, 'getModelPermissions'], true); + ->share('Model.Permissions', [$this, 'getPermissions'], true); $container->alias(Historyadminview::class, 'Model.Historyadminview') - ->share('Model.Historyadminview', [$this, 'getModelHistoryadminview'], true); + ->share('Model.Historyadminview', [$this, 'getHistoryadminview'], true); $container->alias(Mysqlsettings::class, 'Model.Mysqlsettings') - ->share('Model.Mysqlsettings', [$this, 'getModelMysqlsettings'], true); + ->share('Model.Mysqlsettings', [$this, 'getMysqlsettings'], true); $container->alias(Sql::class, 'Model.Sql') - ->share('Model.Sql', [$this, 'getModelSql'], true); + ->share('Model.Sql', [$this, 'getSql'], true); $container->alias(Customalias::class, 'Model.Customalias') - ->share('Model.Customalias', [$this, 'getModelCustomalias'], true); + ->share('Model.Customalias', [$this, 'getCustomalias'], true); $container->alias(Ajaxadmin::class, 'Model.Ajaxadmin') - ->share('Model.Ajaxadmin', [$this, 'getModelAjaxadmin'], true); + ->share('Model.Ajaxadmin', [$this, 'getAjaxadmin'], true); $container->alias(Customimportscripts::class, 'Model.Customimportscripts') - ->share('Model.Customimportscripts', [$this, 'getModelCustomimportscripts'], true); + ->share('Model.Customimportscripts', [$this, 'getCustomimportscripts'], true); $container->alias(Custombuttons::class, 'Model.Custombuttons') - ->share('Model.Custombuttons', [$this, 'getModelCustombuttons'], true); + ->share('Model.Custombuttons', [$this, 'getCustombuttons'], true); $container->alias(Loader::class, 'Model.Loader') - ->share('Model.Loader', [$this, 'getModelLoader'], true); + ->share('Model.Loader', [$this, 'getLoader'], true); $container->alias(Phpadminview::class, 'Model.Phpadminview') - ->share('Model.Phpadminview', [$this, 'getModelPhpadminview'], true); + ->share('Model.Phpadminview', [$this, 'getPhpadminview'], true); $container->alias(Cssadminview::class, 'Model.Cssadminview') - ->share('Model.Cssadminview', [$this, 'getModelCssadminview'], true); + ->share('Model.Cssadminview', [$this, 'getCssadminview'], true); $container->alias(Javascriptadminview::class, 'Model.Javascriptadminview') - ->share('Model.Javascriptadminview', [$this, 'getModelJavascriptadminview'], true); + ->share('Model.Javascriptadminview', [$this, 'getJavascriptadminview'], true); $container->alias(Linkedviews::class, 'Model.Linkedviews') - ->share('Model.Linkedviews', [$this, 'getModelLinkedviews'], true); + ->share('Model.Linkedviews', [$this, 'getLinkedviews'], true); $container->alias(Relations::class, 'Model.Relations') - ->share('Model.Relations', [$this, 'getModelRelations'], true); + ->share('Model.Relations', [$this, 'getRelations'], true); $container->alias(Conditions::class, 'Model.Conditions') - ->share('Model.Conditions', [$this, 'getModelConditions'], true); + ->share('Model.Conditions', [$this, 'getConditions'], true); $container->alias(Fields::class, 'Model.Fields') - ->share('Model.Fields', [$this, 'getModelFields'], true); + ->share('Model.Fields', [$this, 'getFields'], true); $container->alias(Updatesql::class, 'Model.Updatesql') - ->share('Model.Updatesql', [$this, 'getModelUpdatesql'], true); + ->share('Model.Updatesql', [$this, 'getUpdatesql'], true); $container->alias(Tabs::class, 'Model.Tabs') - ->share('Model.Tabs', [$this, 'getModelTabs'], true); + ->share('Model.Tabs', [$this, 'getTabs'], true); $container->alias(Customtabs::class, 'Model.Customtabs') - ->share('Model.Customtabs', [$this, 'getModelCustomtabs'], true); + ->share('Model.Customtabs', [$this, 'getCustomtabs'], true); + + $container->alias(CustomtabsJ3::class, 'Model.J3.Customtabs') + ->share('Model.J3.Customtabs', [$this, 'getCustomtabsJ3'], true); + + $container->alias(CustomtabsJ4::class, 'Model.J4.Customtabs') + ->share('Model.J4.Customtabs', [$this, 'getCustomtabsJ4'], true); $container->alias(Adminviews::class, 'Model.Adminviews') - ->share('Model.Adminviews', [$this, 'getModelAdminviews'], true); + ->share('Model.Adminviews', [$this, 'getAdminviews'], true); $container->alias(Sqltweaking::class, 'Model.Sqltweaking') - ->share('Model.Sqltweaking', [$this, 'getModelSqltweaking'], true); + ->share('Model.Sqltweaking', [$this, 'getSqltweaking'], true); $container->alias(Sqldump::class, 'Model.Sqldump') - ->share('Model.Sqldump', [$this, 'getModelSqldump'], true); + ->share('Model.Sqldump', [$this, 'getSqldump'], true); $container->alias(Whmcs::class, 'Model.Whmcs') - ->share('Model.Whmcs', [$this, 'getModelWhmcs'], true); + ->share('Model.Whmcs', [$this, 'getWhmcs'], true); + + $container->alias(Filesfolders::class, 'Model.Filesfolders') + ->share('Model.Filesfolders', [$this, 'getFilesfolders'], true); $container->alias(Modifieddate::class, 'Model.Modifieddate') ->share('Model.Modifieddate', [$this, 'getModifieddate'], true); @@ -180,25 +203,38 @@ class Model implements ServiceProviderInterface $container->alias(Createdate::class, 'Model.Createdate') ->share('Model.Createdate', [$this, 'getCreatedate'], true); + $container->alias(Router::class, 'Model.Router') + ->share('Model.Router', [$this, 'getRouter'], true); + $container->alias(Updateserver::class, 'Model.Updateserver') ->share('Model.Updateserver', [$this, 'getUpdateserver'], true); - - $container->alias(Filesfolders::class, 'Model.Filesfolders') - ->share('Model.Filesfolders', [$this, 'getModelFilesfolders'], true); - - $container->alias(ServerLoad::class, 'Model.Server.Load') - ->share('Model.Server.Load', [$this, 'getServerLoad'], true); } /** - * Get the Joomla plugins Model + * Get The Load Class. + * + * @param Container $container The DI container. + * + * @return ServerLoad + * @since 3.2.0 + */ + public function getServerLoad(Container $container): ServerLoad + { + return new ServerLoad( + $container->get('Crypt'), + $container->get('Table') + ); + } + + /** + * Get The Joomlaplugins Class. * * @param Container $container The DI container. * * @return Joomlaplugins * @since 3.2.0 */ - public function getModelJoomlaplugins(Container $container): Joomlaplugins + public function getJoomlaplugins(Container $container): Joomlaplugins { return new Joomlaplugins( $container->get('Joomlaplugin.Data') @@ -206,14 +242,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Joomla modules Model + * Get The Joomlamodules Class. * * @param Container $container The DI container. * * @return Joomlamodules * @since 3.2.0 */ - public function getModelJoomlamodules(Container $container): Joomlamodules + public function getJoomlamodules(Container $container): Joomlamodules { return new Joomlamodules( $container->get('Joomlamodule.Data') @@ -221,14 +257,14 @@ class Model implements ServiceProviderInterface } /** - * Get the history component Model + * Get The Historycomponent Class. * * @param Container $container The DI container. * * @return Historycomponent * @since 3.2.0 */ - public function getModelHistorycomponent(Container $container): Historycomponent + public function getHistorycomponent(Container $container): Historycomponent { return new Historycomponent( $container->get('Config'), @@ -238,14 +274,14 @@ class Model implements ServiceProviderInterface } /** - * Get the custom admin views Model + * Get The Customadminviews Class. * * @param Container $container The DI container. * * @return Customadminviews * @since 3.2.0 */ - public function getModelCustomadminviews(Container $container): Customadminviews + public function getCustomadminviews(Container $container): Customadminviews { return new Customadminviews( $container->get('Customview.Data'), @@ -254,14 +290,14 @@ class Model implements ServiceProviderInterface } /** - * Get the ajax custom view Model + * Get The Ajaxcustomview Class. * * @param Container $container The DI container. * * @return Ajaxcustomview * @since 3.2.0 */ - public function getModelAjaxcustomview(Container $container): Ajaxcustomview + public function getAjaxcustomview(Container $container): Ajaxcustomview { return new Ajaxcustomview( $container->get('Config'), @@ -270,14 +306,14 @@ class Model implements ServiceProviderInterface } /** - * Get the javascript custom view Model + * Get The Javascriptcustomview Class. * * @param Container $container The DI container. * * @return Javascriptcustomview * @since 3.2.0 */ - public function getModelJavascriptcustomview(Container $container): Javascriptcustomview + public function getJavascriptcustomview(Container $container): Javascriptcustomview { return new Javascriptcustomview( $container->get('Customcode'), @@ -286,14 +322,14 @@ class Model implements ServiceProviderInterface } /** - * Get the css custom view Model + * Get The Csscustomview Class. * * @param Container $container The DI container. * * @return Csscustomview * @since 3.2.0 */ - public function getModelCsscustomview(Container $container): Csscustomview + public function getCsscustomview(Container $container): Csscustomview { return new Csscustomview( $container->get('Customcode') @@ -301,14 +337,14 @@ class Model implements ServiceProviderInterface } /** - * Get the php custom view Model + * Get The Phpcustomview Class. * * @param Container $container The DI container. * * @return Phpcustomview * @since 3.2.0 */ - public function getModelPhpcustomview(Container $container): Phpcustomview + public function getPhpcustomview(Container $container): Phpcustomview { return new Phpcustomview( $container->get('Customcode'), @@ -319,14 +355,14 @@ class Model implements ServiceProviderInterface } /** - * Get the dynamic get Model + * Get The Dynamicget Class. * * @param Container $container The DI container. * * @return Dynamicget * @since 3.2.0 */ - public function getModelDynamicget(Container $container): Dynamicget + public function getDynamicget(Container $container): Dynamicget { return new Dynamicget( $container->get('Config'), @@ -340,14 +376,14 @@ class Model implements ServiceProviderInterface } /** - * Get the libraries Model + * Get The Libraries Class. * * @param Container $container The DI container. * * @return Libraries * @since 3.2.0 */ - public function getModelLibraries(Container $container): Libraries + public function getLibraries(Container $container): Libraries { return new Libraries( $container->get('Config'), @@ -357,14 +393,14 @@ class Model implements ServiceProviderInterface } /** - * Get the site views Model + * Get The Siteviews Class. * * @param Container $container The DI container. * * @return Siteviews * @since 3.2.0 */ - public function getModelSiteviews(Container $container): Siteviews + public function getSiteviews(Container $container): Siteviews { return new Siteviews( $container->get('Customview.Data'), @@ -373,27 +409,27 @@ class Model implements ServiceProviderInterface } /** - * Get the permissions Model + * Get The Permissions Class. * * @param Container $container The DI container. * * @return Permissions * @since 3.2.0 */ - public function getModelPermissions(Container $container): Permissions + public function getPermissions(Container $container): Permissions { return new Permissions(); } /** - * Get the admin view history Model + * Get The Historyadminview Class. * * @param Container $container The DI container. * * @return Historyadminview * @since 3.2.0 */ - public function getModelHistoryadminview(Container $container): Historyadminview + public function getHistoryadminview(Container $container): Historyadminview { return new Historyadminview( $container->get('Config'), @@ -403,14 +439,14 @@ class Model implements ServiceProviderInterface } /** - * Get the MySQL settings Model + * Get The Mysqlsettings Class. * * @param Container $container The DI container. * * @return Mysqlsettings * @since 3.2.0 */ - public function getModelMysqlsettings(Container $container): Mysqlsettings + public function getMysqlsettings(Container $container): Mysqlsettings { return new Mysqlsettings( $container->get('Config'), @@ -419,14 +455,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Sql Model + * Get The Sql Class. * * @param Container $container The DI container. * * @return Sql * @since 3.2.0 */ - public function getModelSql(Container $container): Sql + public function getSql(Container $container): Sql { return new Sql( $container->get('Customcode.Dispenser'), @@ -435,14 +471,14 @@ class Model implements ServiceProviderInterface } /** - * Get the custom alias Model + * Get The Customalias Class. * * @param Container $container The DI container. * * @return Customalias * @since 3.2.0 */ - public function getModelCustomalias(Container $container): Customalias + public function getCustomalias(Container $container): Customalias { return new Customalias( $container->get('Compiler.Builder.Custom.Alias'), @@ -451,14 +487,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Admin Ajax Model + * Get The Ajaxadmin Class. * * @param Container $container The DI container. * * @return Ajaxadmin * @since 3.2.0 */ - public function getModelAjaxadmin(Container $container): Ajaxadmin + public function getAjaxadmin(Container $container): Ajaxadmin { return new Ajaxadmin( $container->get('Config'), @@ -468,14 +504,14 @@ class Model implements ServiceProviderInterface } /** - * Get the custom import scripts Model + * Get The Customimportscripts Class. * * @param Container $container The DI container. * * @return Customimportscripts * @since 3.2.0 */ - public function getModelCustomimportscripts(Container $container): Customimportscripts + public function getCustomimportscripts(Container $container): Customimportscripts { return new Customimportscripts( $container->get('Customcode.Dispenser') @@ -483,14 +519,14 @@ class Model implements ServiceProviderInterface } /** - * Get the custom import scripts Model + * Get The Custombuttons Class. * * @param Container $container The DI container. * * @return Custombuttons * @since 3.2.0 */ - public function getModelCustombuttons(Container $container): Custombuttons + public function getCustombuttons(Container $container): Custombuttons { return new Custombuttons( $container->get('Customcode'), @@ -500,14 +536,14 @@ class Model implements ServiceProviderInterface } /** - * Get The Model Loader Class. + * Get The Loader Class. * * @param Container $container The DI container. * * @return Loader * @since 3.2.0 */ - public function getModelLoader(Container $container): Loader + public function getLoader(Container $container): Loader { return new Loader( $container->get('Config'), @@ -519,14 +555,14 @@ class Model implements ServiceProviderInterface } /** - * Get the php admin view Model + * Get The Phpadminview Class. * * @param Container $container The DI container. * * @return Phpadminview * @since 3.2.0 */ - public function getModelPhpadminview(Container $container): Phpadminview + public function getPhpadminview(Container $container): Phpadminview { return new Phpadminview( $container->get('Customcode.Dispenser'), @@ -535,14 +571,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Css Adminview Model + * Get The Cssadminview Class. * * @param Container $container The DI container. * * @return Cssadminview * @since 3.2.0 */ - public function getModelCssadminview(Container $container): Cssadminview + public function getCssadminview(Container $container): Cssadminview { return new Cssadminview( $container->get('Customcode.Dispenser') @@ -550,14 +586,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Javascript Adminview Model + * Get The Javascriptadminview Class. * * @param Container $container The DI container. * * @return Javascriptadminview * @since 3.2.0 */ - public function getModelJavascriptadminview(Container $container): Javascriptadminview + public function getJavascriptadminview(Container $container): Javascriptadminview { return new Javascriptadminview( $container->get('Customcode.Dispenser') @@ -565,14 +601,14 @@ class Model implements ServiceProviderInterface } /** - * Get the linked views Model + * Get The Linkedviews Class. * * @param Container $container The DI container. * * @return Linkedviews * @since 3.2.0 */ - public function getModelLinkedviews(Container $container): Linkedviews + public function getLinkedviews(Container $container): Linkedviews { return new Linkedviews( $container->get('Registry') @@ -580,14 +616,14 @@ class Model implements ServiceProviderInterface } /** - * Get the relations Model + * Get The Relations Class. * * @param Container $container The DI container. * * @return Relations * @since 3.2.0 */ - public function getModelRelations(Container $container): Relations + public function getRelations(Container $container): Relations { return new Relations( $container->get('Config'), @@ -600,14 +636,14 @@ class Model implements ServiceProviderInterface } /** - * Get the conditions Model + * Get The Conditions Class. * * @param Container $container The DI container. * * @return Conditions * @since 3.2.0 */ - public function getModelConditions(Container $container): Conditions + public function getConditions(Container $container): Conditions { return new Conditions( $container->get('Field.Type.Name'), @@ -617,14 +653,14 @@ class Model implements ServiceProviderInterface } /** - * Get the fields Model + * Get The Fields Class. * * @param Container $container The DI container. * * @return Fields * @since 3.2.0 */ - public function getModelFields(Container $container): Fields + public function getFields(Container $container): Fields { return new Fields( $container->get('Config'), @@ -639,14 +675,14 @@ class Model implements ServiceProviderInterface } /** - * Get the update sql Model + * Get The Updatesql Class. * * @param Container $container The DI container. * * @return Updatesql * @since 3.2.0 */ - public function getModelUpdatesql(Container $container): Updatesql + public function getUpdatesql(Container $container): Updatesql { return new Updatesql( $container->get('Registry') @@ -654,29 +690,47 @@ class Model implements ServiceProviderInterface } /** - * Get the tabs Model + * Get The Tabs Class. * * @param Container $container The DI container. * - * @return Updatesql + * @return Tabs * @since 3.2.0 */ - public function getModelTabs(Container $container): Tabs + public function getTabs(Container $container): Tabs { return new Tabs(); } /** - * Get the custom tabs Model + * Get The Customtabs Class. * * @param Container $container The DI container. * * @return Customtabs * @since 3.2.0 */ - public function getModelCustomtabs(Container $container): Customtabs + public function getCustomtabs(Container $container): Customtabs { - return new Customtabs( + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Model.J' . $this->targetVersion . '.Customtabs'); + } + + /** + * Get The CustomtabsJ3 Class. + * + * @param Container $container The DI container. + * + * @return CustomtabsJ3 + * @since 3.2.0 + */ + public function getCustomtabsJ3(Container $container): CustomtabsJ3 + { + return new CustomtabsJ3( $container->get('Config'), $container->get('Compiler.Builder.Custom.Tabs'), $container->get('Language'), @@ -686,14 +740,33 @@ class Model implements ServiceProviderInterface } /** - * Get the admin views Model + * Get The CustomtabsJ4 Class. + * + * @param Container $container The DI container. + * + * @return CustomtabsJ4 + * @since 3.2.0 + */ + public function getCustomtabsJ4(Container $container): CustomtabsJ4 + { + return new CustomtabsJ4( + $container->get('Config'), + $container->get('Compiler.Builder.Custom.Tabs'), + $container->get('Language'), + $container->get('Placeholder'), + $container->get('Customcode') + ); + } + + /** + * Get The Adminviews Class. * * @param Container $container The DI container. * * @return Adminviews * @since 3.2.0 */ - public function getModelAdminviews(Container $container): Adminviews + public function getAdminviews(Container $container): Adminviews { return new Adminviews( $container->get('Config'), @@ -704,14 +777,14 @@ class Model implements ServiceProviderInterface } /** - * Get the SQL tweaking Model + * Get The Sqltweaking Class. * * @param Container $container The DI container. * * @return Sqltweaking * @since 3.2.0 */ - public function getModelSqltweaking(Container $container): Sqltweaking + public function getSqltweaking(Container $container): Sqltweaking { return new Sqltweaking( $container->get('Registry') @@ -719,14 +792,14 @@ class Model implements ServiceProviderInterface } /** - * Get the SQL dump Model + * Get The Sqldump Class. * * @param Container $container The DI container. * * @return Sqldump * @since 3.2.0 */ - public function getModelSqldump(Container $container): Sqldump + public function getSqldump(Container $container): Sqldump { return new Sqldump( $container->get('Registry') @@ -734,20 +807,33 @@ class Model implements ServiceProviderInterface } /** - * Get the whmcs Model + * Get The Whmcs Class. * * @param Container $container The DI container. * * @return Whmcs * @since 3.2.0 */ - public function getModelWhmcs(Container $container): Whmcs + public function getWhmcs(Container $container): Whmcs { return new Whmcs(); } /** - * Get the modified date Model + * Get The Filesfolders Class. + * + * @param Container $container The DI container. + * + * @return Filesfolders + * @since 3.2.0 + */ + public function getFilesfolders(Container $container): Filesfolders + { + return new Filesfolders(); + } + + /** + * Get The Modifieddate Class. * * @param Container $container The DI container. * @@ -760,7 +846,7 @@ class Model implements ServiceProviderInterface } /** - * Get the create date Model + * Get The Createdate Class. * * @param Container $container The DI container. * @@ -773,7 +859,24 @@ class Model implements ServiceProviderInterface } /** - * Get the update server Model + * Get The Router Class. + * + * @param Container $container The DI container. + * + * @return Router + * @since 3.2.0 + */ + public function getRouter(Container $container): Router + { + return new Router( + $container->get('Config'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The Updateserver Class. * * @param Container $container The DI container. * @@ -783,35 +886,6 @@ class Model implements ServiceProviderInterface public function getUpdateserver(Container $container): Updateserver { return new Updateserver(); - } - - /** - * Get the files folders Model - * - * @param Container $container The DI container. - * - * @return Filesfolders - * @since 3.2.0 - */ - public function getModelFilesfolders(Container $container): Filesfolders - { - return new Filesfolders(); - } - - /** - * Get the Server Model Server Loader class - * - * @param Container $container The DI container. - * - * @return ServerLoad - * @since 3.2.0 - */ - public function getServerLoad(Container $container): ServerLoad - { - return new ServerLoad( - $container->get('Crypt'), - $container->get('Table') - ); } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php index b03acb72a..845ce4041 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php @@ -178,7 +178,6 @@ class Power implements ServiceProviderInterface $container->get('Power'), $container->get('Compiler.Builder.Content.One'), $container->get('Compiler.Builder.Content.Multi'), - $container->get('Power.Autoloader'), $container->get('Power.Parser'), $container->get('Power.Repo.Readme'), $container->get('Power.Repos.Readme'), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php index 40d4d3625..2f4b56a6d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php @@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\FileInjector; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; @@ -50,6 +51,9 @@ class Utilities implements ServiceProviderInterface $container->alias(File::class, 'Utilities.File') ->share('Utilities.File', [$this, 'getFile'], true); + $container->alias(FileInjector::class, 'Utilities.FileInjector') + ->share('Utilities.FileInjector', [$this, 'getFileInjector'], true); + $container->alias(Counter::class, 'Utilities.Counter') ->share('Utilities.Counter', [$this, 'getCounter'], true); @@ -106,6 +110,21 @@ class Utilities implements ServiceProviderInterface ); } + /** + * Get The FileInjector Class. + * + * @param Container $container The DI container. + * + * @return FileInjector + * @since 3.2.0 + */ + public function getFileInjector(Container $container): FileInjector + { + return new FileInjector( + $container->get('Power.Injector') + ); + } + /** * Get the Compiler Counter * @@ -203,6 +222,7 @@ class Utilities implements ServiceProviderInterface public function getStructure(Container $container): Structure { return new Structure( + $container->get('Placeholder'), $container->get('Component.Settings'), $container->get('Utilities.Paths'), $container->get('Utilities.Counter'), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Templatelayout/Data.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Templatelayout/Data.php index f0cca1754..1f15a35b8 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Templatelayout/Data.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Templatelayout/Data.php @@ -160,10 +160,10 @@ class Data { // set the Layout data $lay1 = GetHelper::allBetween( - $content, "JLayoutHelper::render('", "'," + $content, "LayoutHelper::render('", "'," ); $lay2 = GetHelper::allBetween( - $content, 'JLayoutHelper::render("', '",' + $content, 'LayoutHelper::render("', '",' ); if (ArrayHelper::check($lay1) && ArrayHelper::check($lay2)) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php new file mode 100644 index 000000000..47c9af0bf --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php @@ -0,0 +1,213 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Power\Injector as Power; +use VDM\Joomla\Utilities\MathHelper; + + +/** + * File Injector + * Thanks to http://stackoverflow.com/a/16813550/1429677 + * + * @since 3.2.0 + */ +final class FileInjector +{ + /** + * The Injector Class. + * + * @var Power + * @since 3.2.0 + */ + protected Power $power; + + /** + * The pattern to get the powers + * + * @var string + * @since 3.2.0 + **/ + protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/'; + + /** + * Constructor. + * + * @param Power $power The Injector Class. + * + * @since 3.2.0 + */ + public function __construct(Power $power) + { + $this->power = $power; + } + + /** + * Inserts or replaces data in a file at a specific position. + * + * @param string $file The path of the file to modify. + * @param string $data The data to insert or replace. + * @param int $position The position in the file where the data should be inserted or replaced. + * @param int|null $replace The number of bytes to replace; if null, data will be inserted. + * + * @return void + * @throws \RuntimeException If unable to open or modify the file. + * @throws \InvalidArgumentException If the position is negative. + * @since 3.2.0 + */ + public function add(string $file, string $data, int $position, ?int $replace = null): void + { + if ($position < 0) + { + throw new \InvalidArgumentException('Position cannot be negative.'); + } + + $found_super_powers = preg_match($this->pattern, $data); + $actual_file = $this->openFileWithLock($file); + + try + { + $temp_file = fopen('php://temp', "rw+"); + if ($temp_file === false) + { + throw new \RuntimeException("Unable to open temporary file."); + } + + $this->processFile($actual_file, $temp_file, $data, $position, $replace); + + if ($found_super_powers) + { + $this->injectSuperPowers($actual_file); + } + } + finally + { + flock($actual_file, LOCK_UN); + fclose($actual_file); + if (isset($temp_file)) + { + fclose($temp_file); + } + } + } + + /** + * Opens a file and acquires an exclusive lock on it. + * + * @param string $file The file path to open. + * + * @return resource The file handle. + * @throws \RuntimeException If the file cannot be opened or locked. + * @since 3.2.0 + */ + private function openFileWithLock(string $file) + { + $actual_file = fopen($file, "rw+"); + if ($actual_file === false || !flock($actual_file, LOCK_EX)) + { + throw new \RuntimeException("Unable to open and lock the file: {$file}"); + } + return $actual_file; + } + + /** + * Processes the file for data insertion and copying the remaining data. + * + * @param resource $actual_file The file handle of the actual file. + * @param resource $temp_file The file handle of the temporary file. + * @param string $data The data to be inserted. + * @param int $position The position in the file for the data insertion. + * @param int|null $replace The number of bytes to replace; if null, data will be inserted. + * + * @return void + * @since 3.2.0 + */ + private function processFile($actual_file, $temp_file, string $data, int $position, ?int $replace): void + { + // Make a copy of the file in the temporary stream + stream_copy_to_stream($actual_file, $temp_file); + + // Move to the position where the data should be added + fseek($actual_file, $position); + + // Add the data + fwrite($actual_file, $data); + + $this->truncateIfNeeded($actual_file, $data, $position); + $this->copyRemainingData($actual_file, $temp_file, $position, $replace); + } + + /** + * Truncates the file after data insertion if necessary. + * + * @param resource $actual_file The file handle. + * @param string $data The data that was inserted. + * @param int $position The position where data was inserted. + * + * @return void + * @since 3.2.0 + */ + private function truncateIfNeeded($actual_file, string $data, int $position): void + { + // Truncate the file at the end of the added data if replacing + $data_length = mb_strlen($data, '8bit'); + $remove = MathHelper::bc('add', $position, $data_length); + ftruncate($actual_file, $remove); + } + + /** + * Copies the remaining data from the temporary stream to the actual file. + * + * @param resource $actual_file The file handle of the actual file. + * @param resource $temp_file The file handle of the temporary file. + * @param int $position The position in the file where data insertion finished. + * @param int|null $replace The number of bytes that were replaced; if null, data was inserted. + * + * @return void + * @since 3.2.0 + */ + private function copyRemainingData($actual_file, $temp_file, int $position, ?int $replace): void + { + // check if this was a replacement of data + $position = MathHelper::bc('add', $position, $replace ?: 0); + + // Move to the position of the remaining data in the temporary stream + fseek($temp_file, $position); + + // Copy the remaining data from the temporary stream to the file + stream_copy_to_stream($temp_file, $actual_file); + } + + /** + * Injects super powers into the file content, if found, and updates the file. + * + * @param resource $actual_file The file handle of the actual file. + * + * @return void + * @since 3.2.0 + */ + private function injectSuperPowers($actual_file): void + { + rewind($actual_file); + + $power_data = $this->power->power( + stream_get_contents($actual_file) + ); + + ftruncate($actual_file, 0); + rewind($actual_file); + + fwrite($actual_file, $power_data); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php index ccef5d633..5cddb26f3 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php @@ -17,8 +17,8 @@ use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\File as JoomlaFile; use Joomla\CMS\Filesystem\Folder; -use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; -use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; @@ -35,41 +35,49 @@ use VDM\Joomla\Utilities\StringHelper; class Structure { /** - * Compiler Component Joomla Version Settings + * The Placeholder Class. * - * @var Settings + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The SettingsInterface Class. + * + * @var Settings * @since 3.2.0 */ protected Settings $settings; /** - * Compiler Utilities Paths + * The Paths Class. * - * @var Paths + * @var Paths * @since 3.2.0 */ protected Paths $paths; /** - * Compiler Counter + * The Counter Class. * - * @var Counter + * @var Counter * @since 3.2.0 */ protected Counter $counter; /** - * Compiler Utilities File + * The File Class. * - * @var File + * @var File * @since 3.2.0 */ protected File $file; /** - * Compiler Utilities Files + * The Files Class. * - * @var Files + * @var Files * @since 3.2.0 */ protected Files $files; @@ -85,25 +93,25 @@ class Structure /** * Constructor. * - * @param Settings|null $settings The compiler component joomla version settings object. - * @param Paths|null $paths The compiler paths object. - * @param Counter|null $counter The compiler counter object. - * @param File|null $file The compiler file object. - * @param Files|null $files The compiler files object. - * @param CMSApplication|null $app The CMS Application object. + * @param Placeholder $placeholder The Placeholder Class. + * @param Settings $settings The SettingsInterface Class. + * @param Paths $paths The Paths Class. + * @param Counter $counter The Counter Class. + * @param File $file The File Class. + * @param Files $files The Files Class. + * @param CMSApplication|null $app The CMS Application object. * * @since 3.2.0 - * @throws \Exception */ - public function __construct(?Settings $settings = null, ?Paths $paths = null, - ?Counter $counter = null, ?File $file = null, ?Files $files = null, - ?CMSApplication $app = null) + public function __construct(Placeholder $placeholder, Settings $settings, Paths $paths, + Counter $counter, File $file, Files $files, ?CMSApplication $app = null) { - $this->settings = $settings ?: Compiler::_('Component.Settings'); - $this->paths = $paths ?: Compiler::_('Utilities.Paths'); - $this->counter = $counter ?: Compiler::_('Utilities.Counter'); - $this->file = $file ?: Compiler::_('Utilities.File'); - $this->files = $files ?: Compiler::_('Utilities.Files'); + $this->placeholder = $placeholder; + $this->settings = $settings; + $this->paths = $paths; + $this->counter = $counter; + $this->file = $file; + $this->files = $files; $this->app = $app ?: Factory::getApplication(); } @@ -130,6 +138,15 @@ class Structure // search the target foreach ($target as $main => $name) { + // get the key name (either file name or name) + $key = $fileName ?? $name; + + // add to placeholders as Name and name + $this->placeholder->set('Name', StringHelper::safe($name, 'F')); + $this->placeholder->set('name', StringHelper::safe($name)); + $this->placeholder->set('Key', StringHelper::safe($key, 'F')); + $this->placeholder->set('key', StringHelper::safe($key)); + // make sure it is lower case $name = StringHelper::safe($name); @@ -157,6 +174,12 @@ class Structure } } } + + // remove the name from placeholders + $this->placeholder->remove('Name'); + $this->placeholder->remove('name'); + $this->placeholder->remove('Key'); + $this->placeholder->remove('key'); } } @@ -251,6 +274,8 @@ class Structure { $path = $details->path; } + + $path = $this->placeholder->update_($path); // make sure we have component to replace if (strpos((string) $path, 'c0mp0n3nt') !== false) @@ -291,23 +316,27 @@ class Structure if (!empty($fileName)) { $name = $name . '_' . $fileName; + } - return str_replace( + if ($details->rename === 'new') + { + $item = $details->newName; + } + elseif (!empty($fileName)) + { + $item = str_replace( $details->rename, $fileName, $item ); } - elseif ($details->rename === 'new') + else { - return $details->newName; + $item = str_replace( + $details->rename, $name, $item + ); } - - return str_replace( - $details->rename, $name, $item - ); } - return $item; - } - + return $this->placeholder->update_($item); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Table.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Table.php index 0210aa25a..76dee138b 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Table.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Table.php @@ -67,23 +67,14 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'css_admin' => [ - 'name' => 'css_admin', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_ADMIN_LABEL', - 'type' => 'editor', + 'debug_linenr' => [ + 'name' => 'debug_linenr', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'Libs & Helpers', - ], - 'php_admin_event' => [ - 'name' => 'php_admin_event', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'Libs & Helpers', + 'store' => NULL, + 'tab_name' => 'Details', ], 'php_site_event' => [ 'name' => 'php_site_event', @@ -94,33 +85,69 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'Libs & Helpers', ], - 'crowdin_username' => [ - 'name' => 'crowdin_username', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_USERNAME_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'basic_encryption', - 'tab_name' => 'Dynamic Integration', - ], - 'component_version' => [ - 'name' => 'component_version', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPONENT_VERSION_LABEL', - 'type' => 'text', + 'translation_tool' => [ + 'name' => 'translation_tool', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION_TOOL_LABEL', + 'type' => 'list', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, - 'tab_name' => 'Details', + 'tab_name' => 'Dynamic Integration', ], - 'php_postflight_install' => [ - 'name' => 'php_postflight_install', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_LABEL', + 'buildcompsql' => [ + 'name' => 'buildcompsql', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dynamic Build (beta)', + ], + 'add_sales_server' => [ + 'name' => 'add_sales_server', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_preflight_install' => [ + 'name' => 'php_preflight_install', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL', 'type' => 'editor', 'title' => false, 'list' => 'joomla_components', 'store' => 'base64', 'tab_name' => 'Dash & Install', ], + 'php_method_uninstall' => [ + 'name' => 'php_method_uninstall', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'css_admin' => [ + 'name' => 'css_admin', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_ADMIN_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'mvc_versiondate' => [ + 'name' => 'mvc_versiondate', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL', + 'type' => 'list', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], 'remove_line_breaks' => [ 'name' => 'remove_line_breaks', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL', @@ -130,6 +157,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], + 'add_placeholders' => [ + 'name' => 'add_placeholders', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], 'description' => [ 'name' => 'description', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL', @@ -139,69 +175,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'sql_uninstall' => [ - 'name' => 'sql_uninstall', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_UNINSTALL_LABEL', - 'type' => 'textarea', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'MySQL', - ], - 'debug_linenr' => [ - 'name' => 'debug_linenr', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], - 'mvc_versiondate' => [ - 'name' => 'mvc_versiondate', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL', - 'type' => 'list', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], - 'php_preflight_install' => [ - 'name' => 'php_preflight_install', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL', + 'php_postflight_install' => [ + 'name' => 'php_postflight_install', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_LABEL', 'type' => 'editor', 'title' => false, 'list' => 'joomla_components', 'store' => 'base64', 'tab_name' => 'Dash & Install', ], - 'backup_folder_path' => [ - 'name' => 'backup_folder_path', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Dynamic Integration', - ], - 'php_method_uninstall' => [ - 'name' => 'php_method_uninstall', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'Dash & Install', - ], - 'add_placeholders' => [ - 'name' => 'add_placeholders', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], 'author' => [ 'name' => 'author', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL', @@ -211,14 +193,14 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'add_sales_server' => [ - 'name' => 'add_sales_server', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL', - 'type' => 'radio', + 'sql_uninstall' => [ + 'name' => 'sql_uninstall', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_UNINSTALL_LABEL', + 'type' => 'textarea', 'title' => false, 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Dynamic Integration', + 'store' => 'base64', + 'tab_name' => 'MySQL', ], 'email' => [ 'name' => 'email', @@ -229,15 +211,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'translation_tool' => [ - 'name' => 'translation_tool', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION_TOOL_LABEL', - 'type' => 'list', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Dynamic Integration', - ], 'website' => [ 'name' => 'website', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_LABEL', @@ -247,14 +220,41 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'buildcompsql' => [ - 'name' => 'buildcompsql', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL', - 'type' => 'textarea', + 'backup_folder_path' => [ + 'name' => 'backup_folder_path', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_helper_both' => [ + 'name' => 'php_helper_both', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL', + 'type' => 'editor', 'title' => false, 'list' => 'joomla_components', 'store' => 'base64', - 'tab_name' => 'Dynamic Build (beta)', + 'tab_name' => 'Libs & Helpers', + ], + 'crowdin_username' => [ + 'name' => 'crowdin_username', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_USERNAME_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Dynamic Integration', + ], + 'php_admin_event' => [ + 'name' => 'php_admin_event', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', ], 'add_license' => [ 'name' => 'add_license', @@ -265,6 +265,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], + 'component_version' => [ + 'name' => 'component_version', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPONENT_VERSION_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], 'php_helper_admin' => [ 'name' => 'php_helper_admin', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_ADMIN_LABEL', @@ -454,6 +463,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'publishing', ], + 'add_php_helper_both' => [ + 'name' => 'add_php_helper_both', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Libs & Helpers', + ], 'add_php_helper_admin' => [ 'name' => 'add_php_helper_admin', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_ADMIN_LABEL', @@ -490,6 +508,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Libs & Helpers', ], + 'add_namespace_prefix' => [ + 'name' => 'add_namespace_prefix', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_NAMESPACE_PREFIX_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], 'add_javascript' => [ 'name' => 'add_javascript', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_JAVASCRIPT_LABEL', @@ -499,6 +526,33 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Libs & Helpers', ], + 'namespace_prefix' => [ + 'name' => 'namespace_prefix', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'add_css_admin' => [ + 'name' => 'add_css_admin', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_ADMIN_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Libs & Helpers', + ], + 'add_css_site' => [ + 'name' => 'add_css_site', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_SITE_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Libs & Helpers', + ], 'add_menu_prefix' => [ 'name' => 'add_menu_prefix', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_MENU_PREFIX_LABEL', @@ -508,14 +562,14 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Settings', ], - 'add_css_admin' => [ - 'name' => 'add_css_admin', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_ADMIN_LABEL', + 'dashboard_type' => [ + 'name' => 'dashboard_type', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DASHBOARD_TYPE_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, - 'tab_name' => 'Libs & Helpers', + 'tab_name' => 'Dash & Install', ], 'menu_prefix' => [ 'name' => 'menu_prefix', @@ -526,24 +580,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Settings', ], - 'add_css_site' => [ - 'name' => 'add_css_site', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_SITE_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Libs & Helpers', - ], - 'dashboard_type' => [ - 'name' => 'dashboard_type', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DASHBOARD_TYPE_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Dash & Install', - ], 'dashboard' => [ 'name' => 'dashboard', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DASHBOARD_LABEL', @@ -553,15 +589,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dash & Install', ], - 'toignore' => [ - 'name' => 'toignore', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TOIGNORE_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Settings', - ], 'add_php_preflight_install' => [ 'name' => 'add_php_preflight_install', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_PREFLIGHT_INSTALL_LABEL', @@ -580,6 +607,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dash & Install', ], + 'toignore' => [ + 'name' => 'toignore', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TOIGNORE_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], 'add_php_postflight_install' => [ 'name' => 'add_php_postflight_install', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_INSTALL_LABEL', @@ -589,6 +625,24 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dash & Install', ], + 'add_php_postflight_update' => [ + 'name' => 'add_php_postflight_update', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_UPDATE_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dash & Install', + ], + 'add_php_method_uninstall' => [ + 'name' => 'add_php_method_uninstall', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_METHOD_UNINSTALL_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dash & Install', + ], 'export_key' => [ 'name' => 'export_key', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_LABEL', @@ -598,14 +652,14 @@ class Table extends BaseTable implements Tableinterface 'store' => 'basic_encryption', 'tab_name' => 'Settings', ], - 'add_php_postflight_update' => [ - 'name' => 'add_php_postflight_update', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_UPDATE_LABEL', + 'add_sql' => [ + 'name' => 'add_sql', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, - 'tab_name' => 'Dash & Install', + 'tab_name' => 'MySQL', ], 'joomla_source_link' => [ 'name' => 'joomla_source_link', @@ -616,14 +670,14 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Settings', ], - 'add_php_method_uninstall' => [ - 'name' => 'add_php_method_uninstall', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_METHOD_UNINSTALL_LABEL', + 'add_sql_uninstall' => [ + 'name' => 'add_sql_uninstall', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_UNINSTALL_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, - 'tab_name' => 'Dash & Install', + 'tab_name' => 'MySQL', ], 'export_buy_link' => [ 'name' => 'export_buy_link', @@ -634,24 +688,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Settings', ], - 'add_sql' => [ - 'name' => 'add_sql', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'MySQL', - ], - 'add_sql_uninstall' => [ - 'name' => 'add_sql_uninstall', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_UNINSTALL_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'MySQL', - ], 'assets_table_fix' => [ 'name' => 'assets_table_fix', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ASSETS_TABLE_FIX_LABEL', @@ -661,15 +697,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'MySQL', ], - 'addcontributors' => [ - 'name' => 'addcontributors', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDCONTRIBUTORS_LABEL', - 'type' => 'subform', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'json', - 'tab_name' => 'Settings', - ], 'readme' => [ 'name' => 'readme', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README_LABEL', @@ -679,15 +706,6 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'Readme', ], - 'emptycontributors' => [ - 'name' => 'emptycontributors', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMPTYCONTRIBUTORS_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Settings', - ], 'add_update_server' => [ 'name' => 'add_update_server', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_UPDATE_SERVER_LABEL', @@ -697,13 +715,13 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dynamic Integration', ], - 'number' => [ - 'name' => 'number', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NUMBER_LABEL', - 'type' => 'number', + 'addcontributors' => [ + 'name' => 'addcontributors', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDCONTRIBUTORS_LABEL', + 'type' => 'subform', 'title' => false, 'list' => 'joomla_components', - 'store' => NULL, + 'store' => 'json', 'tab_name' => 'Settings', ], 'update_server_target' => [ @@ -715,6 +733,24 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dynamic Integration', ], + 'emptycontributors' => [ + 'name' => 'emptycontributors', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMPTYCONTRIBUTORS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'number' => [ + 'name' => 'number', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NUMBER_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], 'update_server' => [ 'name' => 'update_server', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATE_SERVER_LABEL', @@ -751,24 +787,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dynamic Integration', ], - 'creatuserhelper' => [ - 'name' => 'creatuserhelper', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATUSERHELPER_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Libs & Helpers', - ], - 'adduikit' => [ - 'name' => 'adduikit', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDUIKIT_LABEL', - 'type' => 'list', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Libs & Helpers', - ], 'crowdin_project_api_key' => [ 'name' => 'crowdin_project_api_key', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_PROJECT_API_KEY_LABEL', @@ -778,10 +796,10 @@ class Table extends BaseTable implements Tableinterface 'store' => 'basic_encryption', 'tab_name' => 'Dynamic Integration', ], - 'addfootable' => [ - 'name' => 'addfootable', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDFOOTABLE_LABEL', - 'type' => 'list', + 'creatuserhelper' => [ + 'name' => 'creatuserhelper', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATUSERHELPER_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -796,10 +814,10 @@ class Table extends BaseTable implements Tableinterface 'store' => 'basic_encryption', 'tab_name' => 'Dynamic Integration', ], - 'add_email_helper' => [ - 'name' => 'add_email_helper', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_EMAIL_HELPER_LABEL', - 'type' => 'radio', + 'adduikit' => [ + 'name' => 'adduikit', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDUIKIT_LABEL', + 'type' => 'list', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -814,10 +832,10 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dynamic Build (beta)', ], - 'add_php_helper_both' => [ - 'name' => 'add_php_helper_both', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL', - 'type' => 'radio', + 'addfootable' => [ + 'name' => 'addfootable', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDFOOTABLE_LABEL', + 'type' => 'list', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -832,13 +850,13 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'publishing', ], - 'php_helper_both' => [ - 'name' => 'php_helper_both', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL', - 'type' => 'editor', + 'add_email_helper' => [ + 'name' => 'add_email_helper', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_EMAIL_HELPER_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', - 'store' => 'base64', + 'store' => NULL, 'tab_name' => 'Libs & Helpers', ], 'modified' => [ @@ -3478,6 +3496,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Main', ], + 'php_calculation' => [ + 'name' => 'php_calculation', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_CALCULATION_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Abacus', + ], 'php_router_parse' => [ 'name' => 'php_router_parse', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_LABEL', @@ -3487,51 +3514,24 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'Custom Script', ], - 'php_before_getitems' => [ - 'name' => 'php_before_getitems', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_BEFORE_GETITEMS_LABEL', - 'type' => 'editor', + 'add_php_after_getitems' => [ + 'name' => 'add_php_after_getitems', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_AFTER_GETITEMS_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'dynamic_gets', - 'store' => 'base64', + 'store' => NULL, 'tab_name' => 'Custom Script', ], - 'php_after_getitems' => [ - 'name' => 'php_after_getitems', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_AFTER_GETITEMS_LABEL', - 'type' => 'editor', + 'add_php_router_parse' => [ + 'name' => 'add_php_router_parse', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'dynamic_gets', - 'store' => 'base64', + 'store' => NULL, 'tab_name' => 'Custom Script', ], - 'php_after_getitem' => [ - 'name' => 'php_after_getitem', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_AFTER_GETITEM_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'base64', - 'tab_name' => 'Custom Script', - ], - 'php_getlistquery' => [ - 'name' => 'php_getlistquery', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_GETLISTQUERY_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'base64', - 'tab_name' => 'Custom Script', - ], - 'join_db_table' => [ - 'name' => 'join_db_table', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_DB_TABLE_LABEL', - 'type' => 'subform', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'json', - 'tab_name' => 'Joint', - ], 'view_selection' => [ 'name' => 'view_selection', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_VIEW_SELECTION_LABEL', @@ -3541,6 +3541,33 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Main', ], + 'add_php_before_getitems' => [ + 'name' => 'add_php_before_getitems', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEMS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Custom Script', + ], + 'add_php_before_getitem' => [ + 'name' => 'add_php_before_getitem', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEM_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Custom Script', + ], + 'add_php_after_getitem' => [ + 'name' => 'add_php_after_getitem', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_AFTER_GETITEM_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Custom Script', + ], 'db_table_main' => [ 'name' => 'db_table_main', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_DB_TABLE_MAIN_LABEL', @@ -3577,24 +3604,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Main', ], - 'php_calculation' => [ - 'name' => 'php_calculation', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_CALCULATION_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'base64', - 'tab_name' => 'Abacus', - ], - 'php_before_getitem' => [ - 'name' => 'php_before_getitem', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_BEFORE_GETITEM_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'base64', - 'tab_name' => 'Custom Script', - ], 'view_table_main' => [ 'name' => 'view_table_main', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_VIEW_TABLE_MAIN_LABEL', @@ -3604,51 +3613,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Main', ], - 'select_all' => [ - 'name' => 'select_all', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_SELECT_ALL_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Main', - ], - 'add_php_before_getitem' => [ - 'name' => 'add_php_before_getitem', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEM_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Custom Script', - ], - 'getcustom' => [ - 'name' => 'getcustom', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_GETCUSTOM_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Main', - ], - 'add_php_after_getitem' => [ - 'name' => 'add_php_after_getitem', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_AFTER_GETITEM_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Custom Script', - ], - 'pagination' => [ - 'name' => 'pagination', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PAGINATION_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Main', - ], 'add_php_getlistquery' => [ 'name' => 'add_php_getlistquery', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_GETLISTQUERY_LABEL', @@ -3658,13 +3622,76 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Custom Script', ], - 'add_php_before_getitems' => [ - 'name' => 'add_php_before_getitems', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEMS_LABEL', + 'join_db_table' => [ + 'name' => 'join_db_table', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_DB_TABLE_LABEL', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Joint', + ], + 'select_all' => [ + 'name' => 'select_all', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_SELECT_ALL_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'dynamic_gets', 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_before_getitem' => [ + 'name' => 'php_before_getitem', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_BEFORE_GETITEM_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'getcustom' => [ + 'name' => 'getcustom', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_GETCUSTOM_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_after_getitem' => [ + 'name' => 'php_after_getitem', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_AFTER_GETITEM_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'pagination' => [ + 'name' => 'pagination', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PAGINATION_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_getlistquery' => [ + 'name' => 'php_getlistquery', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_GETLISTQUERY_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_before_getitems' => [ + 'name' => 'php_before_getitems', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_BEFORE_GETITEMS_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', 'tab_name' => 'Custom Script', ], 'filter' => [ @@ -3676,13 +3703,13 @@ class Table extends BaseTable implements Tableinterface 'store' => 'json', 'tab_name' => 'Tweak', ], - 'add_php_after_getitems' => [ - 'name' => 'add_php_after_getitems', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_AFTER_GETITEMS_LABEL', - 'type' => 'radio', + 'php_after_getitems' => [ + 'name' => 'php_after_getitems', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_AFTER_GETITEMS_LABEL', + 'type' => 'editor', 'title' => false, 'list' => 'dynamic_gets', - 'store' => NULL, + 'store' => 'base64', 'tab_name' => 'Custom Script', ], 'where' => [ @@ -3694,15 +3721,6 @@ class Table extends BaseTable implements Tableinterface 'store' => 'json', 'tab_name' => 'Tweak', ], - 'add_php_router_parse' => [ - 'name' => 'add_php_router_parse', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Custom Script', - ], 'order' => [ 'name' => 'order', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ORDER_LABEL', @@ -3804,6 +3822,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], + 'joomla_version' => [ + 'name' => 'joomla_version', + 'label' => 'COM_COMPONENTBUILDER_CUSTOM_CODE_JOOMLA_VERSION_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], 'function_name' => [ 'name' => 'function_name', 'label' => 'COM_COMPONENTBUILDER_CUSTOM_CODE_FUNCTION_NAME_LABEL', @@ -4830,7 +4857,7 @@ class Table extends BaseTable implements Tableinterface 'groups' => [ 'name' => 'groups', 'label' => 'COM_COMPONENTBUILDER_HELP_DOCUMENT_GROUPS_LABEL', - 'type' => 'usergroup', + 'type' => 'usergrouplist', 'title' => false, 'list' => 'help_documents', 'store' => 'json', @@ -5118,6 +5145,80 @@ class Table extends BaseTable implements Tableinterface 'tab_name' => 'Menus', ], ], + 'component_router' => [ + 'joomla_component' => [ + 'name' => 'joomla_component', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_JOOMLA_COMPONENT_LABEL', + 'type' => 'joomlacomponents', + 'title' => true, + 'list' => 'components_routers', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'mode_constructor_before_parent' => [ + 'name' => 'mode_constructor_before_parent', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_BEFORE_PARENT_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'components_routers', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'mode_constructor_after_parent' => [ + 'name' => 'mode_constructor_after_parent', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_AFTER_PARENT_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'components_routers', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'mode_methods' => [ + 'name' => 'mode_methods', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_METHODS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'components_routers', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'methods_code' => [ + 'name' => 'methods_code', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_METHODS_CODE_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'components_routers', + 'store' => 'base64', + 'tab_name' => 'Settings', + ], + 'constructor_after_parent_code' => [ + 'name' => 'constructor_after_parent_code', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_AFTER_PARENT_CODE_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'components_routers', + 'store' => 'base64', + 'tab_name' => 'Settings', + ], + 'constructor_before_parent_manual' => [ + 'name' => 'constructor_before_parent_manual', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_MANUAL_LABEL', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_routers', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'constructor_before_parent_code' => [ + 'name' => 'constructor_before_parent_code', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_CODE_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'components_routers', + 'store' => 'base64', + 'tab_name' => 'Settings', + ], + ], 'component_config' => [ 'joomla_component' => [ 'name' => 'joomla_component', diff --git a/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Activeregistryinterface.php b/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Activeregistryinterface.php index 9fdf2c0a4..ebf3a67b4 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Activeregistryinterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Activeregistryinterface.php @@ -51,15 +51,17 @@ interface Activeregistryinterface * Adds content into the registry. If a key exists, * it either appends or concatenates based on the value's type. * - * @param mixed $value The value to set. - * @param bool $asArray Determines if the new value should be treated as an array. - * @param string ...$keys The keys to determine the location. + * @param mixed $value The value to set. + * @param bool|null $asArray Determines if the new value should be treated as an array. + * Default is $addAsArray = false (if null) in base class. + * Override in child class allowed set class property $addAsArray = true. + * @param string ...$keys The keys to determine the location. * * @throws \InvalidArgumentException If any of the keys are not a number or string. * @return void * @since 3.2.0 */ - public function addActive($value, bool $asArray, string ...$keys): void; + public function addActive($value, ?bool $asArray, string ...$keys): void; /** * Retrieves a value (or sub-array) from the registry using multiple keys. diff --git a/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Registryinterface.php b/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Registryinterface.php index e7a8f0297..58eab826d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Registryinterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Registryinterface.php @@ -35,15 +35,17 @@ interface Registryinterface * Adds content into the registry. If a key exists, * it either appends or concatenates based on $asArray switch. * - * @param string $path Registry path (e.g. vdm.content.builder) - * @param mixed $value Value of entry - * @param bool $asArray Determines if the new value should be treated as an array. Default is false. + * @param string $path Registry path (e.g. vdm.content.builder) + * @param mixed $value Value of entry + * @param bool|null $asArray Determines if the new value should be treated as an array. + * Default is $addAsArray = false (if null) in base class. + * Override in child class allowed set class property $addAsArray = true. * * @throws \InvalidArgumentException If any of the path values are not a number or string. * @return void * @since 3.2.0 */ - public function add(string $path, $value, bool $asArray = false): void; + public function add(string $path, $value, ?bool $asArray = null): void; /** * Retrieves a value (or sub-array) from the registry using multiple keys. diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities.php deleted file mode 100644 index b473fea4f..000000000 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities.php +++ /dev/null @@ -1,669 +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; - - -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\JsonHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\MathHelper; -use VDM\Joomla\Utilities\GetHelper; -use VDM\Joomla\Utilities\GuidHelper; -use VDM\Joomla\Utilities\FileHelper; -use VDM\Joomla\Utilities\String\FieldHelper; -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\Utilities\Component\Helper; - - -/** - * Basic shared utilities, a legacy implementation - * - * @since 3.0.9 - */ -trait Utilities -{ - /** - * The Main Active Language - * - * @var string - * - * @since 3.0.9 - */ - public static $langTag; - - /** - * Check if have a string with a length - * - * @input string $string The string to check - * - * @returns bool true on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::check($string); - */ - public static function checkString($string): bool - { - return StringHelper::check($string); - } - - /** - * Shorten a string - * - * @input string $string That you would like to shorten - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::shorten($string, $length, $addTip); - */ - public static function shorten($string, $length = 40, $addTip = true) - { - return StringHelper::shorten($string, $length, $addTip); - } - - /** - * Making strings safe (various ways) - * - * @input string $string That you would like to make safe - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::safe($string, $type, $spacer, $replaceNumbers, $keepOnlyCharacters); - */ - public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) - { - // set the local component option - self::setComponentOption(); - - return StringHelper::safe($string, $type, $spacer, $replaceNumbers, $keepOnlyCharacters); - } - - /** - * Making class or function name safe - * - * @input string The name you would like to make safe - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use ClassfunctionHelper::safe($name); - */ - public static function safeClassFunctionName($name) - { - return ClassfunctionHelper::safe($name); - } - - /** - * Making field names safe - * - * @input string The you would like to make safe - * @input boolean The switch to return an ALL UPPER CASE string - * @input string The string to use in white space - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FieldHelper::safe($string, $allcap, $spacer); - */ - public static function safeFieldName($string, $allcap = false, $spacer = '_') - { - // set the local component option - self::setComponentOption(); - - return FieldHelper::safe($string, $allcap, $spacer); - } - - /** - * Making field type name safe - * - * @input string The you would like to make safe - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use TypeHelper::safe($string); - */ - public static function safeTypeName($string) - { - // set the local component option - self::setComponentOption(); - - return TypeHelper::safe($string); - } - - /** - * Making namespace safe - * - * @input string The you would like to make safe - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use NamespaceHelper::safe($string); - */ - public static function safeNamespace($string) - { - return NamespaceHelper::safe($string); - } - - /** - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::transliterate($string); - */ - public static function transliterate($string) - { - // set the local component option - self::setComponentOption(); - - return StringHelper::transliterate($string); - } - - /** - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::html($var, $charset, $shorten, $length); - */ - public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) - { - // set the local component option - self::setComponentOption(); - - return StringHelper::html($var, $charset, $shorten, $length); - } - - /** - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::numbers($string); - */ - public static function replaceNumbers($string) - { - return StringHelper::numbers($string); - } - - /** - * Convert an integer into an English word string - * Thanks to Tom Nicholson - * - * @input int $x an int - * - * @returns string a string - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::number($x); - */ - public static function numberToString($x) - { - return StringHelper::number($x); - } - - /** - * Random Key - * - * @input int $size the length of the string - * - * @returns string a string of random characters - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::random($size); - */ - public static function randomkey($size): string - { - return StringHelper::random($size); - } - - /** - * Check if you have a json string - * - * @input string $string The json string to check - * - * @returns bool true on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use JsonHelper::check($string); - */ - public static function checkJson($string): bool - { - return JsonHelper::check($string); - } - - /** - * @since 3.0.9 - * - * @deprecated 4.0 - Use JsonHelper::string($value, $sperator, $table, $id, $name); - */ - public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') - { - return JsonHelper::string($value, $sperator, $table, $id, $name); - } - - /** - * Check if you have an array with a length - * - * @input mixed $array The array to check - * @input bool $removeEmptyString Should we remove empty values - * - * @returns int number of items in array on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use ArrayHelper::check($array, $removeEmptyString); - */ - public static function checkArray($array, $removeEmptyString = false): int - { - return ArrayHelper::check($array, $removeEmptyString); - } - - /** - * Merge an array of array's - * - * @input mixed $arrays The arrays you would like to merge - * - * @returns mixed array on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use ArrayHelper::merge($arrays); - */ - public static function mergeArrays($arrays) - { - return ArrayHelper::merge($arrays); - } - - /** - * Check if you have an object with a length - * - * @input object $object The object to check - * - * @returns bool true on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use ObjectHelper::check($object); - */ - public static function checkObject($object): bool - { - return ObjectHelper::check($object); - } - - /** - * 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 - * - * @return mix string/int/float - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GetHelper::var($table, $where, $whereString, $what, $operator, $main); - */ - public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = null) - { - // set the local component option - self::setComponentOption(); - - return GetHelper::var($table, $where, $whereString, $what, $operator, $main); - } - - /** - * 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 - * - * @return array - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GetHelper::vars($table, $where, $whereString, $what, $operator, $main, $unique); - */ - public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = null, $unique = true) - { - // set the local component option - self::setComponentOption(); - - return GetHelper::vars($table, $where, $whereString, $what, $operator, $main, $unique); - } - - /** - * 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 - * - * @return array On success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GetHelper::allBetween($content, $start, $end); - */ - public static function getAllBetween($content, $start, $end) - { - return GetHelper::allBetween($content, $start, $end); - } - - /** - * 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 - * - * @return string On success / empty string on failure - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GetHelper::between($content, $start, $end, $default); - */ - public static function getBetween($content, $start, $end, $default = '') - { - return GetHelper::between($content, $start, $end, $default); - } - - /** - * bc math wrapper (very basic not for accounting) - * - * @param string $type The type bc math - * @param int $val1 The first value - * @param int $val2 The second value - * @param int $scale The scale value - * - * @return float|int - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use MathHelper::bc($type, $val1, $val2, $scale); - */ - public static function bcmath($type, $val1, $val2, $scale = 0) - { - return MathHelper::bc($type, $val1, $val2, $scale); - } - - /** - * Basic sum of an array with more precision - * - * @param array $array The values to sum - * @param int $scale The scale value - * - * @return float|int - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use MathHelper::sum($array, $scale); - */ - public static function bcsum($array, $scale = 4) - { - return MathHelper::sum($array, $scale); - } - - /** - * create plugin class name - * - * @input string The group name - * @input string The name - * - * @return string - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use PluginHelper::safe($name, $group); - */ - public static function createPluginClassName($group, $name) - { - return PluginHelper::safeClassName($name, $group); - } - - /** - * Returns a GUIDv4 string - * - * Thanks to Dave Pearson (and other) - * https://www.php.net/manual/en/function.com-create-guid.php#119168 - * - * Uses the best cryptographically secure method - * for all supported platforms with fallback to an older, - * less secure version. - * - * @param bool $trim - * - * @return string - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GuidHelper::get($trim); - */ - public static function GUID($trim = true) - { - return GuidHelper::get($trim); - } - - /** - * Validate the Globally Unique Identifier ( and check if table already has this identifier) - * - * @param string $guid - * @param string $table - * @param int $id - * @param string|null $component - * - * @return bool - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GuidHelper::valid($guid, $table, $id, $component); - */ - public static function validGUID($guid, $table = null, $id = 0, $component = null) - { - // set the local component option - self::setComponentOption(); - - return GuidHelper::valid($guid, $table, $id, $component); - } - - /** - * get the ITEM of a GUID by table - * - * @param string $guid - * @param string $table - * @param string/array $what - * @param string|null $component - * - * @return mix - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GuidHelper::valid($guid, $table, $id, $component); - */ - public static function getGUID($guid, $table, $what = 'a.id', $component = null) - { - // set the local component option - self::setComponentOption(); - - return GuidHelper::item($guid, $table, $what, $component); - } - - /** - * Validate the Globally Unique Identifier - * - * Thanks to Lewie - * https://stackoverflow.com/a/1515456/1429677 - * - * @param string $guid - * - * @return bool - * - * @deprecated 4.0 - Use GuidHelper::validate($guid); - */ - protected static function validateGUID($guid) - { - return GuidHelper::validate($guid); - } - - /** - * The zipper method - * - * @param string $workingDIR The directory where the items must be zipped - * @param string $filepath The path to where the zip file must be placed - * - * @return bool true On success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::zip($workingDIR, $filepath); - */ - public static function zip($workingDIR, &$filepath) - { - return FileHelper::zip($workingDIR, $filepath); - } - - /** - * get the content of a file - * - * @param string $path The path to the file - * @param string/bool $none The return value if no content was found - * - * @return string On success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::getContent($path, $none); - */ - public static function getFileContents($path, $none = '') - { - return FileHelper::getContent($path, $none); - } - - /** - * Write a file to the server - * - * @param string $path The path and file name where to safe the data - * @param string $data The data to safe - * - * @return bool true On success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::write($path, $data); - */ - public static function writeFile($path, $data) - { - return FileHelper::write($path, $data); - } - - /** - * get all the file paths in folder and sub folders - * - * @param string $folder The local path to parse - * @param array $fileTypes The type of files to get - * - * @return void - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::getPaths($folder, $fileTypes , $recurse, $full); - */ - public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) - { - return FileHelper::getPaths($folder, $fileTypes , $recurse, $full); - } - - /** - * Get the file path or url - * - * @param string $type The (url/path) type to return - * @param string $target The Params Target name (if set) - * @param string $fileType The kind of filename to generate (if not set no file name is generated) - * @param string $key The key to adjust the filename (if not set ignored) - * @param string $default The default path if not set in Params (fallback path) - * @param bool $createIfNotSet The switch to create the folder if not found - * - * @return string On success the path or url is returned based on the type requested - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); - */ - public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) - { - // set the local component option - self::setComponentOption(); - - return FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); - } - - /** - * Check if file exist - * - * @param string $path The url/path to check - * - * @return bool If exist true - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::exists($path); - */ - public static function urlExists($path) - { - return FileHelper::exists($path); - } - - /** - * Set the component option - * - * @param String|null $option The option for the component. - * - * @since 3.0.11 - */ - public static function setComponentOption($option = null) - { - // set the local component option - if (empty($option)) - { - if (empty(Helper::$option) && property_exists(__CLASS__, 'ComponentCodeName')) - { - Helper::$option = 'com_' . self::$ComponentCodeName; - } - } - else - { - Helper::$option = $option; - } - } - -} - diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/Component/Helper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/Component/Helper.php index 61dbf59f8..b2ae82465 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/Component/Helper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/Component/Helper.php @@ -12,9 +12,11 @@ namespace VDM\Joomla\Utilities\Component; -use Joomla\Input\Input; +use Joomla\CMS\Factory; use Joomla\CMS\Component\ComponentHelper; +use Joomla\Input\Input; use Joomla\Registry\Registry; +use VDM\Joomla\Utilities\String\NamespaceHelper; /** @@ -27,10 +29,18 @@ abstract class Helper /** * The current option * - * @var string + * @var string|null * @since 3.0.11 */ - public static string $option; + public static ?string $option = null; + + /** + * The component manifest list cache + * + * @var array + * @since 3.2.0 + */ + public static array $manifest = []; /** * The component params list cache @@ -67,7 +77,20 @@ abstract class Helper } /** - * Gets the component option + * Set the component option + * + * @param string $option The option + * + * @return void + * @since 3.2.0 + */ + public static function setOption(string $option): void + { + self::$option = $option; + } + + /** + * Get the component option * * @param string|null $default The default return value if none is found * @@ -79,15 +102,27 @@ abstract class Helper if (empty(self::$option)) { // get the option from the url input - self::$option = (new Input)->getString('option', false); + self::$option = (new Input)->getString('option', null); } - if (self::$option) + if (empty(self::$option)) { - return self::$option; + $app = Factory::getApplication(); + + // Check if the getInput method exists in the application object + if (method_exists($app, 'getInput')) + { + // get the option from the application + self::$option = $app->getInput()->getCmd('option', $default); + } + else + { + // Use the default value if getInput method does not exist + self::$option = $default; + } } - return $default; + return self::$option; } /** @@ -129,20 +164,92 @@ abstract class Helper { // check that we have an option // and get the code name from it - if (($code_name = self::getCode($option, false)) !== false) + if (($code_name = self::getCode($option, null)) !== null) { // we build the helper class name $helper_name = '\\' . \ucfirst($code_name) . 'Helper'; + // check if class exist if (class_exists($helper_name)) { return $helper_name; } + + // try loading namespace + if (($namespace = self::getNamespace($option)) !== null) + { + $name = \ucfirst($code_name) . 'Helper'; + $namespace_helper = '\\' . $namespace . '\Administrator\Helper\\' . NamespaceHelper::safeSegment($name); // TODO target site or admin locations not just admin... + if (class_exists($namespace_helper)) + { + return $namespace_helper; + } + } } return $default; } + /** + * Gets the component namespace if set + * + * @param string|null $option The option for the component. + * @param string|null $default The default return value if none is found + * + * @return string|null A component namespace + * + * @since 3.0.11 + */ + public static function getNamespace(?string $option = null): ?string + { + $manifest = self::getManifest($option); + + return $manifest->namespace ?? null; + } + + /** + * Gets the component abstract helper class + * + * @param string|null $option The option for the component. + * @param string|null $default The default return value if none is found + * + * @return object|null A component helper name + * + * @since 3.0.11 + */ + public static function getManifest(?string $option = null): ?object + { + if ($option === null + && ($option = self::getOption($option)) === null) + { + return null; + } + + // get global manifest_cache values + if (!isset(self::$manifest[$option])) + { + $db = Factory::getDbo(); + $query = $db->getQuery(true); + + $query->select($db->quoteName('manifest_cache')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('type') . ' = ' . $db->quote('component')) + ->where($db->quoteName('element') . ' LIKE ' . $db->quote($option)); + + $db->setQuery($query); + + try { + $manifest = $db->loadResult(); + self::$manifest[$option] = json_decode($manifest); + } catch (\Exception $e) { + // Handle the database error appropriately. + self::$manifest[$option] = null; + } + } + + return self::$manifest[$option]; + } + /** * Check if the helper class of this component has a method * @@ -156,7 +263,7 @@ abstract class Helper public static function methodExists(string $method, string $option = null): bool { // get the helper class - return ($helper = self::get($option, false)) !== false && + return ($helper = self::get($option, null)) !== null && method_exists($helper, $method); } @@ -173,7 +280,7 @@ abstract class Helper public static function _(string $method, array $arguments = [], ?string $option = null) { // get the helper class - if (($helper = self::get($option, false)) !== false && + if (($helper = self::get($option, null)) !== null && method_exists($helper, $method)) { // we know this is not ideal... diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php index 0dd04d81b..7d1dd0a57 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php @@ -89,8 +89,8 @@ abstract class FileHelper /** * get the content of a file * - * @param string $path The path to the file - * @param string/bool $none The return value if no content was found + * @param string $path The path to the file + * @param mixed $none The return value if no content was found * * @return string On success * @@ -150,7 +150,7 @@ abstract class FileHelper * * @since 3.0.9 */ - public static function write($path, $data) + public static function write($path, $data): bool { $klaar = false; if (StringHelper::check($data)) @@ -179,11 +179,11 @@ abstract class FileHelper * @param string $folder The local path to parse * @param array $fileTypes The type of files to get * - * @return void + * @return array|null * * @since 3.0.9 */ - public static function getPaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) + public static function getPaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true): ?array { if (Folder::exists($folder)) { @@ -219,7 +219,7 @@ abstract class FileHelper // return array of files return array_map( fn($file) => str_replace('./', '/', (string) $file), (array) ArrayHelper::merge($files)); } - return false; + return null; } /** @@ -236,7 +236,7 @@ abstract class FileHelper * * @since 3.0.9 */ - public static function getPath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) + public static function getPath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true): string { // make sure to always have a string/path if(!StringHelper::check($default)) @@ -316,7 +316,7 @@ abstract class FileHelper * * @since 3.0.9 */ - public static function exists($path) + public static function exists($path): bool { $exists = false; // if this is a local path diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php index f58409767..1f89e7b87 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php @@ -113,14 +113,14 @@ abstract class GetHelper $where = Factory::getUser()->id; } - if(is_null($main)) + if($main === null) { $main = Helper::getCode(); } if (!ArrayHelper::check($where) && $where > 0) { - $where = array($where); + $where = [$where]; } if (ArrayHelper::check($where)) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GuidHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GuidHelper.php index e21947347..14a114832 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GuidHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GuidHelper.php @@ -138,7 +138,7 @@ abstract class GuidHelper * @param string|array $what * @param string|null $component * - * @return mix + * @return mixed * * @since 3.0.9 */ diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php index 4776fb9fa..55ee2e490 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php @@ -38,30 +38,41 @@ abstract class NamespaceHelper // Split the string into namespace segments $segments = explode('\\', $string); - foreach ($segments as &$segment) - { - // Check if segment starts with a number - if (preg_match("/^\d/", $segment)) - { - // Extract the starting number(s) - preg_match("/^\d+/", $segment, $matches); - - if (isset($matches[0])) - { - $numberWord = StringHelper::numbers($matches[0]); - $segment = str_replace($matches[0], $numberWord, $segment); - } - } - - // Transliterate string TODO: look again as this makes it lowercase - // $segment = StringHelper::transliterate($segment); - - // Make sure segment only contains valid characters - $segment = preg_replace("/[^A-Za-z0-9]/", '', $segment); - } + // make each segment safe + $segments = array_map([self::class, 'safeSegment'], $segments); // Join the namespace segments back together return implode('\\', $segments); + } + + /** + * Making one namespace segment safe + * + * @param string $string The namespace segment string you would like to make safe + * + * @return string on success + * @since 3.0.9 + */ + public static function safeSegment(string $string): string + { + // Check if segment starts with a number + if (preg_match("/^\d/", $string)) + { + // Extract the starting number(s) + preg_match("/^\d+/", $string, $matches); + + if (isset($matches[0])) + { + $numberWord = StringHelper::numbers($matches[0]); + $string = str_replace($matches[0], $numberWord, $string); + } + } + + // Transliterate string TODO: look again as this makes it lowercase + // $segment = StringHelper::transliterate($segment); + + // Make sure segment only contains valid characters + return preg_replace("/[^A-Za-z0-9]/", '', $string); } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php index 3a37f2b9a..fad233560 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php @@ -50,18 +50,18 @@ abstract class StringHelper /** * Shorten a string * - * @input string The you would like to shorten + * @input string The sting that you would like to shorten * * @returns string on success * - * @since 3.0.9 + * @since 3.2.0 */ public static function shorten($string, $length = 40, $addTip = true) { if (self::check($string)) { $initial = strlen((string) $string); - $words = preg_split('/([\s\n\r]+)/', (string) $string, null, PREG_SPLIT_DELIM_CAPTURE); + $words = preg_split('/([\s\n\r]+)/', (string) $string, -1, PREG_SPLIT_DELIM_CAPTURE); $words_count = count((array)$words); $word_length = 0; diff --git a/media/js/admin_custom_tabs.js b/media/js/admin_custom_tabs.js index 215a78d2d..9d6629898 100644 --- a/media/js/admin_custom_tabs.js +++ b/media/js/admin_custom_tabs.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/admin_fields.js b/media/js/admin_fields.js index 215a78d2d..9d6629898 100644 --- a/media/js/admin_fields.js +++ b/media/js/admin_fields.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/admin_fields_conditions.js b/media/js/admin_fields_conditions.js index 848e391d0..53c716c20 100644 --- a/media/js/admin_fields_conditions.js +++ b/media/js/admin_fields_conditions.js @@ -40,4 +40,4 @@ function getFieldSelectOptions(fieldKey){ } } - + diff --git a/media/js/admin_fields_relations.js b/media/js/admin_fields_relations.js index 0856e158b..957ab6c2d 100644 --- a/media/js/admin_fields_relations.js +++ b/media/js/admin_fields_relations.js @@ -73,42 +73,53 @@ function _isSet(val) return false; } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) + }).catch(error => { + console.error('Error:', error); + }); } - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} - + diff --git a/media/js/admin_view.js b/media/js/admin_view.js index f431e0e77..90ddf07cd 100644 --- a/media/js/admin_view.js +++ b/media/js/admin_view.js @@ -20,7 +20,7 @@ jform_vvvvwabvwq_required = false; jform_vvvvwabvwr_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_css_view_vvvvvyw = jQuery("#jform_add_css_view input[type='radio']:checked").val(); vvvvvyw(add_css_view_vvvvvyw); @@ -758,7 +758,7 @@ function vvvvwad(add_custom_button_vvvvwad) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -985,43 +985,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function addButtonID_server(type, size){ @@ -1082,4 +1093,4 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} diff --git a/media/js/class_extends.js b/media/js/class_extends.js index 07460eb01..10c2e2aa3 100644 --- a/media/js/class_extends.js +++ b/media/js/class_extends.js @@ -19,41 +19,52 @@ jQuery(document).ready(function() setTimeout(getEditCustomCodeButtons, 300); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/class_method.js b/media/js/class_method.js index a30791c12..bf73cebbc 100644 --- a/media/js/class_method.js +++ b/media/js/class_method.js @@ -12,7 +12,7 @@ jform_vvvvwchvxk_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var extension_type_vvvvwch = jQuery("#jform_extension_type").val(); vvvvwch(extension_type_vvvvwch); @@ -77,7 +77,7 @@ function extension_type_vvvvwch_SomeFunc(extension_type_vvvvwch) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -134,41 +134,52 @@ jQuery(document).ready(function() setTimeout(getEditCustomCodeButtons, 300); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/class_property.js b/media/js/class_property.js index 5a6ecf5fd..27e899048 100644 --- a/media/js/class_property.js +++ b/media/js/class_property.js @@ -12,7 +12,7 @@ jform_vvvvwcgvxj_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var extension_type_vvvvwcg = jQuery("#jform_extension_type").val(); vvvvwcg(extension_type_vvvvwcg); @@ -77,7 +77,7 @@ function extension_type_vvvvwcg_SomeFunc(extension_type_vvvvwcg) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -134,41 +134,52 @@ jQuery(document).ready(function() setTimeout(getEditCustomCodeButtons, 300); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/component_admin_views.js b/media/js/component_admin_views.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_admin_views.js +++ b/media/js/component_admin_views.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_config.js b/media/js/component_config.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_config.js +++ b/media/js/component_config.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_custom_admin_menus.js b/media/js/component_custom_admin_menus.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_custom_admin_menus.js +++ b/media/js/component_custom_admin_menus.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_custom_admin_views.js b/media/js/component_custom_admin_views.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_custom_admin_views.js +++ b/media/js/component_custom_admin_views.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_dashboard.js b/media/js/component_dashboard.js index 47682dec1..cfa526706 100644 --- a/media/js/component_dashboard.js +++ b/media/js/component_dashboard.js @@ -17,41 +17,52 @@ jQuery(document).ready(function() getEditCustomCodeButtons(); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/component_files_folders.js b/media/js/component_files_folders.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_files_folders.js +++ b/media/js/component_files_folders.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_modules.js b/media/js/component_modules.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_modules.js +++ b/media/js/component_modules.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_mysql_tweaks.js b/media/js/component_mysql_tweaks.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_mysql_tweaks.js +++ b/media/js/component_mysql_tweaks.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_placeholders.js b/media/js/component_placeholders.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_placeholders.js +++ b/media/js/component_placeholders.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_plugins.js b/media/js/component_plugins.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_plugins.js +++ b/media/js/component_plugins.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_router.js b/media/js/component_router.js new file mode 100644 index 000000000..ecd8d798e --- /dev/null +++ b/media/js/component_router.js @@ -0,0 +1,67 @@ +/** + * @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 + */ + + + + +document.addEventListener('DOMContentLoaded', function() { + // check and load all the customcode edit buttons + setTimeout(getEditCustomCodeButtons, 300); +}); + +function getEditCustomCodeButtons_server(id) { + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; + } + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); + }); +} + +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; + }); + }); + } + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/component_site_views.js b/media/js/component_site_views.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_site_views.js +++ b/media/js/component_site_views.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_updates.js b/media/js/component_updates.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_updates.js +++ b/media/js/component_updates.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/custom_admin_view.js b/media/js/custom_admin_view.js index baf398a7a..b037b80a2 100644 --- a/media/js/custom_admin_view.js +++ b/media/js/custom_admin_view.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_view_vvvvwae = jQuery("#jform_add_php_view input[type='radio']:checked").val(); vvvvwae(add_php_view_vvvvwae); @@ -397,41 +397,52 @@ function setSnippets(array){ jQuery('#jform_snippet').trigger('liszt:updated'); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/custom_code.js b/media/js/custom_code.js index e1f5fad84..4184e9c28 100644 --- a/media/js/custom_code.js +++ b/media/js/custom_code.js @@ -15,7 +15,7 @@ jform_vvvvwcdvxh_required = false; jform_vvvvwcdvxi_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var target_vvvvwcc = jQuery("#jform_target input[type='radio']:checked").val(); vvvvwcc(target_vvvvwcc); @@ -181,7 +181,7 @@ function vvvvwcf(type_vvvvwcf,target_vvvvwcf) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -372,41 +372,52 @@ function usedin_server(functioName, ide, target){ } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/dynamic_get.js b/media/js/dynamic_get.js index d473cc4e8..5553fcedf 100644 --- a/media/js/dynamic_get.js +++ b/media/js/dynamic_get.js @@ -24,7 +24,7 @@ jform_vvvvwbyvxd_required = false; jform_vvvvwbzvxe_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var gettype_vvvvwbb = jQuery("#jform_gettype").val(); vvvvwbb(gettype_vvvvwbb); @@ -1352,7 +1352,7 @@ function gettype_vvvvwcb_SomeFunc(gettype_vvvvwcb) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -1609,43 +1609,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function getLinked(){ @@ -1654,4 +1665,4 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} diff --git a/media/js/field.js b/media/js/field.js index b004eee22..1510e6f01 100644 --- a/media/js/field.js +++ b/media/js/field.js @@ -17,7 +17,7 @@ jform_vvvvwdgvxs_required = false; jform_vvvvwdgvxt_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var datalenght_vvvvwda = jQuery("#jform_datalenght").val(); vvvvwda(datalenght_vvvvwda); @@ -479,7 +479,7 @@ function vvvvwdk(add_javascript_views_footer_vvvvwdk) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -881,41 +881,52 @@ function addButton(type, where, size){ }) } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/fieldtype.js b/media/js/fieldtype.js index be9fab32c..df059058b 100644 --- a/media/js/fieldtype.js +++ b/media/js/fieldtype.js @@ -19,7 +19,7 @@ jform_vvvvwdyvya_required = false; jform_vvvvwdyvyb_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var datalenght_vvvvwdl = jQuery("#jform_datalenght").val(); var has_defaults_vvvvwdl = jQuery("#jform_has_defaults input[type='radio']:checked").val(); @@ -849,7 +849,7 @@ function vvvvwdy(has_defaults_vvvvwdy) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -904,41 +904,52 @@ jQuery(document).ready(function($) getEditCustomCodeButtons(); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/help_document.js b/media/js/help_document.js index bbb326f91..f30a100ab 100644 --- a/media/js/help_document.js +++ b/media/js/help_document.js @@ -16,7 +16,7 @@ jform_vvvvwemvyq_required = false; jform_vvvvweovyr_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var location_vvvvwej = jQuery("#jform_location input[type='radio']:checked").val(); vvvvwej(location_vvvvwej); @@ -286,7 +286,7 @@ function vvvvweo(target_vvvvweo) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -332,4 +332,4 @@ function isSet(val) return true; } return false; -} +} diff --git a/media/js/joomla_component.js b/media/js/joomla_component.js index 95c37ed75..d478dba84 100644 --- a/media/js/joomla_component.js +++ b/media/js/joomla_component.js @@ -19,7 +19,7 @@ jform_vvvvvxavwb_required = false; jform_vvvvvxavwc_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_helper_admin_vvvvvvv = jQuery("#jform_add_php_helper_admin input[type='radio']:checked").val(); vvvvvvv(add_php_helper_admin_vvvvvvv); @@ -729,7 +729,7 @@ function translation_tool_vvvvvxa_SomeFunc(translation_tool_vvvvvxa) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -913,43 +913,54 @@ function dasboardSwitch(value){ } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function addButtonID_server(type, size){ @@ -1002,4 +1013,4 @@ function addButton(type, where, size){ } } }) -} +} diff --git a/media/js/joomla_module.js b/media/js/joomla_module.js index d10ae51e8..1a3ccea7b 100644 --- a/media/js/joomla_module.js +++ b/media/js/joomla_module.js @@ -14,7 +14,7 @@ jform_vvvvvxsvwe_required = false; jform_vvvvvxtvwf_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_class_helper_vvvvvxb = jQuery("#jform_add_class_helper").val(); vvvvvxb(add_class_helper_vvvvvxb); @@ -479,7 +479,7 @@ function vvvvvxw(addreadme_vvvvvxw) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -672,43 +672,54 @@ function removeCodeFromEditor(code_string, editor_id){ } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function getSnippetDetails(id){ @@ -803,4 +814,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/media/js/joomla_module_files_folders_urls.js b/media/js/joomla_module_files_folders_urls.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_module_files_folders_urls.js +++ b/media/js/joomla_module_files_folders_urls.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/joomla_module_updates.js b/media/js/joomla_module_updates.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_module_updates.js +++ b/media/js/joomla_module_updates.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/joomla_plugin.js b/media/js/joomla_plugin.js index 1c5636934..29ea9bbc6 100644 --- a/media/js/joomla_plugin.js +++ b/media/js/joomla_plugin.js @@ -14,7 +14,7 @@ jform_vvvvvyqvwh_required = false; jform_vvvvvyrvwi_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var class_extends_vvvvvxx = jQuery("#jform_class_extends").val(); var joomla_plugin_group_vvvvvxx = jQuery("#jform_joomla_plugin_group").val(); @@ -615,7 +615,7 @@ function vvvvvyu(addreadme_vvvvvyu) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -1099,41 +1099,52 @@ function getLinked(){ }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/joomla_plugin_files_folders_urls.js b/media/js/joomla_plugin_files_folders_urls.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_plugin_files_folders_urls.js +++ b/media/js/joomla_plugin_files_folders_urls.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/joomla_plugin_group.js b/media/js/joomla_plugin_group.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_plugin_group.js +++ b/media/js/joomla_plugin_group.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/joomla_plugin_updates.js b/media/js/joomla_plugin_updates.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_plugin_updates.js +++ b/media/js/joomla_plugin_updates.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/language.js b/media/js/language.js index 215a78d2d..9d6629898 100644 --- a/media/js/language.js +++ b/media/js/language.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/language_translation.js b/media/js/language_translation.js index 4cd0acc5e..30c301cc7 100644 --- a/media/js/language_translation.js +++ b/media/js/language_translation.js @@ -45,4 +45,4 @@ function addButton(type, where, size){ } } }) -} +} diff --git a/media/js/layout.js b/media/js/layout.js index c896419d6..248512c9f 100644 --- a/media/js/layout.js +++ b/media/js/layout.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_view_vvvvwba = jQuery("#jform_add_php_view input[type='radio']:checked").val(); vvvvwba(add_php_view_vvvvwba); @@ -69,43 +69,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function getSnippetDetails(id){ @@ -253,4 +264,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/media/js/library.js b/media/js/library.js index 72351e245..a7127b710 100644 --- a/media/js/library.js +++ b/media/js/library.js @@ -14,7 +14,7 @@ jform_vvvvwcyvxm_required = false; jform_vvvvwcyvxn_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var how_vvvvwci = jQuery("#jform_how").val(); var target_vvvvwci = jQuery("#jform_target input[type='radio']:checked").val(); @@ -798,7 +798,7 @@ function vvvvwcz(target_vvvvwcz) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -911,43 +911,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function addButtonID_server(type, size){ @@ -1008,4 +1019,4 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} diff --git a/media/js/library_config.js b/media/js/library_config.js index 215a78d2d..9d6629898 100644 --- a/media/js/library_config.js +++ b/media/js/library_config.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/library_files_folders_urls.js b/media/js/library_files_folders_urls.js index 215a78d2d..9d6629898 100644 --- a/media/js/library_files_folders_urls.js +++ b/media/js/library_files_folders_urls.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/placeholder.js b/media/js/placeholder.js index 0786da5b5..268b44dd7 100644 --- a/media/js/placeholder.js +++ b/media/js/placeholder.js @@ -120,4 +120,4 @@ function placedin_server(placeholder, ide, target){ jsonp: false }); } - + diff --git a/media/js/power.js b/media/js/power.js index 097fc4c67..c88562ce3 100644 --- a/media/js/power.js +++ b/media/js/power.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_head_vvvvvyv = jQuery("#jform_add_head input[type='radio']:checked").val(); vvvvvyv(add_head_vvvvvyv); @@ -39,8 +39,7 @@ function isSet(val) } -jQuery(document).ready(function() -{ +document.addEventListener('DOMContentLoaded', function() { // get the linked details getLinked(); // load the active array values @@ -473,41 +472,52 @@ function getLinked(){ }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/server.js b/media/js/server.js index 7b3e1011e..48e95447e 100644 --- a/media/js/server.js +++ b/media/js/server.js @@ -20,7 +20,7 @@ jform_vvvvwedvyk_required = false; jform_vvvvwefvyl_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var protocol_vvvvwdz = jQuery("#jform_protocol").val(); vvvvwdz(protocol_vvvvwdz); @@ -542,7 +542,7 @@ function authentication_vvvvweh_SomeFunc(authentication_vvvvweh) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -588,4 +588,4 @@ function isSet(val) return true; } return false; -} +} diff --git a/media/js/site_view.js b/media/js/site_view.js index 5dba68d7e..2d9bd9602 100644 --- a/media/js/site_view.js +++ b/media/js/site_view.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_view_vvvvwao = jQuery("#jform_add_php_view input[type='radio']:checked").val(); vvvvwao(add_php_view_vvvvwao); @@ -438,41 +438,52 @@ function setSnippets(array){ jQuery('#jform_snippet').trigger('liszt:updated'); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/snippet.js b/media/js/snippet.js index 215a78d2d..9d6629898 100644 --- a/media/js/snippet.js +++ b/media/js/snippet.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/snippet_type.js b/media/js/snippet_type.js index 215a78d2d..9d6629898 100644 --- a/media/js/snippet_type.js +++ b/media/js/snippet_type.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/template.js b/media/js/template.js index 0329e650f..80e91901d 100644 --- a/media/js/template.js +++ b/media/js/template.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_view_vvvvwaz = jQuery("#jform_add_php_view input[type='radio']:checked").val(); vvvvwaz(add_php_view_vvvvwaz); @@ -69,43 +69,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function getSnippetDetails(id){ @@ -265,4 +276,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/media/js/validation_rule.js b/media/js/validation_rule.js index 1f8888340..252b004ad 100644 --- a/media/js/validation_rule.js +++ b/media/js/validation_rule.js @@ -97,41 +97,52 @@ function checkRuleName_server(ruleName, ide){ }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/script.php b/script.php index 2ea76bcb8..18d5604cb 100644 --- a/script.php +++ b/script.php @@ -12,25 +12,29 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Installer\Adapter\ComponentAdapter; +use Joomla\CMS\Version; +use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\FOF\Encrypt\AES; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\GetHelper; -JHTML::_('bootstrap.renderModal'); +HTML::_('bootstrap.renderModal'); /** * Script File of Componentbuilder Component */ -class com_componentbuilderInstallerScript +class Com_ComponentbuilderInstallerScript { /** * Constructor * - * @param JAdapterInstance $parent The object responsible for running this script + * @param ComponentAdapter $parent The object responsible for running this script */ public function __construct(ComponentAdapter $parent) {} @@ -51,10 +55,10 @@ class com_componentbuilderInstallerScript public function uninstall(ComponentAdapter $parent) { // Get Application object - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Get The Database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -84,7 +88,7 @@ class com_componentbuilderInstallerScript if ($joomla_component_done) { // If successfully remove Joomla_component add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__content_type table')); } // Remove Joomla_component items from the contentitem tag map table @@ -99,7 +103,7 @@ class com_componentbuilderInstallerScript if ($joomla_component_done) { // If successfully remove Joomla_component add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_component items from the ucm content table @@ -114,7 +118,7 @@ class com_componentbuilderInstallerScript if ($joomla_component_done) { // If successfully removed Joomla_component add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_component items are cleared from DB @@ -170,7 +174,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_done) { // If successfully remove Joomla_module add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__content_type table')); } // Remove Joomla_module items from the contentitem tag map table @@ -185,7 +189,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_done) { // If successfully remove Joomla_module add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_module items from the ucm content table @@ -200,7 +204,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_done) { // If successfully removed Joomla_module add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_module items are cleared from DB @@ -256,7 +260,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_done) { // If successfully remove Joomla_plugin add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__content_type table')); } // Remove Joomla_plugin items from the contentitem tag map table @@ -271,7 +275,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_done) { // If successfully remove Joomla_plugin add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_plugin items from the ucm content table @@ -286,7 +290,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_done) { // If successfully removed Joomla_plugin add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_plugin items are cleared from DB @@ -342,7 +346,7 @@ class com_componentbuilderInstallerScript if ($power_done) { // If successfully remove Power add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.power) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.power) type alias was removed from the #__content_type table')); } // Remove Power items from the contentitem tag map table @@ -357,7 +361,7 @@ class com_componentbuilderInstallerScript if ($power_done) { // If successfully remove Power add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.power) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.power) type alias was removed from the #__contentitem_tag_map table')); } // Remove Power items from the ucm content table @@ -372,7 +376,7 @@ class com_componentbuilderInstallerScript if ($power_done) { // If successfully removed Power add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.power) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.power) type alias was removed from the #__ucm_content table')); } // Make sure that all the Power items are cleared from DB @@ -428,7 +432,7 @@ class com_componentbuilderInstallerScript if ($admin_view_done) { // If successfully remove Admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_view) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_view) type alias was removed from the #__content_type table')); } // Remove Admin_view items from the contentitem tag map table @@ -443,7 +447,7 @@ class com_componentbuilderInstallerScript if ($admin_view_done) { // If successfully remove Admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_view) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_view) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_view items from the ucm content table @@ -458,7 +462,7 @@ class com_componentbuilderInstallerScript if ($admin_view_done) { // If successfully removed Admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_view) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_view) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_view items are cleared from DB @@ -514,7 +518,7 @@ class com_componentbuilderInstallerScript if ($custom_admin_view_done) { // If successfully remove Custom_admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__content_type table')); } // Remove Custom_admin_view items from the contentitem tag map table @@ -529,7 +533,7 @@ class com_componentbuilderInstallerScript if ($custom_admin_view_done) { // If successfully remove Custom_admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__contentitem_tag_map table')); } // Remove Custom_admin_view items from the ucm content table @@ -544,7 +548,7 @@ class com_componentbuilderInstallerScript if ($custom_admin_view_done) { // If successfully removed Custom_admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__ucm_content table')); } // Make sure that all the Custom_admin_view items are cleared from DB @@ -600,7 +604,7 @@ class com_componentbuilderInstallerScript if ($site_view_done) { // If successfully remove Site_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.site_view) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.site_view) type alias was removed from the #__content_type table')); } // Remove Site_view items from the contentitem tag map table @@ -615,7 +619,7 @@ class com_componentbuilderInstallerScript if ($site_view_done) { // If successfully remove Site_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.site_view) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.site_view) type alias was removed from the #__contentitem_tag_map table')); } // Remove Site_view items from the ucm content table @@ -630,7 +634,7 @@ class com_componentbuilderInstallerScript if ($site_view_done) { // If successfully removed Site_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.site_view) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.site_view) type alias was removed from the #__ucm_content table')); } // Make sure that all the Site_view items are cleared from DB @@ -686,7 +690,7 @@ class com_componentbuilderInstallerScript if ($template_done) { // If successfully remove Template add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.template) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.template) type alias was removed from the #__content_type table')); } // Remove Template items from the contentitem tag map table @@ -701,7 +705,7 @@ class com_componentbuilderInstallerScript if ($template_done) { // If successfully remove Template add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.template) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.template) type alias was removed from the #__contentitem_tag_map table')); } // Remove Template items from the ucm content table @@ -716,7 +720,7 @@ class com_componentbuilderInstallerScript if ($template_done) { // If successfully removed Template add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.template) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.template) type alias was removed from the #__ucm_content table')); } // Make sure that all the Template items are cleared from DB @@ -772,7 +776,7 @@ class com_componentbuilderInstallerScript if ($layout_done) { // If successfully remove Layout add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.layout) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.layout) type alias was removed from the #__content_type table')); } // Remove Layout items from the contentitem tag map table @@ -787,7 +791,7 @@ class com_componentbuilderInstallerScript if ($layout_done) { // If successfully remove Layout add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.layout) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.layout) type alias was removed from the #__contentitem_tag_map table')); } // Remove Layout items from the ucm content table @@ -802,7 +806,7 @@ class com_componentbuilderInstallerScript if ($layout_done) { // If successfully removed Layout add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.layout) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.layout) type alias was removed from the #__ucm_content table')); } // Make sure that all the Layout items are cleared from DB @@ -858,7 +862,7 @@ class com_componentbuilderInstallerScript if ($dynamic_get_done) { // If successfully remove Dynamic_get add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__content_type table')); } // Remove Dynamic_get items from the contentitem tag map table @@ -873,7 +877,7 @@ class com_componentbuilderInstallerScript if ($dynamic_get_done) { // If successfully remove Dynamic_get add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__contentitem_tag_map table')); } // Remove Dynamic_get items from the ucm content table @@ -888,7 +892,7 @@ class com_componentbuilderInstallerScript if ($dynamic_get_done) { // If successfully removed Dynamic_get add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__ucm_content table')); } // Make sure that all the Dynamic_get items are cleared from DB @@ -944,7 +948,7 @@ class com_componentbuilderInstallerScript if ($custom_code_done) { // If successfully remove Custom_code add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_code) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_code) type alias was removed from the #__content_type table')); } // Remove Custom_code items from the contentitem tag map table @@ -959,7 +963,7 @@ class com_componentbuilderInstallerScript if ($custom_code_done) { // If successfully remove Custom_code add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_code) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_code) type alias was removed from the #__contentitem_tag_map table')); } // Remove Custom_code items from the ucm content table @@ -974,7 +978,7 @@ class com_componentbuilderInstallerScript if ($custom_code_done) { // If successfully removed Custom_code add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_code) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_code) type alias was removed from the #__ucm_content table')); } // Make sure that all the Custom_code items are cleared from DB @@ -1030,7 +1034,7 @@ class com_componentbuilderInstallerScript if ($class_property_done) { // If successfully remove Class_property add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_property) type alias was removed from the #__content_type table')); } // Remove Class_property items from the contentitem tag map table @@ -1045,7 +1049,7 @@ class com_componentbuilderInstallerScript if ($class_property_done) { // If successfully remove Class_property add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_property) type alias was removed from the #__contentitem_tag_map table')); } // Remove Class_property items from the ucm content table @@ -1060,7 +1064,7 @@ class com_componentbuilderInstallerScript if ($class_property_done) { // If successfully removed Class_property add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_property) type alias was removed from the #__ucm_content table')); } // Make sure that all the Class_property items are cleared from DB @@ -1116,7 +1120,7 @@ class com_componentbuilderInstallerScript if ($class_method_done) { // If successfully remove Class_method add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_method) type alias was removed from the #__content_type table')); } // Remove Class_method items from the contentitem tag map table @@ -1131,7 +1135,7 @@ class com_componentbuilderInstallerScript if ($class_method_done) { // If successfully remove Class_method add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_method) type alias was removed from the #__contentitem_tag_map table')); } // Remove Class_method items from the ucm content table @@ -1146,7 +1150,7 @@ class com_componentbuilderInstallerScript if ($class_method_done) { // If successfully removed Class_method add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_method) type alias was removed from the #__ucm_content table')); } // Make sure that all the Class_method items are cleared from DB @@ -1202,7 +1206,7 @@ class com_componentbuilderInstallerScript if ($placeholder_done) { // If successfully remove Placeholder add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.placeholder) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.placeholder) type alias was removed from the #__content_type table')); } // Remove Placeholder items from the contentitem tag map table @@ -1217,7 +1221,7 @@ class com_componentbuilderInstallerScript if ($placeholder_done) { // If successfully remove Placeholder add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.placeholder) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.placeholder) type alias was removed from the #__contentitem_tag_map table')); } // Remove Placeholder items from the ucm content table @@ -1232,7 +1236,7 @@ class com_componentbuilderInstallerScript if ($placeholder_done) { // If successfully removed Placeholder add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.placeholder) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.placeholder) type alias was removed from the #__ucm_content table')); } // Make sure that all the Placeholder items are cleared from DB @@ -1288,7 +1292,7 @@ class com_componentbuilderInstallerScript if ($library_done) { // If successfully remove Library add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library) type alias was removed from the #__content_type table')); } // Remove Library items from the contentitem tag map table @@ -1303,7 +1307,7 @@ class com_componentbuilderInstallerScript if ($library_done) { // If successfully remove Library add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library) type alias was removed from the #__contentitem_tag_map table')); } // Remove Library items from the ucm content table @@ -1318,7 +1322,7 @@ class com_componentbuilderInstallerScript if ($library_done) { // If successfully removed Library add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library) type alias was removed from the #__ucm_content table')); } // Make sure that all the Library items are cleared from DB @@ -1374,7 +1378,7 @@ class com_componentbuilderInstallerScript if ($snippet_done) { // If successfully remove Snippet add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet) type alias was removed from the #__content_type table')); } // Remove Snippet items from the contentitem tag map table @@ -1389,7 +1393,7 @@ class com_componentbuilderInstallerScript if ($snippet_done) { // If successfully remove Snippet add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet) type alias was removed from the #__contentitem_tag_map table')); } // Remove Snippet items from the ucm content table @@ -1404,7 +1408,7 @@ class com_componentbuilderInstallerScript if ($snippet_done) { // If successfully removed Snippet add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet) type alias was removed from the #__ucm_content table')); } // Make sure that all the Snippet items are cleared from DB @@ -1460,7 +1464,7 @@ class com_componentbuilderInstallerScript if ($validation_rule_done) { // If successfully remove Validation_rule add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__content_type table')); } // Remove Validation_rule items from the contentitem tag map table @@ -1475,7 +1479,7 @@ class com_componentbuilderInstallerScript if ($validation_rule_done) { // If successfully remove Validation_rule add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__contentitem_tag_map table')); } // Remove Validation_rule items from the ucm content table @@ -1490,7 +1494,7 @@ class com_componentbuilderInstallerScript if ($validation_rule_done) { // If successfully removed Validation_rule add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__ucm_content table')); } // Make sure that all the Validation_rule items are cleared from DB @@ -1546,7 +1550,7 @@ class com_componentbuilderInstallerScript if ($field_done) { // If successfully remove Field add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field) type alias was removed from the #__content_type table')); } // Remove Field items from the contentitem tag map table @@ -1561,7 +1565,7 @@ class com_componentbuilderInstallerScript if ($field_done) { // If successfully remove Field add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field) type alias was removed from the #__contentitem_tag_map table')); } // Remove Field items from the ucm content table @@ -1576,7 +1580,7 @@ class com_componentbuilderInstallerScript if ($field_done) { // If successfully removed Field add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field) type alias was removed from the #__ucm_content table')); } // Make sure that all the Field items are cleared from DB @@ -1632,7 +1636,7 @@ class com_componentbuilderInstallerScript if ($field_catid_done) { // If successfully remove Field catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field.category) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field.category) type alias was removed from the #__content_type table')); } // Remove Field catid items from the contentitem tag map table @@ -1647,7 +1651,7 @@ class com_componentbuilderInstallerScript if ($field_catid_done) { // If successfully remove Field catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field.category) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field.category) type alias was removed from the #__contentitem_tag_map table')); } // Remove Field catid items from the ucm content table @@ -1662,7 +1666,7 @@ class com_componentbuilderInstallerScript if ($field_catid_done) { // If successfully removed Field catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field.category) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field.category) type alias was removed from the #__ucm_content table')); } // Make sure that all the Field catid items are cleared from DB @@ -1718,7 +1722,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_done) { // If successfully remove Fieldtype add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__content_type table')); } // Remove Fieldtype items from the contentitem tag map table @@ -1733,7 +1737,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_done) { // If successfully remove Fieldtype add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__contentitem_tag_map table')); } // Remove Fieldtype items from the ucm content table @@ -1748,7 +1752,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_done) { // If successfully removed Fieldtype add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__ucm_content table')); } // Make sure that all the Fieldtype items are cleared from DB @@ -1804,7 +1808,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_catid_done) { // If successfully remove Fieldtype catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__content_type table')); } // Remove Fieldtype catid items from the contentitem tag map table @@ -1819,7 +1823,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_catid_done) { // If successfully remove Fieldtype catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__contentitem_tag_map table')); } // Remove Fieldtype catid items from the ucm content table @@ -1834,7 +1838,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_catid_done) { // If successfully removed Fieldtype catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__ucm_content table')); } // Make sure that all the Fieldtype catid items are cleared from DB @@ -1890,7 +1894,7 @@ class com_componentbuilderInstallerScript if ($language_translation_done) { // If successfully remove Language_translation add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language_translation) type alias was removed from the #__content_type table')); } // Remove Language_translation items from the contentitem tag map table @@ -1905,7 +1909,7 @@ class com_componentbuilderInstallerScript if ($language_translation_done) { // If successfully remove Language_translation add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language_translation) type alias was removed from the #__contentitem_tag_map table')); } // Remove Language_translation items from the ucm content table @@ -1920,7 +1924,7 @@ class com_componentbuilderInstallerScript if ($language_translation_done) { // If successfully removed Language_translation add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language_translation) type alias was removed from the #__ucm_content table')); } // Make sure that all the Language_translation items are cleared from DB @@ -1976,7 +1980,7 @@ class com_componentbuilderInstallerScript if ($language_done) { // If successfully remove Language add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language) type alias was removed from the #__content_type table')); } // Remove Language items from the contentitem tag map table @@ -1991,7 +1995,7 @@ class com_componentbuilderInstallerScript if ($language_done) { // If successfully remove Language add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language) type alias was removed from the #__contentitem_tag_map table')); } // Remove Language items from the ucm content table @@ -2006,7 +2010,7 @@ class com_componentbuilderInstallerScript if ($language_done) { // If successfully removed Language add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language) type alias was removed from the #__ucm_content table')); } // Make sure that all the Language items are cleared from DB @@ -2062,7 +2066,7 @@ class com_componentbuilderInstallerScript if ($server_done) { // If successfully remove Server add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.server) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.server) type alias was removed from the #__content_type table')); } // Remove Server items from the contentitem tag map table @@ -2077,7 +2081,7 @@ class com_componentbuilderInstallerScript if ($server_done) { // If successfully remove Server add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.server) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.server) type alias was removed from the #__contentitem_tag_map table')); } // Remove Server items from the ucm content table @@ -2092,7 +2096,7 @@ class com_componentbuilderInstallerScript if ($server_done) { // If successfully removed Server add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.server) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.server) type alias was removed from the #__ucm_content table')); } // Make sure that all the Server items are cleared from DB @@ -2148,7 +2152,7 @@ class com_componentbuilderInstallerScript if ($help_document_done) { // If successfully remove Help_document add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.help_document) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.help_document) type alias was removed from the #__content_type table')); } // Remove Help_document items from the contentitem tag map table @@ -2163,7 +2167,7 @@ class com_componentbuilderInstallerScript if ($help_document_done) { // If successfully remove Help_document add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.help_document) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.help_document) type alias was removed from the #__contentitem_tag_map table')); } // Remove Help_document items from the ucm content table @@ -2178,7 +2182,7 @@ class com_componentbuilderInstallerScript if ($help_document_done) { // If successfully removed Help_document add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.help_document) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.help_document) type alias was removed from the #__ucm_content table')); } // Make sure that all the Help_document items are cleared from DB @@ -2234,7 +2238,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_done) { // If successfully remove Admin_fields add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__content_type table')); } // Remove Admin_fields items from the contentitem tag map table @@ -2249,7 +2253,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_done) { // If successfully remove Admin_fields add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_fields items from the ucm content table @@ -2264,7 +2268,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_done) { // If successfully removed Admin_fields add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_fields items are cleared from DB @@ -2320,7 +2324,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_conditions_done) { // If successfully remove Admin_fields_conditions add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__content_type table')); } // Remove Admin_fields_conditions items from the contentitem tag map table @@ -2335,7 +2339,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_conditions_done) { // If successfully remove Admin_fields_conditions add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_fields_conditions items from the ucm content table @@ -2350,7 +2354,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_conditions_done) { // If successfully removed Admin_fields_conditions add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_fields_conditions items are cleared from DB @@ -2406,7 +2410,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_relations_done) { // If successfully remove Admin_fields_relations add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__content_type table')); } // Remove Admin_fields_relations items from the contentitem tag map table @@ -2421,7 +2425,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_relations_done) { // If successfully remove Admin_fields_relations add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_fields_relations items from the ucm content table @@ -2436,7 +2440,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_relations_done) { // If successfully removed Admin_fields_relations add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_fields_relations items are cleared from DB @@ -2492,7 +2496,7 @@ class com_componentbuilderInstallerScript if ($admin_custom_tabs_done) { // If successfully remove Admin_custom_tabs add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__content_type table')); } // Remove Admin_custom_tabs items from the contentitem tag map table @@ -2507,7 +2511,7 @@ class com_componentbuilderInstallerScript if ($admin_custom_tabs_done) { // If successfully remove Admin_custom_tabs add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_custom_tabs items from the ucm content table @@ -2522,7 +2526,7 @@ class com_componentbuilderInstallerScript if ($admin_custom_tabs_done) { // If successfully removed Admin_custom_tabs add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_custom_tabs items are cleared from DB @@ -2578,7 +2582,7 @@ class com_componentbuilderInstallerScript if ($component_admin_views_done) { // If successfully remove Component_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__content_type table')); } // Remove Component_admin_views items from the contentitem tag map table @@ -2593,7 +2597,7 @@ class com_componentbuilderInstallerScript if ($component_admin_views_done) { // If successfully remove Component_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_admin_views items from the ucm content table @@ -2608,7 +2612,7 @@ class com_componentbuilderInstallerScript if ($component_admin_views_done) { // If successfully removed Component_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_admin_views items are cleared from DB @@ -2664,7 +2668,7 @@ class com_componentbuilderInstallerScript if ($component_site_views_done) { // If successfully remove Component_site_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__content_type table')); } // Remove Component_site_views items from the contentitem tag map table @@ -2679,7 +2683,7 @@ class com_componentbuilderInstallerScript if ($component_site_views_done) { // If successfully remove Component_site_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_site_views items from the ucm content table @@ -2694,7 +2698,7 @@ class com_componentbuilderInstallerScript if ($component_site_views_done) { // If successfully removed Component_site_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_site_views items are cleared from DB @@ -2750,7 +2754,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_views_done) { // If successfully remove Component_custom_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__content_type table')); } // Remove Component_custom_admin_views items from the contentitem tag map table @@ -2765,7 +2769,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_views_done) { // If successfully remove Component_custom_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_custom_admin_views items from the ucm content table @@ -2780,7 +2784,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_views_done) { // If successfully removed Component_custom_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_custom_admin_views items are cleared from DB @@ -2836,7 +2840,7 @@ class com_componentbuilderInstallerScript if ($component_updates_done) { // If successfully remove Component_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_updates) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_updates) type alias was removed from the #__content_type table')); } // Remove Component_updates items from the contentitem tag map table @@ -2851,7 +2855,7 @@ class com_componentbuilderInstallerScript if ($component_updates_done) { // If successfully remove Component_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_updates) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_updates) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_updates items from the ucm content table @@ -2866,7 +2870,7 @@ class com_componentbuilderInstallerScript if ($component_updates_done) { // If successfully removed Component_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_updates) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_updates) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_updates items are cleared from DB @@ -2922,7 +2926,7 @@ class com_componentbuilderInstallerScript if ($component_mysql_tweaks_done) { // If successfully remove Component_mysql_tweaks add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__content_type table')); } // Remove Component_mysql_tweaks items from the contentitem tag map table @@ -2937,7 +2941,7 @@ class com_componentbuilderInstallerScript if ($component_mysql_tweaks_done) { // If successfully remove Component_mysql_tweaks add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_mysql_tweaks items from the ucm content table @@ -2952,7 +2956,7 @@ class com_componentbuilderInstallerScript if ($component_mysql_tweaks_done) { // If successfully removed Component_mysql_tweaks add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_mysql_tweaks items are cleared from DB @@ -3008,7 +3012,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_menus_done) { // If successfully remove Component_custom_admin_menus add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__content_type table')); } // Remove Component_custom_admin_menus items from the contentitem tag map table @@ -3023,7 +3027,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_menus_done) { // If successfully remove Component_custom_admin_menus add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_custom_admin_menus items from the ucm content table @@ -3038,7 +3042,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_menus_done) { // If successfully removed Component_custom_admin_menus add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_custom_admin_menus items are cleared from DB @@ -3066,6 +3070,92 @@ class com_componentbuilderInstallerScript } } + // Create a new query object. + $query = $db->getQuery(true); + // Select id from content type table + $query->select($db->quoteName('type_id')); + $query->from($db->quoteName('#__content_types')); + // Where Component_router alias is found + $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_router') ); + $db->setQuery($query); + // Execute query to see if alias is found + $db->execute(); + $component_router_found = $db->getNumRows(); + // Now check if there were any rows + if ($component_router_found) + { + // Since there are load the needed component_router type ids + $component_router_ids = $db->loadColumn(); + // Remove Component_router from the content type table + $component_router_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_router') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__content_types')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $component_router_done = $db->execute(); + if ($component_router_done) + { + // If successfully remove Component_router add queued success message. + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_router) type alias was removed from the #__content_type table')); + } + + // Remove Component_router items from the contentitem tag map table + $component_router_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_router') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__contentitem_tag_map')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $component_router_done = $db->execute(); + if ($component_router_done) + { + // If successfully remove Component_router add queued success message. + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_router) type alias was removed from the #__contentitem_tag_map table')); + } + + // Remove Component_router items from the ucm content table + $component_router_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.component_router') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_content')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $component_router_done = $db->execute(); + if ($component_router_done) + { + // If successfully removed Component_router add queued success message. + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_router) type alias was removed from the #__ucm_content table')); + } + + // Make sure that all the Component_router items are cleared from DB + foreach ($component_router_ids as $component_router_id) + { + // Remove Component_router items from the ucm base table + $component_router_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $component_router_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_base')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $db->execute(); + + // Remove Component_router items from the ucm history table + $component_router_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $component_router_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_history')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $db->execute(); + } + } + // Create a new query object. $query = $db->getQuery(true); // Select id from content type table @@ -3094,7 +3184,7 @@ class com_componentbuilderInstallerScript if ($component_config_done) { // If successfully remove Component_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_config) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_config) type alias was removed from the #__content_type table')); } // Remove Component_config items from the contentitem tag map table @@ -3109,7 +3199,7 @@ class com_componentbuilderInstallerScript if ($component_config_done) { // If successfully remove Component_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_config) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_config) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_config items from the ucm content table @@ -3124,7 +3214,7 @@ class com_componentbuilderInstallerScript if ($component_config_done) { // If successfully removed Component_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_config) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_config) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_config items are cleared from DB @@ -3180,7 +3270,7 @@ class com_componentbuilderInstallerScript if ($component_dashboard_done) { // If successfully remove Component_dashboard add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__content_type table')); } // Remove Component_dashboard items from the contentitem tag map table @@ -3195,7 +3285,7 @@ class com_componentbuilderInstallerScript if ($component_dashboard_done) { // If successfully remove Component_dashboard add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_dashboard items from the ucm content table @@ -3210,7 +3300,7 @@ class com_componentbuilderInstallerScript if ($component_dashboard_done) { // If successfully removed Component_dashboard add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_dashboard items are cleared from DB @@ -3266,7 +3356,7 @@ class com_componentbuilderInstallerScript if ($component_files_folders_done) { // If successfully remove Component_files_folders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__content_type table')); } // Remove Component_files_folders items from the contentitem tag map table @@ -3281,7 +3371,7 @@ class com_componentbuilderInstallerScript if ($component_files_folders_done) { // If successfully remove Component_files_folders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_files_folders items from the ucm content table @@ -3296,7 +3386,7 @@ class com_componentbuilderInstallerScript if ($component_files_folders_done) { // If successfully removed Component_files_folders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_files_folders items are cleared from DB @@ -3352,7 +3442,7 @@ class com_componentbuilderInstallerScript if ($component_placeholders_done) { // If successfully remove Component_placeholders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__content_type table')); } // Remove Component_placeholders items from the contentitem tag map table @@ -3367,7 +3457,7 @@ class com_componentbuilderInstallerScript if ($component_placeholders_done) { // If successfully remove Component_placeholders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_placeholders items from the ucm content table @@ -3382,7 +3472,7 @@ class com_componentbuilderInstallerScript if ($component_placeholders_done) { // If successfully removed Component_placeholders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_placeholders items are cleared from DB @@ -3438,7 +3528,7 @@ class com_componentbuilderInstallerScript if ($component_plugins_done) { // If successfully remove Component_plugins add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__content_type table')); } // Remove Component_plugins items from the contentitem tag map table @@ -3453,7 +3543,7 @@ class com_componentbuilderInstallerScript if ($component_plugins_done) { // If successfully remove Component_plugins add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_plugins items from the ucm content table @@ -3468,7 +3558,7 @@ class com_componentbuilderInstallerScript if ($component_plugins_done) { // If successfully removed Component_plugins add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_plugins items are cleared from DB @@ -3524,7 +3614,7 @@ class com_componentbuilderInstallerScript if ($component_modules_done) { // If successfully remove Component_modules add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_modules) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_modules) type alias was removed from the #__content_type table')); } // Remove Component_modules items from the contentitem tag map table @@ -3539,7 +3629,7 @@ class com_componentbuilderInstallerScript if ($component_modules_done) { // If successfully remove Component_modules add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_modules) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_modules) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_modules items from the ucm content table @@ -3554,7 +3644,7 @@ class com_componentbuilderInstallerScript if ($component_modules_done) { // If successfully removed Component_modules add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_modules) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_modules) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_modules items are cleared from DB @@ -3610,7 +3700,7 @@ class com_componentbuilderInstallerScript if ($snippet_type_done) { // If successfully remove Snippet_type add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__content_type table')); } // Remove Snippet_type items from the contentitem tag map table @@ -3625,7 +3715,7 @@ class com_componentbuilderInstallerScript if ($snippet_type_done) { // If successfully remove Snippet_type add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__contentitem_tag_map table')); } // Remove Snippet_type items from the ucm content table @@ -3640,7 +3730,7 @@ class com_componentbuilderInstallerScript if ($snippet_type_done) { // If successfully removed Snippet_type add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__ucm_content table')); } // Make sure that all the Snippet_type items are cleared from DB @@ -3696,7 +3786,7 @@ class com_componentbuilderInstallerScript if ($library_config_done) { // If successfully remove Library_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_config) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_config) type alias was removed from the #__content_type table')); } // Remove Library_config items from the contentitem tag map table @@ -3711,7 +3801,7 @@ class com_componentbuilderInstallerScript if ($library_config_done) { // If successfully remove Library_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_config) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_config) type alias was removed from the #__contentitem_tag_map table')); } // Remove Library_config items from the ucm content table @@ -3726,7 +3816,7 @@ class com_componentbuilderInstallerScript if ($library_config_done) { // If successfully removed Library_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_config) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_config) type alias was removed from the #__ucm_content table')); } // Make sure that all the Library_config items are cleared from DB @@ -3782,7 +3872,7 @@ class com_componentbuilderInstallerScript if ($library_files_folders_urls_done) { // If successfully remove Library_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__content_type table')); } // Remove Library_files_folders_urls items from the contentitem tag map table @@ -3797,7 +3887,7 @@ class com_componentbuilderInstallerScript if ($library_files_folders_urls_done) { // If successfully remove Library_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); } // Remove Library_files_folders_urls items from the ucm content table @@ -3812,7 +3902,7 @@ class com_componentbuilderInstallerScript if ($library_files_folders_urls_done) { // If successfully removed Library_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__ucm_content table')); } // Make sure that all the Library_files_folders_urls items are cleared from DB @@ -3868,7 +3958,7 @@ class com_componentbuilderInstallerScript if ($class_extends_done) { // If successfully remove Class_extends add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_extends) type alias was removed from the #__content_type table')); } // Remove Class_extends items from the contentitem tag map table @@ -3883,7 +3973,7 @@ class com_componentbuilderInstallerScript if ($class_extends_done) { // If successfully remove Class_extends add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_extends) type alias was removed from the #__contentitem_tag_map table')); } // Remove Class_extends items from the ucm content table @@ -3898,7 +3988,7 @@ class com_componentbuilderInstallerScript if ($class_extends_done) { // If successfully removed Class_extends add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_extends) type alias was removed from the #__ucm_content table')); } // Make sure that all the Class_extends items are cleared from DB @@ -3954,7 +4044,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_updates_done) { // If successfully remove Joomla_module_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__content_type table')); } // Remove Joomla_module_updates items from the contentitem tag map table @@ -3969,7 +4059,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_updates_done) { // If successfully remove Joomla_module_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_module_updates items from the ucm content table @@ -3984,7 +4074,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_updates_done) { // If successfully removed Joomla_module_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_module_updates items are cleared from DB @@ -4040,7 +4130,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_files_folders_urls_done) { // If successfully remove Joomla_module_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__content_type table')); } // Remove Joomla_module_files_folders_urls items from the contentitem tag map table @@ -4055,7 +4145,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_files_folders_urls_done) { // If successfully remove Joomla_module_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_module_files_folders_urls items from the ucm content table @@ -4070,7 +4160,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_files_folders_urls_done) { // If successfully removed Joomla_module_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_module_files_folders_urls items are cleared from DB @@ -4126,7 +4216,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_group_done) { // If successfully remove Joomla_plugin_group add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__content_type table')); } // Remove Joomla_plugin_group items from the contentitem tag map table @@ -4141,7 +4231,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_group_done) { // If successfully remove Joomla_plugin_group add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_plugin_group items from the ucm content table @@ -4156,7 +4246,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_group_done) { // If successfully removed Joomla_plugin_group add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_plugin_group items are cleared from DB @@ -4212,7 +4302,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_updates_done) { // If successfully remove Joomla_plugin_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__content_type table')); } // Remove Joomla_plugin_updates items from the contentitem tag map table @@ -4227,7 +4317,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_updates_done) { // If successfully remove Joomla_plugin_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_plugin_updates items from the ucm content table @@ -4242,7 +4332,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_updates_done) { // If successfully removed Joomla_plugin_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_plugin_updates items are cleared from DB @@ -4298,7 +4388,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_done) { // If successfully remove Joomla_plugin_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__content_type table')); } // Remove Joomla_plugin_files_folders_urls items from the contentitem tag map table @@ -4313,7 +4403,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_done) { // If successfully remove Joomla_plugin_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_plugin_files_folders_urls items from the ucm content table @@ -4328,7 +4418,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_done) { // If successfully removed Joomla_plugin_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_plugin_files_folders_urls items are cleared from DB @@ -4357,8 +4447,8 @@ class com_componentbuilderInstallerScript } // If All related items was removed queued success message. - $app->enqueueMessage(JText::_('All related items was removed from the #__ucm_base table')); - $app->enqueueMessage(JText::_('All related items was removed from the #__ucm_history table')); + $app->enqueueMessage(Text::_('All related items was removed from the #__ucm_base table')); + $app->enqueueMessage(Text::_('All related items was removed from the #__ucm_history table')); // Remove componentbuilder assets from the assets table $componentbuilder_condition = array( $db->quoteName('name') . ' LIKE ' . $db->quote('com_componentbuilder%') ); @@ -4372,7 +4462,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_done) { // If successfully removed componentbuilder add queued success message. - $app->enqueueMessage(JText::_('All related items was removed from the #__assets table')); + $app->enqueueMessage(Text::_('All related items was removed from the #__assets table')); } // Get the biggest rule column in the assets table at this point. @@ -4388,24 +4478,24 @@ class com_componentbuilderInstallerScript $revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';"; $db->setQuery($revert_rule); $db->execute(); - $app->enqueueMessage(JText::_('Reverted the #__assets table rules column back to its default size of varchar(5120)')); + $app->enqueueMessage(Text::_('Reverted the #__assets table rules column back to its default size of varchar(5120)')); } else { - $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.')); + $app->enqueueMessage(Text::_('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.')); } } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder from the action_logs_extensions table $componentbuilder_action_logs_extensions = array( $db->quoteName('extension') . ' = ' . $db->quote('com_componentbuilder') ); @@ -4419,18 +4509,18 @@ class com_componentbuilderInstallerScript if ($componentbuilder_removed_done) { // If successfully remove Componentbuilder add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder extension was removed from the #__action_logs_extensions table')); + $app->enqueueMessage(Text::_('The com_componentbuilder extension was removed from the #__action_logs_extensions table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_component from the action_log_config table $joomla_component_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_component') ); @@ -4444,18 +4534,18 @@ class com_componentbuilderInstallerScript if ($joomla_component_action_log_config_done) { // If successfully removed Componentbuilder Joomla_component add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_component type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_component type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_module from the action_log_config table $joomla_module_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_module') ); @@ -4469,18 +4559,18 @@ class com_componentbuilderInstallerScript if ($joomla_module_action_log_config_done) { // If successfully removed Componentbuilder Joomla_module add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_module type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_module type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_plugin from the action_log_config table $joomla_plugin_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin') ); @@ -4494,18 +4584,18 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_action_log_config_done) { // If successfully removed Componentbuilder Joomla_plugin add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_plugin type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_plugin type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Power from the action_log_config table $power_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.power') ); @@ -4519,18 +4609,18 @@ class com_componentbuilderInstallerScript if ($power_action_log_config_done) { // If successfully removed Componentbuilder Power add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.power type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.power type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_view from the action_log_config table $admin_view_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_view') ); @@ -4544,18 +4634,18 @@ class com_componentbuilderInstallerScript if ($admin_view_action_log_config_done) { // If successfully removed Componentbuilder Admin_view add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_view type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_view type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Custom_admin_view from the action_log_config table $custom_admin_view_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.custom_admin_view') ); @@ -4569,18 +4659,18 @@ class com_componentbuilderInstallerScript if ($custom_admin_view_action_log_config_done) { // If successfully removed Componentbuilder Custom_admin_view add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.custom_admin_view type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.custom_admin_view type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Site_view from the action_log_config table $site_view_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.site_view') ); @@ -4594,18 +4684,18 @@ class com_componentbuilderInstallerScript if ($site_view_action_log_config_done) { // If successfully removed Componentbuilder Site_view add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.site_view type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.site_view type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Template from the action_log_config table $template_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.template') ); @@ -4619,18 +4709,18 @@ class com_componentbuilderInstallerScript if ($template_action_log_config_done) { // If successfully removed Componentbuilder Template add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.template type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.template type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Layout from the action_log_config table $layout_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.layout') ); @@ -4644,18 +4734,18 @@ class com_componentbuilderInstallerScript if ($layout_action_log_config_done) { // If successfully removed Componentbuilder Layout add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.layout type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.layout type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Dynamic_get from the action_log_config table $dynamic_get_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.dynamic_get') ); @@ -4669,18 +4759,18 @@ class com_componentbuilderInstallerScript if ($dynamic_get_action_log_config_done) { // If successfully removed Componentbuilder Dynamic_get add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.dynamic_get type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.dynamic_get type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Custom_code from the action_log_config table $custom_code_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.custom_code') ); @@ -4694,18 +4784,18 @@ class com_componentbuilderInstallerScript if ($custom_code_action_log_config_done) { // If successfully removed Componentbuilder Custom_code add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.custom_code type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.custom_code type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Class_property from the action_log_config table $class_property_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_property') ); @@ -4719,18 +4809,18 @@ class com_componentbuilderInstallerScript if ($class_property_action_log_config_done) { // If successfully removed Componentbuilder Class_property add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.class_property type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.class_property type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Class_method from the action_log_config table $class_method_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_method') ); @@ -4744,18 +4834,18 @@ class com_componentbuilderInstallerScript if ($class_method_action_log_config_done) { // If successfully removed Componentbuilder Class_method add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.class_method type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.class_method type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Placeholder from the action_log_config table $placeholder_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.placeholder') ); @@ -4769,18 +4859,18 @@ class com_componentbuilderInstallerScript if ($placeholder_action_log_config_done) { // If successfully removed Componentbuilder Placeholder add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.placeholder type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.placeholder type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Library from the action_log_config table $library_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.library') ); @@ -4794,18 +4884,18 @@ class com_componentbuilderInstallerScript if ($library_action_log_config_done) { // If successfully removed Componentbuilder Library add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.library type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.library type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Snippet from the action_log_config table $snippet_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.snippet') ); @@ -4819,18 +4909,18 @@ class com_componentbuilderInstallerScript if ($snippet_action_log_config_done) { // If successfully removed Componentbuilder Snippet add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.snippet type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.snippet type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Validation_rule from the action_log_config table $validation_rule_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.validation_rule') ); @@ -4844,18 +4934,18 @@ class com_componentbuilderInstallerScript if ($validation_rule_action_log_config_done) { // If successfully removed Componentbuilder Validation_rule add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.validation_rule type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.validation_rule type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Field from the action_log_config table $field_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.field') ); @@ -4869,18 +4959,18 @@ class com_componentbuilderInstallerScript if ($field_action_log_config_done) { // If successfully removed Componentbuilder Field add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.field type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.field type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Fieldtype from the action_log_config table $fieldtype_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.fieldtype') ); @@ -4894,18 +4984,18 @@ class com_componentbuilderInstallerScript if ($fieldtype_action_log_config_done) { // If successfully removed Componentbuilder Fieldtype add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.fieldtype type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.fieldtype type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Language_translation from the action_log_config table $language_translation_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language_translation') ); @@ -4919,18 +5009,18 @@ class com_componentbuilderInstallerScript if ($language_translation_action_log_config_done) { // If successfully removed Componentbuilder Language_translation add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.language_translation type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.language_translation type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Language from the action_log_config table $language_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language') ); @@ -4944,18 +5034,18 @@ class com_componentbuilderInstallerScript if ($language_action_log_config_done) { // If successfully removed Componentbuilder Language add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.language type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.language type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Server from the action_log_config table $server_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.server') ); @@ -4969,18 +5059,18 @@ class com_componentbuilderInstallerScript if ($server_action_log_config_done) { // If successfully removed Componentbuilder Server add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.server type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.server type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Help_document from the action_log_config table $help_document_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.help_document') ); @@ -4994,18 +5084,18 @@ class com_componentbuilderInstallerScript if ($help_document_action_log_config_done) { // If successfully removed Componentbuilder Help_document add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.help_document type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.help_document type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_fields from the action_log_config table $admin_fields_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields') ); @@ -5019,18 +5109,18 @@ class com_componentbuilderInstallerScript if ($admin_fields_action_log_config_done) { // If successfully removed Componentbuilder Admin_fields add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_fields type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_fields type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_fields_conditions from the action_log_config table $admin_fields_conditions_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_conditions') ); @@ -5044,18 +5134,18 @@ class com_componentbuilderInstallerScript if ($admin_fields_conditions_action_log_config_done) { // If successfully removed Componentbuilder Admin_fields_conditions add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_fields_conditions type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_fields_conditions type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_fields_relations from the action_log_config table $admin_fields_relations_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_relations') ); @@ -5069,18 +5159,18 @@ class com_componentbuilderInstallerScript if ($admin_fields_relations_action_log_config_done) { // If successfully removed Componentbuilder Admin_fields_relations add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_fields_relations type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_fields_relations type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_custom_tabs from the action_log_config table $admin_custom_tabs_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_custom_tabs') ); @@ -5094,18 +5184,18 @@ class com_componentbuilderInstallerScript if ($admin_custom_tabs_action_log_config_done) { // If successfully removed Componentbuilder Admin_custom_tabs add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_custom_tabs type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_custom_tabs type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_admin_views from the action_log_config table $component_admin_views_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_admin_views') ); @@ -5119,18 +5209,18 @@ class com_componentbuilderInstallerScript if ($component_admin_views_action_log_config_done) { // If successfully removed Componentbuilder Component_admin_views add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_admin_views type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_admin_views type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_site_views from the action_log_config table $component_site_views_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_site_views') ); @@ -5144,18 +5234,18 @@ class com_componentbuilderInstallerScript if ($component_site_views_action_log_config_done) { // If successfully removed Componentbuilder Component_site_views add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_site_views type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_site_views type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_custom_admin_views from the action_log_config table $component_custom_admin_views_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_custom_admin_views') ); @@ -5169,18 +5259,18 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_views_action_log_config_done) { // If successfully removed Componentbuilder Component_custom_admin_views add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_custom_admin_views type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_custom_admin_views type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_updates from the action_log_config table $component_updates_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_updates') ); @@ -5194,18 +5284,18 @@ class com_componentbuilderInstallerScript if ($component_updates_action_log_config_done) { // If successfully removed Componentbuilder Component_updates add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_updates type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_updates type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_mysql_tweaks from the action_log_config table $component_mysql_tweaks_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_mysql_tweaks') ); @@ -5219,18 +5309,18 @@ class com_componentbuilderInstallerScript if ($component_mysql_tweaks_action_log_config_done) { // If successfully removed Componentbuilder Component_mysql_tweaks add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_mysql_tweaks type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_mysql_tweaks type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_custom_admin_menus from the action_log_config table $component_custom_admin_menus_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_custom_admin_menus') ); @@ -5244,18 +5334,43 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_menus_action_log_config_done) { // If successfully removed Componentbuilder Component_custom_admin_menus add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_custom_admin_menus type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_custom_admin_menus type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); + } + // Remove Componentbuilder Component_router from the action_log_config table + $component_router_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_router') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__action_log_config')); + $query->where($component_router_action_log_config); + $db->setQuery($query); + // Execute the query to remove com_componentbuilder.component_router + $component_router_action_log_config_done = $db->execute(); + if ($component_router_action_log_config_done) + { + // If successfully removed Componentbuilder Component_router add queued success message. + $app->enqueueMessage(Text::_('The com_componentbuilder.component_router type alias was removed from the #__action_log_config table')); + } + + // Set db if not set already. + if (!isset($db)) + { + $db = Factory::getDbo(); + } + // Set app if not set already. + if (!isset($app)) + { + $app = Factory::getApplication(); } // Remove Componentbuilder Component_config from the action_log_config table $component_config_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_config') ); @@ -5269,18 +5384,18 @@ class com_componentbuilderInstallerScript if ($component_config_action_log_config_done) { // If successfully removed Componentbuilder Component_config add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_config type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_config type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_dashboard from the action_log_config table $component_dashboard_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_dashboard') ); @@ -5294,18 +5409,18 @@ class com_componentbuilderInstallerScript if ($component_dashboard_action_log_config_done) { // If successfully removed Componentbuilder Component_dashboard add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_dashboard type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_dashboard type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_files_folders from the action_log_config table $component_files_folders_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_files_folders') ); @@ -5319,18 +5434,18 @@ class com_componentbuilderInstallerScript if ($component_files_folders_action_log_config_done) { // If successfully removed Componentbuilder Component_files_folders add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_files_folders type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_files_folders type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_placeholders from the action_log_config table $component_placeholders_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_placeholders') ); @@ -5344,18 +5459,18 @@ class com_componentbuilderInstallerScript if ($component_placeholders_action_log_config_done) { // If successfully removed Componentbuilder Component_placeholders add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_placeholders type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_placeholders type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_plugins from the action_log_config table $component_plugins_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_plugins') ); @@ -5369,18 +5484,18 @@ class com_componentbuilderInstallerScript if ($component_plugins_action_log_config_done) { // If successfully removed Componentbuilder Component_plugins add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_plugins type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_plugins type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_modules from the action_log_config table $component_modules_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_modules') ); @@ -5394,18 +5509,18 @@ class com_componentbuilderInstallerScript if ($component_modules_action_log_config_done) { // If successfully removed Componentbuilder Component_modules add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_modules type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_modules type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Snippet_type from the action_log_config table $snippet_type_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.snippet_type') ); @@ -5419,18 +5534,18 @@ class com_componentbuilderInstallerScript if ($snippet_type_action_log_config_done) { // If successfully removed Componentbuilder Snippet_type add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.snippet_type type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.snippet_type type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Library_config from the action_log_config table $library_config_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.library_config') ); @@ -5444,18 +5559,18 @@ class com_componentbuilderInstallerScript if ($library_config_action_log_config_done) { // If successfully removed Componentbuilder Library_config add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.library_config type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.library_config type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Library_files_folders_urls from the action_log_config table $library_files_folders_urls_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.library_files_folders_urls') ); @@ -5469,18 +5584,18 @@ class com_componentbuilderInstallerScript if ($library_files_folders_urls_action_log_config_done) { // If successfully removed Componentbuilder Library_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.library_files_folders_urls type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.library_files_folders_urls type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Class_extends from the action_log_config table $class_extends_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_extends') ); @@ -5494,18 +5609,18 @@ class com_componentbuilderInstallerScript if ($class_extends_action_log_config_done) { // If successfully removed Componentbuilder Class_extends add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.class_extends type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.class_extends type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_module_updates from the action_log_config table $joomla_module_updates_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_module_updates') ); @@ -5519,18 +5634,18 @@ class com_componentbuilderInstallerScript if ($joomla_module_updates_action_log_config_done) { // If successfully removed Componentbuilder Joomla_module_updates add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_module_updates type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_module_updates type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_module_files_folders_urls from the action_log_config table $joomla_module_files_folders_urls_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_module_files_folders_urls') ); @@ -5544,18 +5659,18 @@ class com_componentbuilderInstallerScript if ($joomla_module_files_folders_urls_action_log_config_done) { // If successfully removed Componentbuilder Joomla_module_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_module_files_folders_urls type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_module_files_folders_urls type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_plugin_group from the action_log_config table $joomla_plugin_group_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_group') ); @@ -5569,18 +5684,18 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_group_action_log_config_done) { // If successfully removed Componentbuilder Joomla_plugin_group add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_plugin_group type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_plugin_group type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_plugin_updates from the action_log_config table $joomla_plugin_updates_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_updates') ); @@ -5594,18 +5709,18 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_updates_action_log_config_done) { // If successfully removed Componentbuilder Joomla_plugin_updates add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_plugin_updates type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_plugin_updates type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_plugin_files_folders_urls from the action_log_config table $joomla_plugin_files_folders_urls_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_files_folders_urls') ); @@ -5619,7 +5734,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_action_log_config_done) { // If successfully removed Componentbuilder Joomla_plugin_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_plugin_files_folders_urls type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_plugin_files_folders_urls type alias was removed from the #__action_log_config table')); } // little notice as after service, in case of bad experience with component. echo '

Did something go wrong? Are you disappointed?

@@ -5649,14 +5764,14 @@ class com_componentbuilderInstallerScript public function preflight($type, ComponentAdapter $parent) { // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // is redundant or so it seems ...hmmm let me know if it works again if ($type === 'uninstall') { return true; } // the default for both install and update - $jversion = new JVersion(); + $jversion = new Version(); if (!$jversion->isCompatible('3.8.0')) { $app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error'); @@ -5675,7 +5790,7 @@ class com_componentbuilderInstallerScript // get the version $this->JCBversion = explode('.', $manifest->version); // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // target version less then 2.5.2 if (count($this->JCBversion) == 3 && $this->JCBversion[0] <= 2 && $this->JCBversion[1] <= 5 && (($this->JCBversion[1] == 5 && $this->JCBversion[2] <= 1) || ($this->JCBversion[1] < 5))) @@ -6131,7 +6246,7 @@ class com_componentbuilderInstallerScript public function postflight($type, ComponentAdapter $parent) { // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // We check if we have dynamic folders to copy $this->setDynamicF0ld3rs($app, $parent); // set the default component settings @@ -6139,226 +6254,226 @@ class com_componentbuilderInstallerScript { // Get The Database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create the joomla_component content type object. - $joomla_component = new stdClass(); + $joomla_component = new \stdClass(); $joomla_component->type_title = 'Componentbuilder Joomla_component'; $joomla_component->type_alias = 'com_componentbuilder.joomla_component'; $joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_admin","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","css_admin":"css_admin","php_admin_event":"php_admin_event","php_site_event":"php_site_event","crowdin_username":"crowdin_username","component_version":"component_version","php_postflight_install":"php_postflight_install","remove_line_breaks":"remove_line_breaks","description":"description","sql_uninstall":"sql_uninstall","debug_linenr":"debug_linenr","mvc_versiondate":"mvc_versiondate","php_preflight_install":"php_preflight_install","backup_folder_path":"backup_folder_path","php_method_uninstall":"php_method_uninstall","add_placeholders":"add_placeholders","author":"author","add_sales_server":"add_sales_server","email":"email","translation_tool":"translation_tool","website":"website","buildcompsql":"buildcompsql","add_license":"add_license","php_helper_admin":"php_helper_admin","license_type":"license_type","php_helper_site":"php_helper_site","javascript":"javascript","whmcs_key":"whmcs_key","css_site":"css_site","whmcs_url":"whmcs_url","whmcs_buy_link":"whmcs_buy_link","php_preflight_update":"php_preflight_update","license":"license","php_postflight_update":"php_postflight_update","bom":"bom","sql":"sql","image":"image","addreadme":"addreadme","copyright":"copyright","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_menu_prefix":"add_menu_prefix","add_css_admin":"add_css_admin","menu_prefix":"menu_prefix","add_css_site":"add_css_site","dashboard_type":"dashboard_type","dashboard":"dashboard","toignore":"toignore","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","export_key":"export_key","add_php_postflight_update":"add_php_postflight_update","joomla_source_link":"joomla_source_link","add_php_method_uninstall":"add_php_method_uninstall","export_buy_link":"export_buy_link","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","assets_table_fix":"assets_table_fix","readme":"readme","emptycontributors":"emptycontributors","add_update_server":"add_update_server","number":"number","update_server_target":"update_server_target","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","creatuserhelper":"creatuserhelper","adduikit":"adduikit","crowdin_project_api_key":"crowdin_project_api_key","addfootable":"addfootable","crowdin_account_api_key":"crowdin_account_api_key","add_email_helper":"add_email_helper","buildcomp":"buildcomp","add_php_helper_both":"add_php_helper_both","guid":"guid","php_helper_both":"php_helper_both","name":"name"}}'; + $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_site_event","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","debug_linenr":"debug_linenr","php_site_event":"php_site_event","translation_tool":"translation_tool","buildcompsql":"buildcompsql","add_sales_server":"add_sales_server","php_preflight_install":"php_preflight_install","php_method_uninstall":"php_method_uninstall","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","description":"description","php_postflight_install":"php_postflight_install","author":"author","sql_uninstall":"sql_uninstall","email":"email","website":"website","backup_folder_path":"backup_folder_path","php_helper_both":"php_helper_both","crowdin_username":"crowdin_username","php_admin_event":"php_admin_event","add_license":"add_license","component_version":"component_version","php_helper_admin":"php_helper_admin","license_type":"license_type","php_helper_site":"php_helper_site","javascript":"javascript","whmcs_key":"whmcs_key","css_site":"css_site","whmcs_url":"whmcs_url","whmcs_buy_link":"whmcs_buy_link","php_preflight_update":"php_preflight_update","license":"license","php_postflight_update":"php_postflight_update","bom":"bom","sql":"sql","image":"image","addreadme":"addreadme","copyright":"copyright","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_namespace_prefix":"add_namespace_prefix","add_javascript":"add_javascript","namespace_prefix":"namespace_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","add_menu_prefix":"add_menu_prefix","dashboard_type":"dashboard_type","menu_prefix":"menu_prefix","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","toignore":"toignore","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","export_key":"export_key","add_sql":"add_sql","joomla_source_link":"joomla_source_link","add_sql_uninstall":"add_sql_uninstall","export_buy_link":"export_buy_link","assets_table_fix":"assets_table_fix","readme":"readme","add_update_server":"add_update_server","update_server_target":"update_server_target","emptycontributors":"emptycontributors","number":"number","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","crowdin_project_api_key":"crowdin_project_api_key","creatuserhelper":"creatuserhelper","crowdin_account_api_key":"crowdin_account_api_key","adduikit":"adduikit","buildcomp":"buildcomp","addfootable":"addfootable","guid":"guid","add_email_helper":"add_email_helper","name":"name"}}'; $joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute'; - $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","remove_line_breaks","debug_linenr","mvc_versiondate","add_placeholders","add_sales_server","translation_tool","add_license","license_type","addreadme","add_powers","add_backup_folder_path","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","emptycontributors","add_update_server","number","update_server_target","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","addfootable","add_email_helper","buildcomp","add_php_helper_both"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","debug_linenr","translation_tool","add_sales_server","mvc_versiondate","remove_line_breaks","add_placeholders","add_license","license_type","addreadme","add_powers","add_backup_folder_path","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","add_update_server","update_server_target","emptycontributors","number","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","buildcomp","addfootable","add_email_helper"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component); // Create the joomla_module content type object. - $joomla_module = new stdClass(); + $joomla_module = new \stdClass(); $joomla_module->type_title = 'Componentbuilder Joomla_module'; $joomla_module->type_alias = 'com_componentbuilder.joomla_module'; $joomla_module->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module","key": "id","type": "Joomla_module","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "default","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","target":"target","description":"description","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","add_php_preflight_uninstall":"add_php_preflight_uninstall","addreadme":"addreadme","default":"default","snippet":"snippet","add_sql":"add_sql","update_server_target":"update_server_target","add_sql_uninstall":"add_sql_uninstall","update_server":"update_server","add_update_server":"add_update_server","libraries":"libraries","module_version":"module_version","sales_server":"sales_server","custom_get":"custom_get","php_preflight_update":"php_preflight_update","php_preflight_uninstall":"php_preflight_uninstall","mod_code":"mod_code","php_postflight_install":"php_postflight_install","add_class_helper":"add_class_helper","php_postflight_update":"php_postflight_update","add_class_helper_header":"add_class_helper_header","php_method_uninstall":"php_method_uninstall","class_helper_header":"class_helper_header","sql":"sql","class_helper_code":"class_helper_code","sql_uninstall":"sql_uninstall","readme":"readme","add_php_script_construct":"add_php_script_construct","update_server_url":"update_server_url","php_script_construct":"php_script_construct","add_php_preflight_install":"add_php_preflight_install","php_preflight_install":"php_preflight_install","add_sales_server":"add_sales_server","add_php_preflight_update":"add_php_preflight_update","guid":"guid","name":"name"}}'; $joomla_module->router = 'ComponentbuilderHelperRoute::getJoomla_moduleRoute'; - $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_module_Inserted = $db->insertObject('#__content_types', $joomla_module); // Create the joomla_plugin content type object. - $joomla_plugin = new stdClass(); + $joomla_plugin = new \stdClass(); $joomla_plugin->type_title = 'Componentbuilder Joomla_plugin'; $joomla_plugin->type_alias = 'com_componentbuilder.joomla_plugin'; $joomla_plugin->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin","key": "id","type": "Joomla_plugin","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","class_extends":"class_extends","joomla_plugin_group":"joomla_plugin_group","add_sql":"add_sql","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","sales_server":"sales_server","add_update_server":"add_update_server","add_head":"add_head","add_sql_uninstall":"add_sql_uninstall","addreadme":"addreadme","head":"head","update_server_target":"update_server_target","main_class_code":"main_class_code","update_server":"update_server","description":"description","php_postflight_install":"php_postflight_install","plugin_version":"plugin_version","php_postflight_update":"php_postflight_update","php_method_uninstall":"php_method_uninstall","add_php_script_construct":"add_php_script_construct","sql":"sql","php_script_construct":"php_script_construct","sql_uninstall":"sql_uninstall","add_php_preflight_install":"add_php_preflight_install","readme":"readme","php_preflight_install":"php_preflight_install","update_server_url":"update_server_url","add_php_preflight_update":"add_php_preflight_update","php_preflight_update":"php_preflight_update","add_php_preflight_uninstall":"add_php_preflight_uninstall","add_sales_server":"add_sales_server","php_preflight_uninstall":"php_preflight_uninstall","guid":"guid","name":"name"}}'; $joomla_plugin->router = 'ComponentbuilderHelperRoute::getJoomla_pluginRoute'; - $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends","joomla_plugin_group","add_sql","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","sales_server","add_update_server","add_head","add_sql_uninstall","addreadme","update_server_target","update_server","add_php_script_construct","add_php_preflight_install","add_php_preflight_update","add_php_preflight_uninstall","add_sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","class_extends","joomla_plugin_group","add_sql","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","sales_server","add_update_server","add_head","add_sql_uninstall","addreadme","update_server_target","update_server","add_php_script_construct","add_php_preflight_install","add_php_preflight_update","add_php_preflight_uninstall","add_sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_plugin_Inserted = $db->insertObject('#__content_types', $joomla_plugin); // Create the power content type object. - $power = new stdClass(); + $power = new \stdClass(); $power->type_title = 'Componentbuilder Power'; $power->type_alias = 'com_componentbuilder.power'; $power->table = '{"special": {"dbtable": "#__componentbuilder_power","key": "id","type": "Power","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $power->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","namespace":"namespace","type":"type","power_version":"power_version","licensing_template":"licensing_template","description":"description","extends":"extends","approved":"approved","add_head":"add_head","extends_custom":"extends_custom","implements_custom":"implements_custom","implements":"implements","head":"head","approved_paths":"approved_paths","main_class_code":"main_class_code","add_licensing_template":"add_licensing_template","guid":"guid","name":"name"}}'; $power->router = 'ComponentbuilderHelperRoute::getPowerRoute'; - $power->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/power.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","approved","add_head","add_licensing_template"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "extends","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"},{"sourceColumn": "implements","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"}]}'; + $power->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/power.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","approved","add_head","add_licensing_template"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "extends","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"},{"sourceColumn": "implements","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"}]}'; // Set the object into the content types table. $power_Inserted = $db->insertObject('#__content_types', $power); // Create the admin_view content type object. - $admin_view = new stdClass(); + $admin_view = new \stdClass(); $admin_view->type_title = 'Componentbuilder Admin_view'; $admin_view->type_alias = 'com_componentbuilder.admin_view'; $admin_view->table = '{"special": {"dbtable": "#__componentbuilder_admin_view","key": "id","type": "Admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "null","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_allowedit","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_single":"name_single","short_description":"short_description","php_allowedit":"php_allowedit","php_postsavehook":"php_postsavehook","php_before_save":"php_before_save","php_getlistquery":"php_getlistquery","php_import_ext":"php_import_ext","icon":"icon","php_after_publish":"php_after_publish","add_fadein":"add_fadein","description":"description","icon_category":"icon_category","icon_add":"icon_add","php_after_cancel":"php_after_cancel","mysql_table_charset":"mysql_table_charset","php_batchmove":"php_batchmove","type":"type","php_after_delete":"php_after_delete","source":"source","php_import":"php_import","php_getitems_after_all":"php_getitems_after_all","php_getform":"php_getform","php_save":"php_save","php_allowadd":"php_allowadd","php_before_cancel":"php_before_cancel","php_batchcopy":"php_batchcopy","php_before_publish":"php_before_publish","alias_builder_type":"alias_builder_type","php_before_delete":"php_before_delete","php_document":"php_document","mysql_table_row_format":"mysql_table_row_format","alias_builder":"alias_builder","sql":"sql","php_import_display":"php_import_display","add_category_submenu":"add_category_submenu","php_import_setdata":"php_import_setdata","name_list":"name_list","add_php_getlistquery":"add_php_getlistquery","add_css_view":"add_css_view","add_php_getform":"add_php_getform","css_view":"css_view","add_php_before_save":"add_php_before_save","add_css_views":"add_css_views","add_php_save":"add_php_save","css_views":"css_views","add_php_postsavehook":"add_php_postsavehook","add_javascript_view_file":"add_javascript_view_file","add_php_allowadd":"add_php_allowadd","javascript_view_file":"javascript_view_file","add_php_allowedit":"add_php_allowedit","add_javascript_view_footer":"add_javascript_view_footer","add_php_before_cancel":"add_php_before_cancel","javascript_view_footer":"javascript_view_footer","add_php_after_cancel":"add_php_after_cancel","add_javascript_views_file":"add_javascript_views_file","add_php_batchcopy":"add_php_batchcopy","javascript_views_file":"javascript_views_file","add_php_batchmove":"add_php_batchmove","add_javascript_views_footer":"add_javascript_views_footer","add_php_before_publish":"add_php_before_publish","javascript_views_footer":"javascript_views_footer","add_php_after_publish":"add_php_after_publish","add_custom_button":"add_custom_button","add_php_before_delete":"add_php_before_delete","add_php_after_delete":"add_php_after_delete","php_controller":"php_controller","add_php_document":"add_php_document","php_model":"php_model","mysql_table_engine":"mysql_table_engine","php_controller_list":"php_controller_list","mysql_table_collate":"mysql_table_collate","php_model_list":"php_model_list","add_sql":"add_sql","add_php_ajax":"add_php_ajax","php_ajaxmethod":"php_ajaxmethod","add_custom_import":"add_custom_import","add_php_getitem":"add_php_getitem","html_import_view":"html_import_view","php_getitem":"php_getitem","php_import_headers":"php_import_headers","add_php_getitems":"add_php_getitems","php_import_save":"php_import_save","php_getitems":"php_getitems","guid":"guid","add_php_getitems_after_all":"add_php_getitems_after_all"}}'; $admin_view->router = 'ComponentbuilderHelperRoute::getAdmin_viewRoute'; - $admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add_fadein","type","source","add_category_submenu","add_php_getlistquery","add_css_view","add_php_getform","add_php_before_save","add_css_views","add_php_save","add_php_postsavehook","add_javascript_view_file","add_php_allowadd","add_php_allowedit","add_javascript_view_footer","add_php_before_cancel","add_php_after_cancel","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem","add_php_getitems","add_php_getitems_after_all"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "alias_builder","targetTable": "#__componentbuilder_field","targetColumn": "id","displayColumn": "name"}]}'; + $admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","add_fadein","type","source","add_category_submenu","add_php_getlistquery","add_css_view","add_php_getform","add_php_before_save","add_css_views","add_php_save","add_php_postsavehook","add_javascript_view_file","add_php_allowadd","add_php_allowedit","add_javascript_view_footer","add_php_before_cancel","add_php_after_cancel","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem","add_php_getitems","add_php_getitems_after_all"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "alias_builder","targetTable": "#__componentbuilder_field","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $admin_view_Inserted = $db->insertObject('#__content_types', $admin_view); // Create the custom_admin_view content type object. - $custom_admin_view = new stdClass(); + $custom_admin_view = new \stdClass(); $custom_admin_view->type_title = 'Componentbuilder Custom_admin_view'; $custom_admin_view->type_alias = 'com_componentbuilder.custom_admin_view'; $custom_admin_view->table = '{"special": {"dbtable": "#__componentbuilder_custom_admin_view","key": "id","type": "Custom_admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $custom_admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_document","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","css_document":"css_document","css":"css","js_document":"js_document","javascript_file":"javascript_file","codename":"codename","default":"default","snippet":"snippet","icon":"icon","add_php_jview":"add_php_jview","context":"context","add_js_document":"add_js_document","custom_get":"custom_get","add_javascript_file":"add_javascript_file","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","add_php_document":"add_php_document","add_css":"add_css","add_php_view":"add_php_view","add_php_ajax":"add_php_ajax","libraries":"libraries","dynamic_get":"dynamic_get","php_document":"php_document","php_view":"php_view","add_custom_button":"add_custom_button","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $custom_admin_view->router = 'ComponentbuilderHelperRoute::getCustom_admin_viewRoute'; - $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $custom_admin_view_Inserted = $db->insertObject('#__content_types', $custom_admin_view); // Create the site_view content type object. - $site_view = new stdClass(); + $site_view = new \stdClass(); $site_view->type_title = 'Componentbuilder Site_view'; $site_view->type_alias = 'com_componentbuilder.site_view'; $site_view->table = '{"special": {"dbtable": "#__componentbuilder_site_view","key": "id","type": "Site_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $site_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "js_document","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","add_php_document":"add_php_document","add_php_view":"add_php_view","js_document":"js_document","codename":"codename","javascript_file":"javascript_file","context":"context","default":"default","snippet":"snippet","add_php_jview":"add_php_jview","custom_get":"custom_get","css_document":"css_document","add_javascript_file":"add_javascript_file","css":"css","add_js_document":"add_js_document","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","libraries":"libraries","add_css":"add_css","dynamic_get":"dynamic_get","add_php_ajax":"add_php_ajax","add_custom_button":"add_custom_button","php_document":"php_document","button_position":"button_position","php_view":"php_view","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $site_view->router = 'ComponentbuilderHelperRoute::getSite_viewRoute'; - $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $site_view_Inserted = $db->insertObject('#__content_types', $site_view); // Create the template content type object. - $template = new stdClass(); + $template = new \stdClass(); $template->type_title = 'Componentbuilder Template'; $template->type_alias = 'com_componentbuilder.template'; $template->table = '{"special": {"dbtable": "#__componentbuilder_template","key": "id","type": "Template","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $template->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "php_view","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","dynamic_get":"dynamic_get","php_view":"php_view","add_php_view":"add_php_view","template":"template","snippet":"snippet","libraries":"libraries","alias":"alias"}}'; $template->router = 'ComponentbuilderHelperRoute::getTemplateRoute'; - $template->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/template.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","dynamic_get","add_php_view","snippet"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $template->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/template.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","dynamic_get","add_php_view","snippet"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $template_Inserted = $db->insertObject('#__content_types', $template); // Create the layout content type object. - $layout = new stdClass(); + $layout = new \stdClass(); $layout->type_title = 'Componentbuilder Layout'; $layout->type_alias = 'com_componentbuilder.layout'; $layout->table = '{"special": {"dbtable": "#__componentbuilder_layout","key": "id","type": "Layout","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $layout->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "php_view","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","dynamic_get":"dynamic_get","snippet":"snippet","php_view":"php_view","add_php_view":"add_php_view","layout":"layout","libraries":"libraries","alias":"alias"}}'; $layout->router = 'ComponentbuilderHelperRoute::getLayoutRoute'; - $layout->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/layout.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","dynamic_get","snippet","add_php_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $layout->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/layout.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","dynamic_get","snippet","add_php_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $layout_Inserted = $db->insertObject('#__content_types', $layout); // Create the dynamic_get content type object. - $dynamic_get = new stdClass(); + $dynamic_get = new \stdClass(); $dynamic_get->type_title = 'Componentbuilder Dynamic_get'; $dynamic_get->type_alias = 'com_componentbuilder.dynamic_get'; $dynamic_get->table = '{"special": {"dbtable": "#__componentbuilder_dynamic_get","key": "id","type": "Dynamic_get","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_before_getitems","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","main_source":"main_source","gettype":"gettype","php_router_parse":"php_router_parse","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","php_after_getitem":"php_after_getitem","php_getlistquery":"php_getlistquery","view_selection":"view_selection","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","php_calculation":"php_calculation","php_before_getitem":"php_before_getitem","view_table_main":"view_table_main","select_all":"select_all","add_php_before_getitem":"add_php_before_getitem","getcustom":"getcustom","add_php_after_getitem":"add_php_after_getitem","pagination":"pagination","add_php_getlistquery":"add_php_getlistquery","add_php_before_getitems":"add_php_before_getitems","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","addcalculation":"addcalculation","guid":"guid"}}'; + $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_calculation","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","main_source":"main_source","gettype":"gettype","php_calculation":"php_calculation","php_router_parse":"php_router_parse","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","view_selection":"view_selection","add_php_before_getitems":"add_php_before_getitems","add_php_before_getitem":"add_php_before_getitem","add_php_after_getitem":"add_php_after_getitem","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","view_table_main":"view_table_main","add_php_getlistquery":"add_php_getlistquery","select_all":"select_all","php_before_getitem":"php_before_getitem","getcustom":"getcustom","php_after_getitem":"php_after_getitem","pagination":"pagination","php_getlistquery":"php_getlistquery","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","addcalculation":"addcalculation","guid":"guid"}}'; $dynamic_get->router = 'ComponentbuilderHelperRoute::getDynamic_getRoute'; - $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_source","gettype","view_table_main","select_all","add_php_before_getitem","add_php_after_getitem","pagination","add_php_getlistquery","add_php_before_getitems","add_php_after_getitems","add_php_router_parse"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_source","gettype","add_php_after_getitems","add_php_router_parse","add_php_before_getitems","add_php_before_getitem","add_php_after_getitem","view_table_main","add_php_getlistquery","select_all","pagination"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $dynamic_get_Inserted = $db->insertObject('#__content_types', $dynamic_get); // Create the custom_code content type object. - $custom_code = new stdClass(); + $custom_code = new \stdClass(); $custom_code->type_title = 'Componentbuilder Custom_code'; $custom_code->type_alias = 'com_componentbuilder.custom_code'; $custom_code->table = '{"special": {"dbtable": "#__componentbuilder_custom_code","key": "id","type": "Custom_code","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; + $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","joomla_version":"joomla_version","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; $custom_code->router = 'ComponentbuilderHelperRoute::getCustom_codeRoute'; - $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","comment_type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","component","target","type","comment_type","joomla_version"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $custom_code_Inserted = $db->insertObject('#__content_types', $custom_code); // Create the class_property content type object. - $class_property = new stdClass(); + $class_property = new \stdClass(); $class_property->type_title = 'Componentbuilder Class_property'; $class_property->type_alias = 'com_componentbuilder.class_property'; $class_property->table = '{"special": {"dbtable": "#__componentbuilder_class_property","key": "id","type": "Class_property","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_property->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","guid":"guid","comment":"comment","joomla_plugin_group":"joomla_plugin_group","default":"default"}}'; $class_property->router = 'ComponentbuilderHelperRoute::getClass_propertyRoute'; - $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; + $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $class_property_Inserted = $db->insertObject('#__content_types', $class_property); // Create the class_method content type object. - $class_method = new stdClass(); + $class_method = new \stdClass(); $class_method->type_title = 'Componentbuilder Class_method'; $class_method->type_alias = 'com_componentbuilder.class_method'; $class_method->table = '{"special": {"dbtable": "#__componentbuilder_class_method","key": "id","type": "Class_method","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_method->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","guid":"guid","code":"code","comment":"comment","joomla_plugin_group":"joomla_plugin_group","arguments":"arguments"}}'; $class_method->router = 'ComponentbuilderHelperRoute::getClass_methodRoute'; - $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; + $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $class_method_Inserted = $db->insertObject('#__content_types', $class_method); // Create the placeholder content type object. - $placeholder = new stdClass(); + $placeholder = new \stdClass(); $placeholder->type_title = 'Componentbuilder Placeholder'; $placeholder->type_alias = 'com_componentbuilder.placeholder'; $placeholder->table = '{"special": {"dbtable": "#__componentbuilder_placeholder","key": "id","type": "Placeholder","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $placeholder->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "target","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"target":"target","value":"value"}}'; $placeholder->router = 'ComponentbuilderHelperRoute::getPlaceholderRoute'; - $placeholder->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/placeholder.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $placeholder->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/placeholder.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $placeholder_Inserted = $db->insertObject('#__content_types', $placeholder); // Create the library content type object. - $library = new stdClass(); + $library = new \stdClass(); $library->type_title = 'Componentbuilder Library'; $library->type_alias = 'com_componentbuilder.library'; $library->table = '{"special": {"dbtable": "#__componentbuilder_library","key": "id","type": "Library","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","target":"target","how":"how","type":"type","description":"description","libraries":"libraries","php_setdocument":"php_setdocument","guid":"guid"}}'; $library->router = 'ComponentbuilderHelperRoute::getLibraryRoute'; - $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","target","how","type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","target","how","type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $library_Inserted = $db->insertObject('#__content_types', $library); // Create the snippet content type object. - $snippet = new stdClass(); + $snippet = new \stdClass(); $snippet->type_title = 'Componentbuilder Snippet'; $snippet->type_alias = 'com_componentbuilder.snippet'; $snippet->table = '{"special": {"dbtable": "#__componentbuilder_snippet","key": "id","type": "Snippet","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $snippet->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","url":"url","type":"type","heading":"heading","library":"library","guid":"guid","contributor_email":"contributor_email","contributor_name":"contributor_name","contributor_website":"contributor_website","contributor_company":"contributor_company","snippet":"snippet","usage":"usage","description":"description"}}'; $snippet->router = 'ComponentbuilderHelperRoute::getSnippetRoute'; - $snippet->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "type","targetTable": "#__componentbuilder_snippet_type","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $snippet->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","type","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "type","targetTable": "#__componentbuilder_snippet_type","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $snippet_Inserted = $db->insertObject('#__content_types', $snippet); // Create the validation_rule content type object. - $validation_rule = new stdClass(); + $validation_rule = new \stdClass(); $validation_rule->type_title = 'Componentbuilder Validation_rule'; $validation_rule->type_alias = 'com_componentbuilder.validation_rule'; $validation_rule->table = '{"special": {"dbtable": "#__componentbuilder_validation_rule","key": "id","type": "Validation_rule","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $validation_rule->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","short_description":"short_description","inherit":"inherit","php":"php"}}'; $validation_rule->router = 'ComponentbuilderHelperRoute::getValidation_ruleRoute'; - $validation_rule->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/validation_rule.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "inherit","targetTable": "#__componentbuilder_validation_rule","targetColumn": "id","displayColumn": "name"}]}'; + $validation_rule->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/validation_rule.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "inherit","targetTable": "#__componentbuilder_validation_rule","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $validation_rule_Inserted = $db->insertObject('#__content_types', $validation_rule); // Create the field content type object. - $field = new stdClass(); + $field = new \stdClass(); $field->type_title = 'Componentbuilder Field'; $field->type_alias = 'com_componentbuilder.field'; $field->table = '{"special": {"dbtable": "#__componentbuilder_field","key": "id","type": "Field","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_views","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","store":"store","on_save_model_field":"on_save_model_field","initiator_on_get_model":"initiator_on_get_model","initiator_on_save_model":"initiator_on_save_model","xml":"xml","datalenght":"datalenght","css_views":"css_views","css_view":"css_view","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","on_get_model_field":"on_get_model_field","javascript_view_footer":"javascript_view_footer","javascript_views_footer":"javascript_views_footer","add_css_view":"add_css_view","add_css_views":"add_css_views","add_javascript_view_footer":"add_javascript_view_footer","add_javascript_views_footer":"add_javascript_views_footer","guid":"guid"}}'; $field->router = 'ComponentbuilderHelperRoute::getFieldRoute'; - $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","store","catid","add_css_view","add_css_views","add_javascript_view_footer","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}'; + $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","fieldtype","store","catid","add_css_view","add_css_views","add_javascript_view_footer","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $field_Inserted = $db->insertObject('#__content_types', $field); // Create the field category content type object. - $field_category = new stdClass(); + $field_category = new \stdClass(); $field_category->type_title = 'Componentbuilder Field Catid'; $field_category->type_alias = 'com_componentbuilder.field.category'; $field_category->table = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; @@ -6370,19 +6485,19 @@ class com_componentbuilderInstallerScript $field_category_Inserted = $db->insertObject('#__content_types', $field_category); // Create the fieldtype content type object. - $fieldtype = new stdClass(); + $fieldtype = new \stdClass(); $fieldtype->type_title = 'Componentbuilder Fieldtype'; $fieldtype->type_alias = 'com_componentbuilder.fieldtype'; $fieldtype->table = '{"special": {"dbtable": "#__componentbuilder_fieldtype","key": "id","type": "Fieldtype","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $fieldtype->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","store":"store","null_switch":"null_switch","indexes":"indexes","datadefault_other":"datadefault_other","datadefault":"datadefault","short_description":"short_description","datatype":"datatype","has_defaults":"has_defaults","description":"description","datalenght":"datalenght","datalenght_other":"datalenght_other","guid":"guid"}}'; $fieldtype->router = 'ComponentbuilderHelperRoute::getFieldtypeRoute'; - $fieldtype->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/fieldtype.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","store","has_defaults","catid"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $fieldtype->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/fieldtype.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","store","has_defaults","catid"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $fieldtype_Inserted = $db->insertObject('#__content_types', $fieldtype); // Create the fieldtype category content type object. - $fieldtype_category = new stdClass(); + $fieldtype_category = new \stdClass(); $fieldtype_category->type_title = 'Componentbuilder Fieldtype Catid'; $fieldtype_category->type_alias = 'com_componentbuilder.fieldtype.category'; $fieldtype_category->table = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; @@ -6394,359 +6509,388 @@ class com_componentbuilderInstallerScript $fieldtype_category_Inserted = $db->insertObject('#__content_types', $fieldtype_category); // Create the language_translation content type object. - $language_translation = new stdClass(); + $language_translation = new \stdClass(); $language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_alias = 'com_componentbuilder.language_translation'; $language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","plugins":"plugins","modules":"modules","components":"components"}}'; $language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute'; - $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $language_translation_Inserted = $db->insertObject('#__content_types', $language_translation); // Create the language content type object. - $language = new stdClass(); + $language = new \stdClass(); $language->type_title = 'Componentbuilder Language'; $language->type_alias = 'com_componentbuilder.language'; $language->table = '{"special": {"dbtable": "#__componentbuilder_language","key": "id","type": "Language","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","langtag":"langtag"}}'; $language->router = 'ComponentbuilderHelperRoute::getLanguageRoute'; - $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $language_Inserted = $db->insertObject('#__content_types', $language); // Create the server content type object. - $server = new stdClass(); + $server = new \stdClass(); $server->type_title = 'Componentbuilder Server'; $server->type_alias = 'com_componentbuilder.server'; $server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","signature":"signature","private_key":"private_key","secret":"secret","password":"password","private":"private","authentication":"authentication","path":"path","port":"port","host":"host","username":"username"}}'; $server->router = 'ComponentbuilderHelperRoute::getServerRoute'; - $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","protocol","authentication"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $server_Inserted = $db->insertObject('#__content_types', $server); // Create the help_document content type object. - $help_document = new stdClass(); + $help_document = new \stdClass(); $help_document->type_title = 'Componentbuilder Help_document'; $help_document->type_alias = 'com_componentbuilder.help_document'; $help_document->table = '{"special": {"dbtable": "#__componentbuilder_help_document","key": "id","type": "Help_document","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","content":"content","article":"article","url":"url","target":"target","alias":"alias"}}'; $help_document->router = 'ComponentbuilderHelperRoute::getHelp_documentRoute'; - $help_document->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","not_required","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; + $help_document->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","type","location","not_required","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; // Set the object into the content types table. $help_document_Inserted = $db->insertObject('#__content_types', $help_document); // Create the admin_fields content type object. - $admin_fields = new stdClass(); + $admin_fields = new \stdClass(); $admin_fields->type_title = 'Componentbuilder Admin_fields'; $admin_fields->type_alias = 'com_componentbuilder.admin_fields'; $admin_fields->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields","key": "id","type": "Admin_fields","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields->router = 'ComponentbuilderHelperRoute::getAdmin_fieldsRoute'; - $admin_fields->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $admin_fields_Inserted = $db->insertObject('#__content_types', $admin_fields); // Create the admin_fields_conditions content type object. - $admin_fields_conditions = new stdClass(); + $admin_fields_conditions = new \stdClass(); $admin_fields_conditions->type_title = 'Componentbuilder Admin_fields_conditions'; $admin_fields_conditions->type_alias = 'com_componentbuilder.admin_fields_conditions'; $admin_fields_conditions->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_conditions","key": "id","type": "Admin_fields_conditions","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields_conditions->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields_conditions->router = 'ComponentbuilderHelperRoute::getAdmin_fields_conditionsRoute'; - $admin_fields_conditions->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields_conditions->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $admin_fields_conditions_Inserted = $db->insertObject('#__content_types', $admin_fields_conditions); // Create the admin_fields_relations content type object. - $admin_fields_relations = new stdClass(); + $admin_fields_relations = new \stdClass(); $admin_fields_relations->type_title = 'Componentbuilder Admin_fields_relations'; $admin_fields_relations->type_alias = 'com_componentbuilder.admin_fields_relations'; $admin_fields_relations->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_relations","key": "id","type": "Admin_fields_relations","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields_relations->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields_relations->router = 'ComponentbuilderHelperRoute::getAdmin_fields_relationsRoute'; - $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $admin_fields_relations_Inserted = $db->insertObject('#__content_types', $admin_fields_relations); // Create the admin_custom_tabs content type object. - $admin_custom_tabs = new stdClass(); + $admin_custom_tabs = new \stdClass(); $admin_custom_tabs->type_title = 'Componentbuilder Admin_custom_tabs'; $admin_custom_tabs->type_alias = 'com_componentbuilder.admin_custom_tabs'; $admin_custom_tabs->table = '{"special": {"dbtable": "#__componentbuilder_admin_custom_tabs","key": "id","type": "Admin_custom_tabs","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_custom_tabs->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_custom_tabs->router = 'ComponentbuilderHelperRoute::getAdmin_custom_tabsRoute'; - $admin_custom_tabs->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_custom_tabs->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $admin_custom_tabs_Inserted = $db->insertObject('#__content_types', $admin_custom_tabs); // Create the component_admin_views content type object. - $component_admin_views = new stdClass(); + $component_admin_views = new \stdClass(); $component_admin_views->type_title = 'Componentbuilder Component_admin_views'; $component_admin_views->type_alias = 'com_componentbuilder.component_admin_views'; $component_admin_views->table = '{"special": {"dbtable": "#__componentbuilder_component_admin_views","key": "id","type": "Component_admin_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_admin_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_admin_views->router = 'ComponentbuilderHelperRoute::getComponent_admin_viewsRoute'; - $component_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_admin_views_Inserted = $db->insertObject('#__content_types', $component_admin_views); // Create the component_site_views content type object. - $component_site_views = new stdClass(); + $component_site_views = new \stdClass(); $component_site_views->type_title = 'Componentbuilder Component_site_views'; $component_site_views->type_alias = 'com_componentbuilder.component_site_views'; $component_site_views->table = '{"special": {"dbtable": "#__componentbuilder_component_site_views","key": "id","type": "Component_site_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_site_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_site_views->router = 'ComponentbuilderHelperRoute::getComponent_site_viewsRoute'; - $component_site_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_site_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_site_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_site_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_site_views_Inserted = $db->insertObject('#__content_types', $component_site_views); // Create the component_custom_admin_views content type object. - $component_custom_admin_views = new stdClass(); + $component_custom_admin_views = new \stdClass(); $component_custom_admin_views->type_title = 'Componentbuilder Component_custom_admin_views'; $component_custom_admin_views->type_alias = 'com_componentbuilder.component_custom_admin_views'; $component_custom_admin_views->table = '{"special": {"dbtable": "#__componentbuilder_component_custom_admin_views","key": "id","type": "Component_custom_admin_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_custom_admin_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_custom_admin_views->router = 'ComponentbuilderHelperRoute::getComponent_custom_admin_viewsRoute'; - $component_custom_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_custom_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_custom_admin_views_Inserted = $db->insertObject('#__content_types', $component_custom_admin_views); // Create the component_updates content type object. - $component_updates = new stdClass(); + $component_updates = new \stdClass(); $component_updates->type_title = 'Componentbuilder Component_updates'; $component_updates->type_alias = 'com_componentbuilder.component_updates'; $component_updates->table = '{"special": {"dbtable": "#__componentbuilder_component_updates","key": "id","type": "Component_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_updates->router = 'ComponentbuilderHelperRoute::getComponent_updatesRoute'; - $component_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_updates_Inserted = $db->insertObject('#__content_types', $component_updates); // Create the component_mysql_tweaks content type object. - $component_mysql_tweaks = new stdClass(); + $component_mysql_tweaks = new \stdClass(); $component_mysql_tweaks->type_title = 'Componentbuilder Component_mysql_tweaks'; $component_mysql_tweaks->type_alias = 'com_componentbuilder.component_mysql_tweaks'; $component_mysql_tweaks->table = '{"special": {"dbtable": "#__componentbuilder_component_mysql_tweaks","key": "id","type": "Component_mysql_tweaks","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_mysql_tweaks->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_mysql_tweaks->router = 'ComponentbuilderHelperRoute::getComponent_mysql_tweaksRoute'; - $component_mysql_tweaks->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_mysql_tweaks->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_mysql_tweaks_Inserted = $db->insertObject('#__content_types', $component_mysql_tweaks); // Create the component_custom_admin_menus content type object. - $component_custom_admin_menus = new stdClass(); + $component_custom_admin_menus = new \stdClass(); $component_custom_admin_menus->type_title = 'Componentbuilder Component_custom_admin_menus'; $component_custom_admin_menus->type_alias = 'com_componentbuilder.component_custom_admin_menus'; $component_custom_admin_menus->table = '{"special": {"dbtable": "#__componentbuilder_component_custom_admin_menus","key": "id","type": "Component_custom_admin_menus","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_custom_admin_menus->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_custom_admin_menus->router = 'ComponentbuilderHelperRoute::getComponent_custom_admin_menusRoute'; - $component_custom_admin_menus->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_custom_admin_menus->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_custom_admin_menus_Inserted = $db->insertObject('#__content_types', $component_custom_admin_menus); + // Create the component_router content type object. + $component_router = new \stdClass(); + $component_router->type_title = 'Componentbuilder Component_router'; + $component_router->type_alias = 'com_componentbuilder.component_router'; + $component_router->table = '{"special": {"dbtable": "#__componentbuilder_component_router","key": "id","type": "Component_router","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $component_router->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "methods_code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component","mode_constructor_before_parent":"mode_constructor_before_parent","mode_constructor_after_parent":"mode_constructor_after_parent","mode_methods":"mode_methods","methods_code":"methods_code","constructor_after_parent_code":"constructor_after_parent_code","constructor_before_parent_code":"constructor_before_parent_code"}}'; + $component_router->router = 'ComponentbuilderHelperRoute::getComponent_routerRoute'; + $component_router->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_router.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component","mode_constructor_before_parent","mode_constructor_after_parent","mode_methods"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + + // Set the object into the content types table. + $component_router_Inserted = $db->insertObject('#__content_types', $component_router); + // Create the component_config content type object. - $component_config = new stdClass(); + $component_config = new \stdClass(); $component_config->type_title = 'Componentbuilder Component_config'; $component_config->type_alias = 'com_componentbuilder.component_config'; $component_config->table = '{"special": {"dbtable": "#__componentbuilder_component_config","key": "id","type": "Component_config","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_config->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_config->router = 'ComponentbuilderHelperRoute::getComponent_configRoute'; - $component_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_config_Inserted = $db->insertObject('#__content_types', $component_config); // Create the component_dashboard content type object. - $component_dashboard = new stdClass(); + $component_dashboard = new \stdClass(); $component_dashboard->type_title = 'Componentbuilder Component_dashboard'; $component_dashboard->type_alias = 'com_componentbuilder.component_dashboard'; $component_dashboard->table = '{"special": {"dbtable": "#__componentbuilder_component_dashboard","key": "id","type": "Component_dashboard","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_dashboard->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component","php_dashboard_methods":"php_dashboard_methods"}}'; $component_dashboard->router = 'ComponentbuilderHelperRoute::getComponent_dashboardRoute'; - $component_dashboard->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_dashboard.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_dashboard->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_dashboard.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_dashboard_Inserted = $db->insertObject('#__content_types', $component_dashboard); // Create the component_files_folders content type object. - $component_files_folders = new stdClass(); + $component_files_folders = new \stdClass(); $component_files_folders->type_title = 'Componentbuilder Component_files_folders'; $component_files_folders->type_alias = 'com_componentbuilder.component_files_folders'; $component_files_folders->table = '{"special": {"dbtable": "#__componentbuilder_component_files_folders","key": "id","type": "Component_files_folders","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_files_folders->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_files_folders->router = 'ComponentbuilderHelperRoute::getComponent_files_foldersRoute'; - $component_files_folders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_files_folders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_files_folders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_files_folders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_files_folders_Inserted = $db->insertObject('#__content_types', $component_files_folders); // Create the component_placeholders content type object. - $component_placeholders = new stdClass(); + $component_placeholders = new \stdClass(); $component_placeholders->type_title = 'Componentbuilder Component_placeholders'; $component_placeholders->type_alias = 'com_componentbuilder.component_placeholders'; $component_placeholders->table = '{"special": {"dbtable": "#__componentbuilder_component_placeholders","key": "id","type": "Component_placeholders","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_placeholders->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_placeholders->router = 'ComponentbuilderHelperRoute::getComponent_placeholdersRoute'; - $component_placeholders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_placeholders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_placeholders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_placeholders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_placeholders_Inserted = $db->insertObject('#__content_types', $component_placeholders); // Create the component_plugins content type object. - $component_plugins = new stdClass(); + $component_plugins = new \stdClass(); $component_plugins->type_title = 'Componentbuilder Component_plugins'; $component_plugins->type_alias = 'com_componentbuilder.component_plugins'; $component_plugins->table = '{"special": {"dbtable": "#__componentbuilder_component_plugins","key": "id","type": "Component_plugins","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_plugins->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_plugins->router = 'ComponentbuilderHelperRoute::getComponent_pluginsRoute'; - $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_plugins_Inserted = $db->insertObject('#__content_types', $component_plugins); // Create the component_modules content type object. - $component_modules = new stdClass(); + $component_modules = new \stdClass(); $component_modules->type_title = 'Componentbuilder Component_modules'; $component_modules->type_alias = 'com_componentbuilder.component_modules'; $component_modules->table = '{"special": {"dbtable": "#__componentbuilder_component_modules","key": "id","type": "Component_modules","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_modules->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_modules->router = 'ComponentbuilderHelperRoute::getComponent_modulesRoute'; - $component_modules->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_modules.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_modules->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_modules.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_modules_Inserted = $db->insertObject('#__content_types', $component_modules); // Create the snippet_type content type object. - $snippet_type = new stdClass(); + $snippet_type = new \stdClass(); $snippet_type->type_title = 'Componentbuilder Snippet_type'; $snippet_type->type_alias = 'com_componentbuilder.snippet_type'; $snippet_type->table = '{"special": {"dbtable": "#__componentbuilder_snippet_type","key": "id","type": "Snippet_type","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $snippet_type->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description"}}'; $snippet_type->router = 'ComponentbuilderHelperRoute::getSnippet_typeRoute'; - $snippet_type->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet_type.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $snippet_type->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet_type.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $snippet_type_Inserted = $db->insertObject('#__content_types', $snippet_type); // Create the library_config content type object. - $library_config = new stdClass(); + $library_config = new \stdClass(); $library_config->type_title = 'Componentbuilder Library_config'; $library_config->type_alias = 'com_componentbuilder.library_config'; $library_config->table = '{"special": {"dbtable": "#__componentbuilder_library_config","key": "id","type": "Library_config","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library_config->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "library","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"library":"library"}}'; $library_config->router = 'ComponentbuilderHelperRoute::getLibrary_configRoute'; - $library_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $library_config_Inserted = $db->insertObject('#__content_types', $library_config); // Create the library_files_folders_urls content type object. - $library_files_folders_urls = new stdClass(); + $library_files_folders_urls = new \stdClass(); $library_files_folders_urls->type_title = 'Componentbuilder Library_files_folders_urls'; $library_files_folders_urls->type_alias = 'com_componentbuilder.library_files_folders_urls'; $library_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_library_files_folders_urls","key": "id","type": "Library_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "library","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"library":"library"}}'; $library_files_folders_urls->router = 'ComponentbuilderHelperRoute::getLibrary_files_folders_urlsRoute'; - $library_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $library_files_folders_urls_Inserted = $db->insertObject('#__content_types', $library_files_folders_urls); // Create the class_extends content type object. - $class_extends = new stdClass(); + $class_extends = new \stdClass(); $class_extends->type_title = 'Componentbuilder Class_extends'; $class_extends->type_alias = 'com_componentbuilder.class_extends'; $class_extends->table = '{"special": {"dbtable": "#__componentbuilder_class_extends","key": "id","type": "Class_extends","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_extends->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","extension_type":"extension_type","head":"head","comment":"comment"}}'; $class_extends->router = 'ComponentbuilderHelperRoute::getClass_extendsRoute'; - $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $class_extends_Inserted = $db->insertObject('#__content_types', $class_extends); // Create the joomla_module_updates content type object. - $joomla_module_updates = new stdClass(); + $joomla_module_updates = new \stdClass(); $joomla_module_updates->type_title = 'Componentbuilder Joomla_module_updates'; $joomla_module_updates->type_alias = 'com_componentbuilder.joomla_module_updates'; $joomla_module_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module_updates","key": "id","type": "Joomla_module_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_module","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_module":"joomla_module"}}'; $joomla_module_updates->router = 'ComponentbuilderHelperRoute::getJoomla_module_updatesRoute'; - $joomla_module_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_module_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $joomla_module_updates_Inserted = $db->insertObject('#__content_types', $joomla_module_updates); // Create the joomla_module_files_folders_urls content type object. - $joomla_module_files_folders_urls = new stdClass(); + $joomla_module_files_folders_urls = new \stdClass(); $joomla_module_files_folders_urls->type_title = 'Componentbuilder Joomla_module_files_folders_urls'; $joomla_module_files_folders_urls->type_alias = 'com_componentbuilder.joomla_module_files_folders_urls'; $joomla_module_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module_files_folders_urls","key": "id","type": "Joomla_module_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_module","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_module":"joomla_module"}}'; $joomla_module_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_module_files_folders_urlsRoute'; - $joomla_module_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_module_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $joomla_module_files_folders_urls_Inserted = $db->insertObject('#__content_types', $joomla_module_files_folders_urls); // Create the joomla_plugin_group content type object. - $joomla_plugin_group = new stdClass(); + $joomla_plugin_group = new \stdClass(); $joomla_plugin_group->type_title = 'Componentbuilder Joomla_plugin_group'; $joomla_plugin_group->type_alias = 'com_componentbuilder.joomla_plugin_group'; $joomla_plugin_group->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_group","key": "id","type": "Joomla_plugin_group","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_group->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","class_extends":"class_extends"}}'; $joomla_plugin_group->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_groupRoute'; - $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_plugin_group_Inserted = $db->insertObject('#__content_types', $joomla_plugin_group); // Create the joomla_plugin_updates content type object. - $joomla_plugin_updates = new stdClass(); + $joomla_plugin_updates = new \stdClass(); $joomla_plugin_updates->type_title = 'Componentbuilder Joomla_plugin_updates'; $joomla_plugin_updates->type_alias = 'com_componentbuilder.joomla_plugin_updates'; $joomla_plugin_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_updates","key": "id","type": "Joomla_plugin_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}'; $joomla_plugin_updates->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_updatesRoute'; - $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $joomla_plugin_updates_Inserted = $db->insertObject('#__content_types', $joomla_plugin_updates); // Create the joomla_plugin_files_folders_urls content type object. - $joomla_plugin_files_folders_urls = new stdClass(); + $joomla_plugin_files_folders_urls = new \stdClass(); $joomla_plugin_files_folders_urls->type_title = 'Componentbuilder Joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_files_folders_urls","key": "id","type": "Joomla_plugin_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}'; $joomla_plugin_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_files_folders_urlsRoute'; - $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $joomla_plugin_files_folders_urls_Inserted = $db->insertObject('#__content_types', $joomla_plugin_files_folders_urls); + // Get the biggest rule column in the assets table at this point. + $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $db->setQuery($get_rule_length); + if ($db->execute()) + { + $rule_length = $db->loadResult(); + // Check the size of the rules column + if ($rule_length <= 99360) + { + // 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';"; + $db->setQuery($fix_rules_size); + $db->execute(); + $app->enqueueMessage(Text::_('The #__assets table rules column was resized to the MEDIUMTEXT datatype for the components possible large permission rules.')); + } + } // Install the global extension params. + $db = Factory::getDbo(); $query = $db->getQuery(true); // Field to update. $fields = array( - $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","super_powers_documentation":"0","powers_repository":"0","super_powers_repositories":"0","approved_paths":"default","add_custom_gitea_url":"1","custom_gitea_url":"https://git.vdm.dev","super_powers_core_organisation":"joomla","super_powers_core":"joomla/super-powers","builder_gif_size":"480-272","compiler_plugin":["componentbuilderactionlogcompiler","componentbuilderfieldorderingcompiler","componentbuilderheaderscompiler","componentbuilderpowersautoloadercompiler","componentbuilderprivacycompiler"],"add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":"","uikit_style":""}'), + $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","super_powers_documentation":"0","powers_repository":"0","super_powers_repositories":"0","approved_paths":"default","add_custom_gitea_url":"1","custom_gitea_url":"https://git.vdm.dev","super_powers_core_organisation":"joomla","super_powers_core":"joomla/super-powers","builder_gif_size":"480-272","compiler_plugin":["componentbuilderactionlogcompiler","componentbuilderfieldorderingcompiler","componentbuilderheaderscompiler","componentbuilderpowersautoloadercompiler","componentbuilderprivacycompiler"],"add_menu_prefix":"1","menu_prefix":"»","namespace_prefix":"JCB","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":"","uikit_style":""}'), ); // Condition. $conditions = array( @@ -6756,33 +6900,18 @@ class com_componentbuilderInstallerScript $db->setQuery($query); $allDone = $db->execute(); - // Get the biggest rule column in the assets table at this point. - $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; - $db->setQuery($get_rule_length); - if ($db->execute()) - { - $rule_length = $db->loadResult(); - // Check the size of the rules column - if ($rule_length <= 97600) - { - // 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';"; - $db->setQuery($fix_rules_size); - $db->execute(); - $app->enqueueMessage(JText::_('The #__assets table rules column was resized to the MEDIUMTEXT datatype for the components possible large permission rules.')); - } - } - echo '
+ + echo '
- '; +
'; // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the componentbuilder action logs extensions object. - $componentbuilder_action_logs_extensions = new stdClass(); + $componentbuilder_action_logs_extensions = new \stdClass(); $componentbuilder_action_logs_extensions->extension = 'com_componentbuilder'; // Set the object into the action logs extensions table. @@ -6791,10 +6920,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_component action log config object. - $joomla_component_action_log_config = new stdClass(); + $joomla_component_action_log_config = new \stdClass(); $joomla_component_action_log_config->type_title = 'JOOMLA_COMPONENT'; $joomla_component_action_log_config->type_alias = 'com_componentbuilder.joomla_component'; $joomla_component_action_log_config->id_holder = 'id'; @@ -6808,10 +6937,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module action log config object. - $joomla_module_action_log_config = new stdClass(); + $joomla_module_action_log_config = new \stdClass(); $joomla_module_action_log_config->type_title = 'JOOMLA_MODULE'; $joomla_module_action_log_config->type_alias = 'com_componentbuilder.joomla_module'; $joomla_module_action_log_config->id_holder = 'id'; @@ -6825,10 +6954,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin action log config object. - $joomla_plugin_action_log_config = new stdClass(); + $joomla_plugin_action_log_config = new \stdClass(); $joomla_plugin_action_log_config->type_title = 'JOOMLA_PLUGIN'; $joomla_plugin_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin'; $joomla_plugin_action_log_config->id_holder = 'id'; @@ -6842,10 +6971,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the power action log config object. - $power_action_log_config = new stdClass(); + $power_action_log_config = new \stdClass(); $power_action_log_config->type_title = 'POWER'; $power_action_log_config->type_alias = 'com_componentbuilder.power'; $power_action_log_config->id_holder = 'id'; @@ -6859,10 +6988,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_view action log config object. - $admin_view_action_log_config = new stdClass(); + $admin_view_action_log_config = new \stdClass(); $admin_view_action_log_config->type_title = 'ADMIN_VIEW'; $admin_view_action_log_config->type_alias = 'com_componentbuilder.admin_view'; $admin_view_action_log_config->id_holder = 'id'; @@ -6876,10 +7005,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the custom_admin_view action log config object. - $custom_admin_view_action_log_config = new stdClass(); + $custom_admin_view_action_log_config = new \stdClass(); $custom_admin_view_action_log_config->type_title = 'CUSTOM_ADMIN_VIEW'; $custom_admin_view_action_log_config->type_alias = 'com_componentbuilder.custom_admin_view'; $custom_admin_view_action_log_config->id_holder = 'id'; @@ -6893,10 +7022,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the site_view action log config object. - $site_view_action_log_config = new stdClass(); + $site_view_action_log_config = new \stdClass(); $site_view_action_log_config->type_title = 'SITE_VIEW'; $site_view_action_log_config->type_alias = 'com_componentbuilder.site_view'; $site_view_action_log_config->id_holder = 'id'; @@ -6910,10 +7039,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the template action log config object. - $template_action_log_config = new stdClass(); + $template_action_log_config = new \stdClass(); $template_action_log_config->type_title = 'TEMPLATE'; $template_action_log_config->type_alias = 'com_componentbuilder.template'; $template_action_log_config->id_holder = 'id'; @@ -6927,10 +7056,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the layout action log config object. - $layout_action_log_config = new stdClass(); + $layout_action_log_config = new \stdClass(); $layout_action_log_config->type_title = 'LAYOUT'; $layout_action_log_config->type_alias = 'com_componentbuilder.layout'; $layout_action_log_config->id_holder = 'id'; @@ -6944,10 +7073,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the dynamic_get action log config object. - $dynamic_get_action_log_config = new stdClass(); + $dynamic_get_action_log_config = new \stdClass(); $dynamic_get_action_log_config->type_title = 'DYNAMIC_GET'; $dynamic_get_action_log_config->type_alias = 'com_componentbuilder.dynamic_get'; $dynamic_get_action_log_config->id_holder = 'id'; @@ -6961,10 +7090,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the custom_code action log config object. - $custom_code_action_log_config = new stdClass(); + $custom_code_action_log_config = new \stdClass(); $custom_code_action_log_config->type_title = 'CUSTOM_CODE'; $custom_code_action_log_config->type_alias = 'com_componentbuilder.custom_code'; $custom_code_action_log_config->id_holder = 'id'; @@ -6978,10 +7107,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_property action log config object. - $class_property_action_log_config = new stdClass(); + $class_property_action_log_config = new \stdClass(); $class_property_action_log_config->type_title = 'CLASS_PROPERTY'; $class_property_action_log_config->type_alias = 'com_componentbuilder.class_property'; $class_property_action_log_config->id_holder = 'id'; @@ -6995,10 +7124,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_method action log config object. - $class_method_action_log_config = new stdClass(); + $class_method_action_log_config = new \stdClass(); $class_method_action_log_config->type_title = 'CLASS_METHOD'; $class_method_action_log_config->type_alias = 'com_componentbuilder.class_method'; $class_method_action_log_config->id_holder = 'id'; @@ -7012,10 +7141,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the placeholder action log config object. - $placeholder_action_log_config = new stdClass(); + $placeholder_action_log_config = new \stdClass(); $placeholder_action_log_config->type_title = 'PLACEHOLDER'; $placeholder_action_log_config->type_alias = 'com_componentbuilder.placeholder'; $placeholder_action_log_config->id_holder = 'id'; @@ -7029,10 +7158,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library action log config object. - $library_action_log_config = new stdClass(); + $library_action_log_config = new \stdClass(); $library_action_log_config->type_title = 'LIBRARY'; $library_action_log_config->type_alias = 'com_componentbuilder.library'; $library_action_log_config->id_holder = 'id'; @@ -7046,10 +7175,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the snippet action log config object. - $snippet_action_log_config = new stdClass(); + $snippet_action_log_config = new \stdClass(); $snippet_action_log_config->type_title = 'SNIPPET'; $snippet_action_log_config->type_alias = 'com_componentbuilder.snippet'; $snippet_action_log_config->id_holder = 'id'; @@ -7063,10 +7192,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the validation_rule action log config object. - $validation_rule_action_log_config = new stdClass(); + $validation_rule_action_log_config = new \stdClass(); $validation_rule_action_log_config->type_title = 'VALIDATION_RULE'; $validation_rule_action_log_config->type_alias = 'com_componentbuilder.validation_rule'; $validation_rule_action_log_config->id_holder = 'id'; @@ -7080,10 +7209,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the field action log config object. - $field_action_log_config = new stdClass(); + $field_action_log_config = new \stdClass(); $field_action_log_config->type_title = 'FIELD'; $field_action_log_config->type_alias = 'com_componentbuilder.field'; $field_action_log_config->id_holder = 'id'; @@ -7097,10 +7226,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the fieldtype action log config object. - $fieldtype_action_log_config = new stdClass(); + $fieldtype_action_log_config = new \stdClass(); $fieldtype_action_log_config->type_title = 'FIELDTYPE'; $fieldtype_action_log_config->type_alias = 'com_componentbuilder.fieldtype'; $fieldtype_action_log_config->id_holder = 'id'; @@ -7114,10 +7243,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the language_translation action log config object. - $language_translation_action_log_config = new stdClass(); + $language_translation_action_log_config = new \stdClass(); $language_translation_action_log_config->type_title = 'LANGUAGE_TRANSLATION'; $language_translation_action_log_config->type_alias = 'com_componentbuilder.language_translation'; $language_translation_action_log_config->id_holder = 'id'; @@ -7131,10 +7260,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the language action log config object. - $language_action_log_config = new stdClass(); + $language_action_log_config = new \stdClass(); $language_action_log_config->type_title = 'LANGUAGE'; $language_action_log_config->type_alias = 'com_componentbuilder.language'; $language_action_log_config->id_holder = 'id'; @@ -7148,10 +7277,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the server action log config object. - $server_action_log_config = new stdClass(); + $server_action_log_config = new \stdClass(); $server_action_log_config->type_title = 'SERVER'; $server_action_log_config->type_alias = 'com_componentbuilder.server'; $server_action_log_config->id_holder = 'id'; @@ -7165,10 +7294,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the help_document action log config object. - $help_document_action_log_config = new stdClass(); + $help_document_action_log_config = new \stdClass(); $help_document_action_log_config->type_title = 'HELP_DOCUMENT'; $help_document_action_log_config->type_alias = 'com_componentbuilder.help_document'; $help_document_action_log_config->id_holder = 'id'; @@ -7182,10 +7311,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields action log config object. - $admin_fields_action_log_config = new stdClass(); + $admin_fields_action_log_config = new \stdClass(); $admin_fields_action_log_config->type_title = 'ADMIN_FIELDS'; $admin_fields_action_log_config->type_alias = 'com_componentbuilder.admin_fields'; $admin_fields_action_log_config->id_holder = 'id'; @@ -7199,10 +7328,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields_conditions action log config object. - $admin_fields_conditions_action_log_config = new stdClass(); + $admin_fields_conditions_action_log_config = new \stdClass(); $admin_fields_conditions_action_log_config->type_title = 'ADMIN_FIELDS_CONDITIONS'; $admin_fields_conditions_action_log_config->type_alias = 'com_componentbuilder.admin_fields_conditions'; $admin_fields_conditions_action_log_config->id_holder = 'id'; @@ -7216,10 +7345,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields_relations action log config object. - $admin_fields_relations_action_log_config = new stdClass(); + $admin_fields_relations_action_log_config = new \stdClass(); $admin_fields_relations_action_log_config->type_title = 'ADMIN_FIELDS_RELATIONS'; $admin_fields_relations_action_log_config->type_alias = 'com_componentbuilder.admin_fields_relations'; $admin_fields_relations_action_log_config->id_holder = 'id'; @@ -7233,10 +7362,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_custom_tabs action log config object. - $admin_custom_tabs_action_log_config = new stdClass(); + $admin_custom_tabs_action_log_config = new \stdClass(); $admin_custom_tabs_action_log_config->type_title = 'ADMIN_CUSTOM_TABS'; $admin_custom_tabs_action_log_config->type_alias = 'com_componentbuilder.admin_custom_tabs'; $admin_custom_tabs_action_log_config->id_holder = 'id'; @@ -7250,10 +7379,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_admin_views action log config object. - $component_admin_views_action_log_config = new stdClass(); + $component_admin_views_action_log_config = new \stdClass(); $component_admin_views_action_log_config->type_title = 'COMPONENT_ADMIN_VIEWS'; $component_admin_views_action_log_config->type_alias = 'com_componentbuilder.component_admin_views'; $component_admin_views_action_log_config->id_holder = 'id'; @@ -7267,10 +7396,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_site_views action log config object. - $component_site_views_action_log_config = new stdClass(); + $component_site_views_action_log_config = new \stdClass(); $component_site_views_action_log_config->type_title = 'COMPONENT_SITE_VIEWS'; $component_site_views_action_log_config->type_alias = 'com_componentbuilder.component_site_views'; $component_site_views_action_log_config->id_holder = 'id'; @@ -7284,10 +7413,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_custom_admin_views action log config object. - $component_custom_admin_views_action_log_config = new stdClass(); + $component_custom_admin_views_action_log_config = new \stdClass(); $component_custom_admin_views_action_log_config->type_title = 'COMPONENT_CUSTOM_ADMIN_VIEWS'; $component_custom_admin_views_action_log_config->type_alias = 'com_componentbuilder.component_custom_admin_views'; $component_custom_admin_views_action_log_config->id_holder = 'id'; @@ -7301,10 +7430,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_updates action log config object. - $component_updates_action_log_config = new stdClass(); + $component_updates_action_log_config = new \stdClass(); $component_updates_action_log_config->type_title = 'COMPONENT_UPDATES'; $component_updates_action_log_config->type_alias = 'com_componentbuilder.component_updates'; $component_updates_action_log_config->id_holder = 'id'; @@ -7318,10 +7447,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_mysql_tweaks action log config object. - $component_mysql_tweaks_action_log_config = new stdClass(); + $component_mysql_tweaks_action_log_config = new \stdClass(); $component_mysql_tweaks_action_log_config->type_title = 'COMPONENT_MYSQL_TWEAKS'; $component_mysql_tweaks_action_log_config->type_alias = 'com_componentbuilder.component_mysql_tweaks'; $component_mysql_tweaks_action_log_config->id_holder = 'id'; @@ -7335,10 +7464,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_custom_admin_menus action log config object. - $component_custom_admin_menus_action_log_config = new stdClass(); + $component_custom_admin_menus_action_log_config = new \stdClass(); $component_custom_admin_menus_action_log_config->type_title = 'COMPONENT_CUSTOM_ADMIN_MENUS'; $component_custom_admin_menus_action_log_config->type_alias = 'com_componentbuilder.component_custom_admin_menus'; $component_custom_admin_menus_action_log_config->id_holder = 'id'; @@ -7352,10 +7481,27 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); + } + // Create the component_router action log config object. + $component_router_action_log_config = new \stdClass(); + $component_router_action_log_config->type_title = 'COMPONENT_ROUTER'; + $component_router_action_log_config->type_alias = 'com_componentbuilder.component_router'; + $component_router_action_log_config->id_holder = 'id'; + $component_router_action_log_config->title_holder = 'joomla_component'; + $component_router_action_log_config->table_name = '#__componentbuilder_component_router'; + $component_router_action_log_config->text_prefix = 'COM_COMPONENTBUILDER'; + + // Set the object into the action log config table. + $component_router_Inserted = $db->insertObject('#__action_log_config', $component_router_action_log_config); + + // Set db if not set already. + if (!isset($db)) + { + $db = Factory::getDbo(); } // Create the component_config action log config object. - $component_config_action_log_config = new stdClass(); + $component_config_action_log_config = new \stdClass(); $component_config_action_log_config->type_title = 'COMPONENT_CONFIG'; $component_config_action_log_config->type_alias = 'com_componentbuilder.component_config'; $component_config_action_log_config->id_holder = 'id'; @@ -7369,10 +7515,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_dashboard action log config object. - $component_dashboard_action_log_config = new stdClass(); + $component_dashboard_action_log_config = new \stdClass(); $component_dashboard_action_log_config->type_title = 'COMPONENT_DASHBOARD'; $component_dashboard_action_log_config->type_alias = 'com_componentbuilder.component_dashboard'; $component_dashboard_action_log_config->id_holder = 'id'; @@ -7386,10 +7532,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_files_folders action log config object. - $component_files_folders_action_log_config = new stdClass(); + $component_files_folders_action_log_config = new \stdClass(); $component_files_folders_action_log_config->type_title = 'COMPONENT_FILES_FOLDERS'; $component_files_folders_action_log_config->type_alias = 'com_componentbuilder.component_files_folders'; $component_files_folders_action_log_config->id_holder = 'id'; @@ -7403,10 +7549,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_placeholders action log config object. - $component_placeholders_action_log_config = new stdClass(); + $component_placeholders_action_log_config = new \stdClass(); $component_placeholders_action_log_config->type_title = 'COMPONENT_PLACEHOLDERS'; $component_placeholders_action_log_config->type_alias = 'com_componentbuilder.component_placeholders'; $component_placeholders_action_log_config->id_holder = 'id'; @@ -7420,10 +7566,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_plugins action log config object. - $component_plugins_action_log_config = new stdClass(); + $component_plugins_action_log_config = new \stdClass(); $component_plugins_action_log_config->type_title = 'COMPONENT_PLUGINS'; $component_plugins_action_log_config->type_alias = 'com_componentbuilder.component_plugins'; $component_plugins_action_log_config->id_holder = 'id'; @@ -7437,10 +7583,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_modules action log config object. - $component_modules_action_log_config = new stdClass(); + $component_modules_action_log_config = new \stdClass(); $component_modules_action_log_config->type_title = 'COMPONENT_MODULES'; $component_modules_action_log_config->type_alias = 'com_componentbuilder.component_modules'; $component_modules_action_log_config->id_holder = 'id'; @@ -7454,10 +7600,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the snippet_type action log config object. - $snippet_type_action_log_config = new stdClass(); + $snippet_type_action_log_config = new \stdClass(); $snippet_type_action_log_config->type_title = 'SNIPPET_TYPE'; $snippet_type_action_log_config->type_alias = 'com_componentbuilder.snippet_type'; $snippet_type_action_log_config->id_holder = 'id'; @@ -7471,10 +7617,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library_config action log config object. - $library_config_action_log_config = new stdClass(); + $library_config_action_log_config = new \stdClass(); $library_config_action_log_config->type_title = 'LIBRARY_CONFIG'; $library_config_action_log_config->type_alias = 'com_componentbuilder.library_config'; $library_config_action_log_config->id_holder = 'id'; @@ -7488,10 +7634,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library_files_folders_urls action log config object. - $library_files_folders_urls_action_log_config = new stdClass(); + $library_files_folders_urls_action_log_config = new \stdClass(); $library_files_folders_urls_action_log_config->type_title = 'LIBRARY_FILES_FOLDERS_URLS'; $library_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.library_files_folders_urls'; $library_files_folders_urls_action_log_config->id_holder = 'id'; @@ -7505,10 +7651,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_extends action log config object. - $class_extends_action_log_config = new stdClass(); + $class_extends_action_log_config = new \stdClass(); $class_extends_action_log_config->type_title = 'CLASS_EXTENDS'; $class_extends_action_log_config->type_alias = 'com_componentbuilder.class_extends'; $class_extends_action_log_config->id_holder = 'id'; @@ -7522,10 +7668,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module_updates action log config object. - $joomla_module_updates_action_log_config = new stdClass(); + $joomla_module_updates_action_log_config = new \stdClass(); $joomla_module_updates_action_log_config->type_title = 'JOOMLA_MODULE_UPDATES'; $joomla_module_updates_action_log_config->type_alias = 'com_componentbuilder.joomla_module_updates'; $joomla_module_updates_action_log_config->id_holder = 'id'; @@ -7539,10 +7685,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module_files_folders_urls action log config object. - $joomla_module_files_folders_urls_action_log_config = new stdClass(); + $joomla_module_files_folders_urls_action_log_config = new \stdClass(); $joomla_module_files_folders_urls_action_log_config->type_title = 'JOOMLA_MODULE_FILES_FOLDERS_URLS'; $joomla_module_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.joomla_module_files_folders_urls'; $joomla_module_files_folders_urls_action_log_config->id_holder = 'id'; @@ -7556,10 +7702,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_group action log config object. - $joomla_plugin_group_action_log_config = new stdClass(); + $joomla_plugin_group_action_log_config = new \stdClass(); $joomla_plugin_group_action_log_config->type_title = 'JOOMLA_PLUGIN_GROUP'; $joomla_plugin_group_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_group'; $joomla_plugin_group_action_log_config->id_holder = 'id'; @@ -7573,10 +7719,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_updates action log config object. - $joomla_plugin_updates_action_log_config = new stdClass(); + $joomla_plugin_updates_action_log_config = new \stdClass(); $joomla_plugin_updates_action_log_config->type_title = 'JOOMLA_PLUGIN_UPDATES'; $joomla_plugin_updates_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_updates'; $joomla_plugin_updates_action_log_config->id_holder = 'id'; @@ -7590,10 +7736,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_files_folders_urls action log config object. - $joomla_plugin_files_folders_urls_action_log_config = new stdClass(); + $joomla_plugin_files_folders_urls_action_log_config = new \stdClass(); $joomla_plugin_files_folders_urls_action_log_config->type_title = 'JOOMLA_PLUGIN_FILES_FOLDERS_URLS'; $joomla_plugin_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls_action_log_config->id_holder = 'id'; @@ -7609,16 +7755,16 @@ class com_componentbuilderInstallerScript { // Get The Database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create the joomla_component content type object. - $joomla_component = new stdClass(); + $joomla_component = new \stdClass(); $joomla_component->type_title = 'Componentbuilder Joomla_component'; $joomla_component->type_alias = 'com_componentbuilder.joomla_component'; $joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_admin","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","css_admin":"css_admin","php_admin_event":"php_admin_event","php_site_event":"php_site_event","crowdin_username":"crowdin_username","component_version":"component_version","php_postflight_install":"php_postflight_install","remove_line_breaks":"remove_line_breaks","description":"description","sql_uninstall":"sql_uninstall","debug_linenr":"debug_linenr","mvc_versiondate":"mvc_versiondate","php_preflight_install":"php_preflight_install","backup_folder_path":"backup_folder_path","php_method_uninstall":"php_method_uninstall","add_placeholders":"add_placeholders","author":"author","add_sales_server":"add_sales_server","email":"email","translation_tool":"translation_tool","website":"website","buildcompsql":"buildcompsql","add_license":"add_license","php_helper_admin":"php_helper_admin","license_type":"license_type","php_helper_site":"php_helper_site","javascript":"javascript","whmcs_key":"whmcs_key","css_site":"css_site","whmcs_url":"whmcs_url","whmcs_buy_link":"whmcs_buy_link","php_preflight_update":"php_preflight_update","license":"license","php_postflight_update":"php_postflight_update","bom":"bom","sql":"sql","image":"image","addreadme":"addreadme","copyright":"copyright","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_menu_prefix":"add_menu_prefix","add_css_admin":"add_css_admin","menu_prefix":"menu_prefix","add_css_site":"add_css_site","dashboard_type":"dashboard_type","dashboard":"dashboard","toignore":"toignore","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","export_key":"export_key","add_php_postflight_update":"add_php_postflight_update","joomla_source_link":"joomla_source_link","add_php_method_uninstall":"add_php_method_uninstall","export_buy_link":"export_buy_link","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","assets_table_fix":"assets_table_fix","readme":"readme","emptycontributors":"emptycontributors","add_update_server":"add_update_server","number":"number","update_server_target":"update_server_target","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","creatuserhelper":"creatuserhelper","adduikit":"adduikit","crowdin_project_api_key":"crowdin_project_api_key","addfootable":"addfootable","crowdin_account_api_key":"crowdin_account_api_key","add_email_helper":"add_email_helper","buildcomp":"buildcomp","add_php_helper_both":"add_php_helper_both","guid":"guid","php_helper_both":"php_helper_both","name":"name"}}'; + $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_site_event","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","debug_linenr":"debug_linenr","php_site_event":"php_site_event","translation_tool":"translation_tool","buildcompsql":"buildcompsql","add_sales_server":"add_sales_server","php_preflight_install":"php_preflight_install","php_method_uninstall":"php_method_uninstall","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","description":"description","php_postflight_install":"php_postflight_install","author":"author","sql_uninstall":"sql_uninstall","email":"email","website":"website","backup_folder_path":"backup_folder_path","php_helper_both":"php_helper_both","crowdin_username":"crowdin_username","php_admin_event":"php_admin_event","add_license":"add_license","component_version":"component_version","php_helper_admin":"php_helper_admin","license_type":"license_type","php_helper_site":"php_helper_site","javascript":"javascript","whmcs_key":"whmcs_key","css_site":"css_site","whmcs_url":"whmcs_url","whmcs_buy_link":"whmcs_buy_link","php_preflight_update":"php_preflight_update","license":"license","php_postflight_update":"php_postflight_update","bom":"bom","sql":"sql","image":"image","addreadme":"addreadme","copyright":"copyright","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_namespace_prefix":"add_namespace_prefix","add_javascript":"add_javascript","namespace_prefix":"namespace_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","add_menu_prefix":"add_menu_prefix","dashboard_type":"dashboard_type","menu_prefix":"menu_prefix","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","toignore":"toignore","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","export_key":"export_key","add_sql":"add_sql","joomla_source_link":"joomla_source_link","add_sql_uninstall":"add_sql_uninstall","export_buy_link":"export_buy_link","assets_table_fix":"assets_table_fix","readme":"readme","add_update_server":"add_update_server","update_server_target":"update_server_target","emptycontributors":"emptycontributors","number":"number","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","crowdin_project_api_key":"crowdin_project_api_key","creatuserhelper":"creatuserhelper","crowdin_account_api_key":"crowdin_account_api_key","adduikit":"adduikit","buildcomp":"buildcomp","addfootable":"addfootable","guid":"guid","add_email_helper":"add_email_helper","name":"name"}}'; $joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute'; - $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","remove_line_breaks","debug_linenr","mvc_versiondate","add_placeholders","add_sales_server","translation_tool","add_license","license_type","addreadme","add_powers","add_backup_folder_path","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","emptycontributors","add_update_server","number","update_server_target","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","addfootable","add_email_helper","buildcomp","add_php_helper_both"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","debug_linenr","translation_tool","add_sales_server","mvc_versiondate","remove_line_breaks","add_placeholders","add_license","license_type","addreadme","add_powers","add_backup_folder_path","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","add_update_server","update_server_target","emptycontributors","number","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","buildcomp","addfootable","add_email_helper"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_component type is already in content_type DB. $joomla_component_id = null; @@ -7641,13 +7787,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_module content type object. - $joomla_module = new stdClass(); + $joomla_module = new \stdClass(); $joomla_module->type_title = 'Componentbuilder Joomla_module'; $joomla_module->type_alias = 'com_componentbuilder.joomla_module'; $joomla_module->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module","key": "id","type": "Joomla_module","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "default","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","target":"target","description":"description","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","add_php_preflight_uninstall":"add_php_preflight_uninstall","addreadme":"addreadme","default":"default","snippet":"snippet","add_sql":"add_sql","update_server_target":"update_server_target","add_sql_uninstall":"add_sql_uninstall","update_server":"update_server","add_update_server":"add_update_server","libraries":"libraries","module_version":"module_version","sales_server":"sales_server","custom_get":"custom_get","php_preflight_update":"php_preflight_update","php_preflight_uninstall":"php_preflight_uninstall","mod_code":"mod_code","php_postflight_install":"php_postflight_install","add_class_helper":"add_class_helper","php_postflight_update":"php_postflight_update","add_class_helper_header":"add_class_helper_header","php_method_uninstall":"php_method_uninstall","class_helper_header":"class_helper_header","sql":"sql","class_helper_code":"class_helper_code","sql_uninstall":"sql_uninstall","readme":"readme","add_php_script_construct":"add_php_script_construct","update_server_url":"update_server_url","php_script_construct":"php_script_construct","add_php_preflight_install":"add_php_preflight_install","php_preflight_install":"php_preflight_install","add_sales_server":"add_sales_server","add_php_preflight_update":"add_php_preflight_update","guid":"guid","name":"name"}}'; $joomla_module->router = 'ComponentbuilderHelperRoute::getJoomla_moduleRoute'; - $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_module type is already in content_type DB. $joomla_module_id = null; @@ -7670,13 +7816,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_plugin content type object. - $joomla_plugin = new stdClass(); + $joomla_plugin = new \stdClass(); $joomla_plugin->type_title = 'Componentbuilder Joomla_plugin'; $joomla_plugin->type_alias = 'com_componentbuilder.joomla_plugin'; $joomla_plugin->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin","key": "id","type": "Joomla_plugin","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","class_extends":"class_extends","joomla_plugin_group":"joomla_plugin_group","add_sql":"add_sql","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","sales_server":"sales_server","add_update_server":"add_update_server","add_head":"add_head","add_sql_uninstall":"add_sql_uninstall","addreadme":"addreadme","head":"head","update_server_target":"update_server_target","main_class_code":"main_class_code","update_server":"update_server","description":"description","php_postflight_install":"php_postflight_install","plugin_version":"plugin_version","php_postflight_update":"php_postflight_update","php_method_uninstall":"php_method_uninstall","add_php_script_construct":"add_php_script_construct","sql":"sql","php_script_construct":"php_script_construct","sql_uninstall":"sql_uninstall","add_php_preflight_install":"add_php_preflight_install","readme":"readme","php_preflight_install":"php_preflight_install","update_server_url":"update_server_url","add_php_preflight_update":"add_php_preflight_update","php_preflight_update":"php_preflight_update","add_php_preflight_uninstall":"add_php_preflight_uninstall","add_sales_server":"add_sales_server","php_preflight_uninstall":"php_preflight_uninstall","guid":"guid","name":"name"}}'; $joomla_plugin->router = 'ComponentbuilderHelperRoute::getJoomla_pluginRoute'; - $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends","joomla_plugin_group","add_sql","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","sales_server","add_update_server","add_head","add_sql_uninstall","addreadme","update_server_target","update_server","add_php_script_construct","add_php_preflight_install","add_php_preflight_update","add_php_preflight_uninstall","add_sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","class_extends","joomla_plugin_group","add_sql","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","sales_server","add_update_server","add_head","add_sql_uninstall","addreadme","update_server_target","update_server","add_php_script_construct","add_php_preflight_install","add_php_preflight_update","add_php_preflight_uninstall","add_sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_plugin type is already in content_type DB. $joomla_plugin_id = null; @@ -7699,13 +7845,13 @@ class com_componentbuilderInstallerScript } // Create the power content type object. - $power = new stdClass(); + $power = new \stdClass(); $power->type_title = 'Componentbuilder Power'; $power->type_alias = 'com_componentbuilder.power'; $power->table = '{"special": {"dbtable": "#__componentbuilder_power","key": "id","type": "Power","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $power->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","namespace":"namespace","type":"type","power_version":"power_version","licensing_template":"licensing_template","description":"description","extends":"extends","approved":"approved","add_head":"add_head","extends_custom":"extends_custom","implements_custom":"implements_custom","implements":"implements","head":"head","approved_paths":"approved_paths","main_class_code":"main_class_code","add_licensing_template":"add_licensing_template","guid":"guid","name":"name"}}'; $power->router = 'ComponentbuilderHelperRoute::getPowerRoute'; - $power->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/power.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","approved","add_head","add_licensing_template"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "extends","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"},{"sourceColumn": "implements","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"}]}'; + $power->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/power.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","approved","add_head","add_licensing_template"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "extends","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"},{"sourceColumn": "implements","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"}]}'; // Check if power type is already in content_type DB. $power_id = null; @@ -7728,13 +7874,13 @@ class com_componentbuilderInstallerScript } // Create the admin_view content type object. - $admin_view = new stdClass(); + $admin_view = new \stdClass(); $admin_view->type_title = 'Componentbuilder Admin_view'; $admin_view->type_alias = 'com_componentbuilder.admin_view'; $admin_view->table = '{"special": {"dbtable": "#__componentbuilder_admin_view","key": "id","type": "Admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "null","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_allowedit","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_single":"name_single","short_description":"short_description","php_allowedit":"php_allowedit","php_postsavehook":"php_postsavehook","php_before_save":"php_before_save","php_getlistquery":"php_getlistquery","php_import_ext":"php_import_ext","icon":"icon","php_after_publish":"php_after_publish","add_fadein":"add_fadein","description":"description","icon_category":"icon_category","icon_add":"icon_add","php_after_cancel":"php_after_cancel","mysql_table_charset":"mysql_table_charset","php_batchmove":"php_batchmove","type":"type","php_after_delete":"php_after_delete","source":"source","php_import":"php_import","php_getitems_after_all":"php_getitems_after_all","php_getform":"php_getform","php_save":"php_save","php_allowadd":"php_allowadd","php_before_cancel":"php_before_cancel","php_batchcopy":"php_batchcopy","php_before_publish":"php_before_publish","alias_builder_type":"alias_builder_type","php_before_delete":"php_before_delete","php_document":"php_document","mysql_table_row_format":"mysql_table_row_format","alias_builder":"alias_builder","sql":"sql","php_import_display":"php_import_display","add_category_submenu":"add_category_submenu","php_import_setdata":"php_import_setdata","name_list":"name_list","add_php_getlistquery":"add_php_getlistquery","add_css_view":"add_css_view","add_php_getform":"add_php_getform","css_view":"css_view","add_php_before_save":"add_php_before_save","add_css_views":"add_css_views","add_php_save":"add_php_save","css_views":"css_views","add_php_postsavehook":"add_php_postsavehook","add_javascript_view_file":"add_javascript_view_file","add_php_allowadd":"add_php_allowadd","javascript_view_file":"javascript_view_file","add_php_allowedit":"add_php_allowedit","add_javascript_view_footer":"add_javascript_view_footer","add_php_before_cancel":"add_php_before_cancel","javascript_view_footer":"javascript_view_footer","add_php_after_cancel":"add_php_after_cancel","add_javascript_views_file":"add_javascript_views_file","add_php_batchcopy":"add_php_batchcopy","javascript_views_file":"javascript_views_file","add_php_batchmove":"add_php_batchmove","add_javascript_views_footer":"add_javascript_views_footer","add_php_before_publish":"add_php_before_publish","javascript_views_footer":"javascript_views_footer","add_php_after_publish":"add_php_after_publish","add_custom_button":"add_custom_button","add_php_before_delete":"add_php_before_delete","add_php_after_delete":"add_php_after_delete","php_controller":"php_controller","add_php_document":"add_php_document","php_model":"php_model","mysql_table_engine":"mysql_table_engine","php_controller_list":"php_controller_list","mysql_table_collate":"mysql_table_collate","php_model_list":"php_model_list","add_sql":"add_sql","add_php_ajax":"add_php_ajax","php_ajaxmethod":"php_ajaxmethod","add_custom_import":"add_custom_import","add_php_getitem":"add_php_getitem","html_import_view":"html_import_view","php_getitem":"php_getitem","php_import_headers":"php_import_headers","add_php_getitems":"add_php_getitems","php_import_save":"php_import_save","php_getitems":"php_getitems","guid":"guid","add_php_getitems_after_all":"add_php_getitems_after_all"}}'; $admin_view->router = 'ComponentbuilderHelperRoute::getAdmin_viewRoute'; - $admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add_fadein","type","source","add_category_submenu","add_php_getlistquery","add_css_view","add_php_getform","add_php_before_save","add_css_views","add_php_save","add_php_postsavehook","add_javascript_view_file","add_php_allowadd","add_php_allowedit","add_javascript_view_footer","add_php_before_cancel","add_php_after_cancel","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem","add_php_getitems","add_php_getitems_after_all"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "alias_builder","targetTable": "#__componentbuilder_field","targetColumn": "id","displayColumn": "name"}]}'; + $admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","add_fadein","type","source","add_category_submenu","add_php_getlistquery","add_css_view","add_php_getform","add_php_before_save","add_css_views","add_php_save","add_php_postsavehook","add_javascript_view_file","add_php_allowadd","add_php_allowedit","add_javascript_view_footer","add_php_before_cancel","add_php_after_cancel","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem","add_php_getitems","add_php_getitems_after_all"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "alias_builder","targetTable": "#__componentbuilder_field","targetColumn": "id","displayColumn": "name"}]}'; // Check if admin_view type is already in content_type DB. $admin_view_id = null; @@ -7757,13 +7903,13 @@ class com_componentbuilderInstallerScript } // Create the custom_admin_view content type object. - $custom_admin_view = new stdClass(); + $custom_admin_view = new \stdClass(); $custom_admin_view->type_title = 'Componentbuilder Custom_admin_view'; $custom_admin_view->type_alias = 'com_componentbuilder.custom_admin_view'; $custom_admin_view->table = '{"special": {"dbtable": "#__componentbuilder_custom_admin_view","key": "id","type": "Custom_admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $custom_admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_document","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","css_document":"css_document","css":"css","js_document":"js_document","javascript_file":"javascript_file","codename":"codename","default":"default","snippet":"snippet","icon":"icon","add_php_jview":"add_php_jview","context":"context","add_js_document":"add_js_document","custom_get":"custom_get","add_javascript_file":"add_javascript_file","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","add_php_document":"add_php_document","add_css":"add_css","add_php_view":"add_php_view","add_php_ajax":"add_php_ajax","libraries":"libraries","dynamic_get":"dynamic_get","php_document":"php_document","php_view":"php_view","add_custom_button":"add_custom_button","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $custom_admin_view->router = 'ComponentbuilderHelperRoute::getCustom_admin_viewRoute'; - $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if custom_admin_view type is already in content_type DB. $custom_admin_view_id = null; @@ -7786,13 +7932,13 @@ class com_componentbuilderInstallerScript } // Create the site_view content type object. - $site_view = new stdClass(); + $site_view = new \stdClass(); $site_view->type_title = 'Componentbuilder Site_view'; $site_view->type_alias = 'com_componentbuilder.site_view'; $site_view->table = '{"special": {"dbtable": "#__componentbuilder_site_view","key": "id","type": "Site_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $site_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "js_document","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","add_php_document":"add_php_document","add_php_view":"add_php_view","js_document":"js_document","codename":"codename","javascript_file":"javascript_file","context":"context","default":"default","snippet":"snippet","add_php_jview":"add_php_jview","custom_get":"custom_get","css_document":"css_document","add_javascript_file":"add_javascript_file","css":"css","add_js_document":"add_js_document","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","libraries":"libraries","add_css":"add_css","dynamic_get":"dynamic_get","add_php_ajax":"add_php_ajax","add_custom_button":"add_custom_button","php_document":"php_document","button_position":"button_position","php_view":"php_view","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $site_view->router = 'ComponentbuilderHelperRoute::getSite_viewRoute'; - $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if site_view type is already in content_type DB. $site_view_id = null; @@ -7815,13 +7961,13 @@ class com_componentbuilderInstallerScript } // Create the template content type object. - $template = new stdClass(); + $template = new \stdClass(); $template->type_title = 'Componentbuilder Template'; $template->type_alias = 'com_componentbuilder.template'; $template->table = '{"special": {"dbtable": "#__componentbuilder_template","key": "id","type": "Template","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $template->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "php_view","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","dynamic_get":"dynamic_get","php_view":"php_view","add_php_view":"add_php_view","template":"template","snippet":"snippet","libraries":"libraries","alias":"alias"}}'; $template->router = 'ComponentbuilderHelperRoute::getTemplateRoute'; - $template->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/template.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","dynamic_get","add_php_view","snippet"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $template->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/template.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","dynamic_get","add_php_view","snippet"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if template type is already in content_type DB. $template_id = null; @@ -7844,13 +7990,13 @@ class com_componentbuilderInstallerScript } // Create the layout content type object. - $layout = new stdClass(); + $layout = new \stdClass(); $layout->type_title = 'Componentbuilder Layout'; $layout->type_alias = 'com_componentbuilder.layout'; $layout->table = '{"special": {"dbtable": "#__componentbuilder_layout","key": "id","type": "Layout","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $layout->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "php_view","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","dynamic_get":"dynamic_get","snippet":"snippet","php_view":"php_view","add_php_view":"add_php_view","layout":"layout","libraries":"libraries","alias":"alias"}}'; $layout->router = 'ComponentbuilderHelperRoute::getLayoutRoute'; - $layout->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/layout.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","dynamic_get","snippet","add_php_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $layout->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/layout.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","dynamic_get","snippet","add_php_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if layout type is already in content_type DB. $layout_id = null; @@ -7873,13 +8019,13 @@ class com_componentbuilderInstallerScript } // Create the dynamic_get content type object. - $dynamic_get = new stdClass(); + $dynamic_get = new \stdClass(); $dynamic_get->type_title = 'Componentbuilder Dynamic_get'; $dynamic_get->type_alias = 'com_componentbuilder.dynamic_get'; $dynamic_get->table = '{"special": {"dbtable": "#__componentbuilder_dynamic_get","key": "id","type": "Dynamic_get","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_before_getitems","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","main_source":"main_source","gettype":"gettype","php_router_parse":"php_router_parse","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","php_after_getitem":"php_after_getitem","php_getlistquery":"php_getlistquery","view_selection":"view_selection","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","php_calculation":"php_calculation","php_before_getitem":"php_before_getitem","view_table_main":"view_table_main","select_all":"select_all","add_php_before_getitem":"add_php_before_getitem","getcustom":"getcustom","add_php_after_getitem":"add_php_after_getitem","pagination":"pagination","add_php_getlistquery":"add_php_getlistquery","add_php_before_getitems":"add_php_before_getitems","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","addcalculation":"addcalculation","guid":"guid"}}'; + $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_calculation","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","main_source":"main_source","gettype":"gettype","php_calculation":"php_calculation","php_router_parse":"php_router_parse","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","view_selection":"view_selection","add_php_before_getitems":"add_php_before_getitems","add_php_before_getitem":"add_php_before_getitem","add_php_after_getitem":"add_php_after_getitem","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","view_table_main":"view_table_main","add_php_getlistquery":"add_php_getlistquery","select_all":"select_all","php_before_getitem":"php_before_getitem","getcustom":"getcustom","php_after_getitem":"php_after_getitem","pagination":"pagination","php_getlistquery":"php_getlistquery","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","addcalculation":"addcalculation","guid":"guid"}}'; $dynamic_get->router = 'ComponentbuilderHelperRoute::getDynamic_getRoute'; - $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_source","gettype","view_table_main","select_all","add_php_before_getitem","add_php_after_getitem","pagination","add_php_getlistquery","add_php_before_getitems","add_php_after_getitems","add_php_router_parse"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_source","gettype","add_php_after_getitems","add_php_router_parse","add_php_before_getitems","add_php_before_getitem","add_php_after_getitem","view_table_main","add_php_getlistquery","select_all","pagination"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if dynamic_get type is already in content_type DB. $dynamic_get_id = null; @@ -7902,13 +8048,13 @@ class com_componentbuilderInstallerScript } // Create the custom_code content type object. - $custom_code = new stdClass(); + $custom_code = new \stdClass(); $custom_code->type_title = 'Componentbuilder Custom_code'; $custom_code->type_alias = 'com_componentbuilder.custom_code'; $custom_code->table = '{"special": {"dbtable": "#__componentbuilder_custom_code","key": "id","type": "Custom_code","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; + $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","joomla_version":"joomla_version","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; $custom_code->router = 'ComponentbuilderHelperRoute::getCustom_codeRoute'; - $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","comment_type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","component","target","type","comment_type","joomla_version"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if custom_code type is already in content_type DB. $custom_code_id = null; @@ -7931,13 +8077,13 @@ class com_componentbuilderInstallerScript } // Create the class_property content type object. - $class_property = new stdClass(); + $class_property = new \stdClass(); $class_property->type_title = 'Componentbuilder Class_property'; $class_property->type_alias = 'com_componentbuilder.class_property'; $class_property->table = '{"special": {"dbtable": "#__componentbuilder_class_property","key": "id","type": "Class_property","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_property->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","guid":"guid","comment":"comment","joomla_plugin_group":"joomla_plugin_group","default":"default"}}'; $class_property->router = 'ComponentbuilderHelperRoute::getClass_propertyRoute'; - $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; + $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; // Check if class_property type is already in content_type DB. $class_property_id = null; @@ -7960,13 +8106,13 @@ class com_componentbuilderInstallerScript } // Create the class_method content type object. - $class_method = new stdClass(); + $class_method = new \stdClass(); $class_method->type_title = 'Componentbuilder Class_method'; $class_method->type_alias = 'com_componentbuilder.class_method'; $class_method->table = '{"special": {"dbtable": "#__componentbuilder_class_method","key": "id","type": "Class_method","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_method->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","guid":"guid","code":"code","comment":"comment","joomla_plugin_group":"joomla_plugin_group","arguments":"arguments"}}'; $class_method->router = 'ComponentbuilderHelperRoute::getClass_methodRoute'; - $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; + $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; // Check if class_method type is already in content_type DB. $class_method_id = null; @@ -7989,13 +8135,13 @@ class com_componentbuilderInstallerScript } // Create the placeholder content type object. - $placeholder = new stdClass(); + $placeholder = new \stdClass(); $placeholder->type_title = 'Componentbuilder Placeholder'; $placeholder->type_alias = 'com_componentbuilder.placeholder'; $placeholder->table = '{"special": {"dbtable": "#__componentbuilder_placeholder","key": "id","type": "Placeholder","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $placeholder->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "target","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"target":"target","value":"value"}}'; $placeholder->router = 'ComponentbuilderHelperRoute::getPlaceholderRoute'; - $placeholder->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/placeholder.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $placeholder->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/placeholder.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if placeholder type is already in content_type DB. $placeholder_id = null; @@ -8018,13 +8164,13 @@ class com_componentbuilderInstallerScript } // Create the library content type object. - $library = new stdClass(); + $library = new \stdClass(); $library->type_title = 'Componentbuilder Library'; $library->type_alias = 'com_componentbuilder.library'; $library->table = '{"special": {"dbtable": "#__componentbuilder_library","key": "id","type": "Library","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","target":"target","how":"how","type":"type","description":"description","libraries":"libraries","php_setdocument":"php_setdocument","guid":"guid"}}'; $library->router = 'ComponentbuilderHelperRoute::getLibraryRoute'; - $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","target","how","type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","target","how","type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if library type is already in content_type DB. $library_id = null; @@ -8047,13 +8193,13 @@ class com_componentbuilderInstallerScript } // Create the snippet content type object. - $snippet = new stdClass(); + $snippet = new \stdClass(); $snippet->type_title = 'Componentbuilder Snippet'; $snippet->type_alias = 'com_componentbuilder.snippet'; $snippet->table = '{"special": {"dbtable": "#__componentbuilder_snippet","key": "id","type": "Snippet","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $snippet->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","url":"url","type":"type","heading":"heading","library":"library","guid":"guid","contributor_email":"contributor_email","contributor_name":"contributor_name","contributor_website":"contributor_website","contributor_company":"contributor_company","snippet":"snippet","usage":"usage","description":"description"}}'; $snippet->router = 'ComponentbuilderHelperRoute::getSnippetRoute'; - $snippet->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "type","targetTable": "#__componentbuilder_snippet_type","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $snippet->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","type","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "type","targetTable": "#__componentbuilder_snippet_type","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if snippet type is already in content_type DB. $snippet_id = null; @@ -8076,13 +8222,13 @@ class com_componentbuilderInstallerScript } // Create the validation_rule content type object. - $validation_rule = new stdClass(); + $validation_rule = new \stdClass(); $validation_rule->type_title = 'Componentbuilder Validation_rule'; $validation_rule->type_alias = 'com_componentbuilder.validation_rule'; $validation_rule->table = '{"special": {"dbtable": "#__componentbuilder_validation_rule","key": "id","type": "Validation_rule","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $validation_rule->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","short_description":"short_description","inherit":"inherit","php":"php"}}'; $validation_rule->router = 'ComponentbuilderHelperRoute::getValidation_ruleRoute'; - $validation_rule->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/validation_rule.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "inherit","targetTable": "#__componentbuilder_validation_rule","targetColumn": "id","displayColumn": "name"}]}'; + $validation_rule->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/validation_rule.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "inherit","targetTable": "#__componentbuilder_validation_rule","targetColumn": "id","displayColumn": "name"}]}'; // Check if validation_rule type is already in content_type DB. $validation_rule_id = null; @@ -8105,13 +8251,13 @@ class com_componentbuilderInstallerScript } // Create the field content type object. - $field = new stdClass(); + $field = new \stdClass(); $field->type_title = 'Componentbuilder Field'; $field->type_alias = 'com_componentbuilder.field'; $field->table = '{"special": {"dbtable": "#__componentbuilder_field","key": "id","type": "Field","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_views","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","store":"store","on_save_model_field":"on_save_model_field","initiator_on_get_model":"initiator_on_get_model","initiator_on_save_model":"initiator_on_save_model","xml":"xml","datalenght":"datalenght","css_views":"css_views","css_view":"css_view","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","on_get_model_field":"on_get_model_field","javascript_view_footer":"javascript_view_footer","javascript_views_footer":"javascript_views_footer","add_css_view":"add_css_view","add_css_views":"add_css_views","add_javascript_view_footer":"add_javascript_view_footer","add_javascript_views_footer":"add_javascript_views_footer","guid":"guid"}}'; $field->router = 'ComponentbuilderHelperRoute::getFieldRoute'; - $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","store","catid","add_css_view","add_css_views","add_javascript_view_footer","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}'; + $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","fieldtype","store","catid","add_css_view","add_css_views","add_javascript_view_footer","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}'; // Check if field type is already in content_type DB. $field_id = null; @@ -8134,7 +8280,7 @@ class com_componentbuilderInstallerScript } // Create the field category content type object. - $field_category = new stdClass(); + $field_category = new \stdClass(); $field_category->type_title = 'Componentbuilder Field Catid'; $field_category->type_alias = 'com_componentbuilder.field.category'; $field_category->table = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; @@ -8163,13 +8309,13 @@ class com_componentbuilderInstallerScript } // Create the fieldtype content type object. - $fieldtype = new stdClass(); + $fieldtype = new \stdClass(); $fieldtype->type_title = 'Componentbuilder Fieldtype'; $fieldtype->type_alias = 'com_componentbuilder.fieldtype'; $fieldtype->table = '{"special": {"dbtable": "#__componentbuilder_fieldtype","key": "id","type": "Fieldtype","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $fieldtype->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","store":"store","null_switch":"null_switch","indexes":"indexes","datadefault_other":"datadefault_other","datadefault":"datadefault","short_description":"short_description","datatype":"datatype","has_defaults":"has_defaults","description":"description","datalenght":"datalenght","datalenght_other":"datalenght_other","guid":"guid"}}'; $fieldtype->router = 'ComponentbuilderHelperRoute::getFieldtypeRoute'; - $fieldtype->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/fieldtype.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","store","has_defaults","catid"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $fieldtype->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/fieldtype.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","store","has_defaults","catid"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if fieldtype type is already in content_type DB. $fieldtype_id = null; @@ -8192,7 +8338,7 @@ class com_componentbuilderInstallerScript } // Create the fieldtype category content type object. - $fieldtype_category = new stdClass(); + $fieldtype_category = new \stdClass(); $fieldtype_category->type_title = 'Componentbuilder Fieldtype Catid'; $fieldtype_category->type_alias = 'com_componentbuilder.fieldtype.category'; $fieldtype_category->table = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; @@ -8221,13 +8367,13 @@ class com_componentbuilderInstallerScript } // Create the language_translation content type object. - $language_translation = new stdClass(); + $language_translation = new \stdClass(); $language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_alias = 'com_componentbuilder.language_translation'; $language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","plugins":"plugins","modules":"modules","components":"components"}}'; $language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute'; - $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if language_translation type is already in content_type DB. $language_translation_id = null; @@ -8250,13 +8396,13 @@ class com_componentbuilderInstallerScript } // Create the language content type object. - $language = new stdClass(); + $language = new \stdClass(); $language->type_title = 'Componentbuilder Language'; $language->type_alias = 'com_componentbuilder.language'; $language->table = '{"special": {"dbtable": "#__componentbuilder_language","key": "id","type": "Language","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","langtag":"langtag"}}'; $language->router = 'ComponentbuilderHelperRoute::getLanguageRoute'; - $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if language type is already in content_type DB. $language_id = null; @@ -8279,13 +8425,13 @@ class com_componentbuilderInstallerScript } // Create the server content type object. - $server = new stdClass(); + $server = new \stdClass(); $server->type_title = 'Componentbuilder Server'; $server->type_alias = 'com_componentbuilder.server'; $server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","signature":"signature","private_key":"private_key","secret":"secret","password":"password","private":"private","authentication":"authentication","path":"path","port":"port","host":"host","username":"username"}}'; $server->router = 'ComponentbuilderHelperRoute::getServerRoute'; - $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","protocol","authentication"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if server type is already in content_type DB. $server_id = null; @@ -8308,13 +8454,13 @@ class com_componentbuilderInstallerScript } // Create the help_document content type object. - $help_document = new stdClass(); + $help_document = new \stdClass(); $help_document->type_title = 'Componentbuilder Help_document'; $help_document->type_alias = 'com_componentbuilder.help_document'; $help_document->table = '{"special": {"dbtable": "#__componentbuilder_help_document","key": "id","type": "Help_document","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","content":"content","article":"article","url":"url","target":"target","alias":"alias"}}'; $help_document->router = 'ComponentbuilderHelperRoute::getHelp_documentRoute'; - $help_document->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","not_required","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; + $help_document->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","type","location","not_required","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; // Check if help_document type is already in content_type DB. $help_document_id = null; @@ -8337,13 +8483,13 @@ class com_componentbuilderInstallerScript } // Create the admin_fields content type object. - $admin_fields = new stdClass(); + $admin_fields = new \stdClass(); $admin_fields->type_title = 'Componentbuilder Admin_fields'; $admin_fields->type_alias = 'com_componentbuilder.admin_fields'; $admin_fields->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields","key": "id","type": "Admin_fields","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields->router = 'ComponentbuilderHelperRoute::getAdmin_fieldsRoute'; - $admin_fields->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if admin_fields type is already in content_type DB. $admin_fields_id = null; @@ -8366,13 +8512,13 @@ class com_componentbuilderInstallerScript } // Create the admin_fields_conditions content type object. - $admin_fields_conditions = new stdClass(); + $admin_fields_conditions = new \stdClass(); $admin_fields_conditions->type_title = 'Componentbuilder Admin_fields_conditions'; $admin_fields_conditions->type_alias = 'com_componentbuilder.admin_fields_conditions'; $admin_fields_conditions->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_conditions","key": "id","type": "Admin_fields_conditions","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields_conditions->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields_conditions->router = 'ComponentbuilderHelperRoute::getAdmin_fields_conditionsRoute'; - $admin_fields_conditions->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields_conditions->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if admin_fields_conditions type is already in content_type DB. $admin_fields_conditions_id = null; @@ -8395,13 +8541,13 @@ class com_componentbuilderInstallerScript } // Create the admin_fields_relations content type object. - $admin_fields_relations = new stdClass(); + $admin_fields_relations = new \stdClass(); $admin_fields_relations->type_title = 'Componentbuilder Admin_fields_relations'; $admin_fields_relations->type_alias = 'com_componentbuilder.admin_fields_relations'; $admin_fields_relations->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_relations","key": "id","type": "Admin_fields_relations","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields_relations->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields_relations->router = 'ComponentbuilderHelperRoute::getAdmin_fields_relationsRoute'; - $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if admin_fields_relations type is already in content_type DB. $admin_fields_relations_id = null; @@ -8424,13 +8570,13 @@ class com_componentbuilderInstallerScript } // Create the admin_custom_tabs content type object. - $admin_custom_tabs = new stdClass(); + $admin_custom_tabs = new \stdClass(); $admin_custom_tabs->type_title = 'Componentbuilder Admin_custom_tabs'; $admin_custom_tabs->type_alias = 'com_componentbuilder.admin_custom_tabs'; $admin_custom_tabs->table = '{"special": {"dbtable": "#__componentbuilder_admin_custom_tabs","key": "id","type": "Admin_custom_tabs","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_custom_tabs->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_custom_tabs->router = 'ComponentbuilderHelperRoute::getAdmin_custom_tabsRoute'; - $admin_custom_tabs->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_custom_tabs->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if admin_custom_tabs type is already in content_type DB. $admin_custom_tabs_id = null; @@ -8453,13 +8599,13 @@ class com_componentbuilderInstallerScript } // Create the component_admin_views content type object. - $component_admin_views = new stdClass(); + $component_admin_views = new \stdClass(); $component_admin_views->type_title = 'Componentbuilder Component_admin_views'; $component_admin_views->type_alias = 'com_componentbuilder.component_admin_views'; $component_admin_views->table = '{"special": {"dbtable": "#__componentbuilder_component_admin_views","key": "id","type": "Component_admin_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_admin_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_admin_views->router = 'ComponentbuilderHelperRoute::getComponent_admin_viewsRoute'; - $component_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_admin_views type is already in content_type DB. $component_admin_views_id = null; @@ -8482,13 +8628,13 @@ class com_componentbuilderInstallerScript } // Create the component_site_views content type object. - $component_site_views = new stdClass(); + $component_site_views = new \stdClass(); $component_site_views->type_title = 'Componentbuilder Component_site_views'; $component_site_views->type_alias = 'com_componentbuilder.component_site_views'; $component_site_views->table = '{"special": {"dbtable": "#__componentbuilder_component_site_views","key": "id","type": "Component_site_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_site_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_site_views->router = 'ComponentbuilderHelperRoute::getComponent_site_viewsRoute'; - $component_site_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_site_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_site_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_site_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_site_views type is already in content_type DB. $component_site_views_id = null; @@ -8511,13 +8657,13 @@ class com_componentbuilderInstallerScript } // Create the component_custom_admin_views content type object. - $component_custom_admin_views = new stdClass(); + $component_custom_admin_views = new \stdClass(); $component_custom_admin_views->type_title = 'Componentbuilder Component_custom_admin_views'; $component_custom_admin_views->type_alias = 'com_componentbuilder.component_custom_admin_views'; $component_custom_admin_views->table = '{"special": {"dbtable": "#__componentbuilder_component_custom_admin_views","key": "id","type": "Component_custom_admin_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_custom_admin_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_custom_admin_views->router = 'ComponentbuilderHelperRoute::getComponent_custom_admin_viewsRoute'; - $component_custom_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_custom_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_custom_admin_views type is already in content_type DB. $component_custom_admin_views_id = null; @@ -8540,13 +8686,13 @@ class com_componentbuilderInstallerScript } // Create the component_updates content type object. - $component_updates = new stdClass(); + $component_updates = new \stdClass(); $component_updates->type_title = 'Componentbuilder Component_updates'; $component_updates->type_alias = 'com_componentbuilder.component_updates'; $component_updates->table = '{"special": {"dbtable": "#__componentbuilder_component_updates","key": "id","type": "Component_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_updates->router = 'ComponentbuilderHelperRoute::getComponent_updatesRoute'; - $component_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_updates type is already in content_type DB. $component_updates_id = null; @@ -8569,13 +8715,13 @@ class com_componentbuilderInstallerScript } // Create the component_mysql_tweaks content type object. - $component_mysql_tweaks = new stdClass(); + $component_mysql_tweaks = new \stdClass(); $component_mysql_tweaks->type_title = 'Componentbuilder Component_mysql_tweaks'; $component_mysql_tweaks->type_alias = 'com_componentbuilder.component_mysql_tweaks'; $component_mysql_tweaks->table = '{"special": {"dbtable": "#__componentbuilder_component_mysql_tweaks","key": "id","type": "Component_mysql_tweaks","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_mysql_tweaks->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_mysql_tweaks->router = 'ComponentbuilderHelperRoute::getComponent_mysql_tweaksRoute'; - $component_mysql_tweaks->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_mysql_tweaks->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_mysql_tweaks type is already in content_type DB. $component_mysql_tweaks_id = null; @@ -8598,13 +8744,13 @@ class com_componentbuilderInstallerScript } // Create the component_custom_admin_menus content type object. - $component_custom_admin_menus = new stdClass(); + $component_custom_admin_menus = new \stdClass(); $component_custom_admin_menus->type_title = 'Componentbuilder Component_custom_admin_menus'; $component_custom_admin_menus->type_alias = 'com_componentbuilder.component_custom_admin_menus'; $component_custom_admin_menus->table = '{"special": {"dbtable": "#__componentbuilder_component_custom_admin_menus","key": "id","type": "Component_custom_admin_menus","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_custom_admin_menus->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_custom_admin_menus->router = 'ComponentbuilderHelperRoute::getComponent_custom_admin_menusRoute'; - $component_custom_admin_menus->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_custom_admin_menus->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_custom_admin_menus type is already in content_type DB. $component_custom_admin_menus_id = null; @@ -8626,14 +8772,43 @@ class com_componentbuilderInstallerScript $component_custom_admin_menus_Inserted = $db->insertObject('#__content_types', $component_custom_admin_menus); } + // Create the component_router content type object. + $component_router = new \stdClass(); + $component_router->type_title = 'Componentbuilder Component_router'; + $component_router->type_alias = 'com_componentbuilder.component_router'; + $component_router->table = '{"special": {"dbtable": "#__componentbuilder_component_router","key": "id","type": "Component_router","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $component_router->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "methods_code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component","mode_constructor_before_parent":"mode_constructor_before_parent","mode_constructor_after_parent":"mode_constructor_after_parent","mode_methods":"mode_methods","methods_code":"methods_code","constructor_after_parent_code":"constructor_after_parent_code","constructor_before_parent_code":"constructor_before_parent_code"}}'; + $component_router->router = 'ComponentbuilderHelperRoute::getComponent_routerRoute'; + $component_router->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_router.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component","mode_constructor_before_parent","mode_constructor_after_parent","mode_methods"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + + // Check if component_router type is already in content_type DB. + $component_router_id = null; + $query = $db->getQuery(true); + $query->select($db->quoteName(array('type_id'))); + $query->from($db->quoteName('#__content_types')); + $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($component_router->type_alias)); + $db->setQuery($query); + $db->execute(); + + // Set the object into the content types table. + if ($db->getNumRows()) + { + $component_router->type_id = $db->loadResult(); + $component_router_Updated = $db->updateObject('#__content_types', $component_router, 'type_id'); + } + else + { + $component_router_Inserted = $db->insertObject('#__content_types', $component_router); + } + // Create the component_config content type object. - $component_config = new stdClass(); + $component_config = new \stdClass(); $component_config->type_title = 'Componentbuilder Component_config'; $component_config->type_alias = 'com_componentbuilder.component_config'; $component_config->table = '{"special": {"dbtable": "#__componentbuilder_component_config","key": "id","type": "Component_config","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_config->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_config->router = 'ComponentbuilderHelperRoute::getComponent_configRoute'; - $component_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_config type is already in content_type DB. $component_config_id = null; @@ -8656,13 +8831,13 @@ class com_componentbuilderInstallerScript } // Create the component_dashboard content type object. - $component_dashboard = new stdClass(); + $component_dashboard = new \stdClass(); $component_dashboard->type_title = 'Componentbuilder Component_dashboard'; $component_dashboard->type_alias = 'com_componentbuilder.component_dashboard'; $component_dashboard->table = '{"special": {"dbtable": "#__componentbuilder_component_dashboard","key": "id","type": "Component_dashboard","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_dashboard->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component","php_dashboard_methods":"php_dashboard_methods"}}'; $component_dashboard->router = 'ComponentbuilderHelperRoute::getComponent_dashboardRoute'; - $component_dashboard->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_dashboard.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_dashboard->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_dashboard.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_dashboard type is already in content_type DB. $component_dashboard_id = null; @@ -8685,13 +8860,13 @@ class com_componentbuilderInstallerScript } // Create the component_files_folders content type object. - $component_files_folders = new stdClass(); + $component_files_folders = new \stdClass(); $component_files_folders->type_title = 'Componentbuilder Component_files_folders'; $component_files_folders->type_alias = 'com_componentbuilder.component_files_folders'; $component_files_folders->table = '{"special": {"dbtable": "#__componentbuilder_component_files_folders","key": "id","type": "Component_files_folders","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_files_folders->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_files_folders->router = 'ComponentbuilderHelperRoute::getComponent_files_foldersRoute'; - $component_files_folders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_files_folders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_files_folders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_files_folders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_files_folders type is already in content_type DB. $component_files_folders_id = null; @@ -8714,13 +8889,13 @@ class com_componentbuilderInstallerScript } // Create the component_placeholders content type object. - $component_placeholders = new stdClass(); + $component_placeholders = new \stdClass(); $component_placeholders->type_title = 'Componentbuilder Component_placeholders'; $component_placeholders->type_alias = 'com_componentbuilder.component_placeholders'; $component_placeholders->table = '{"special": {"dbtable": "#__componentbuilder_component_placeholders","key": "id","type": "Component_placeholders","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_placeholders->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_placeholders->router = 'ComponentbuilderHelperRoute::getComponent_placeholdersRoute'; - $component_placeholders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_placeholders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_placeholders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_placeholders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_placeholders type is already in content_type DB. $component_placeholders_id = null; @@ -8743,13 +8918,13 @@ class com_componentbuilderInstallerScript } // Create the component_plugins content type object. - $component_plugins = new stdClass(); + $component_plugins = new \stdClass(); $component_plugins->type_title = 'Componentbuilder Component_plugins'; $component_plugins->type_alias = 'com_componentbuilder.component_plugins'; $component_plugins->table = '{"special": {"dbtable": "#__componentbuilder_component_plugins","key": "id","type": "Component_plugins","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_plugins->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_plugins->router = 'ComponentbuilderHelperRoute::getComponent_pluginsRoute'; - $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_plugins type is already in content_type DB. $component_plugins_id = null; @@ -8772,13 +8947,13 @@ class com_componentbuilderInstallerScript } // Create the component_modules content type object. - $component_modules = new stdClass(); + $component_modules = new \stdClass(); $component_modules->type_title = 'Componentbuilder Component_modules'; $component_modules->type_alias = 'com_componentbuilder.component_modules'; $component_modules->table = '{"special": {"dbtable": "#__componentbuilder_component_modules","key": "id","type": "Component_modules","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_modules->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_modules->router = 'ComponentbuilderHelperRoute::getComponent_modulesRoute'; - $component_modules->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_modules.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_modules->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_modules.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_modules type is already in content_type DB. $component_modules_id = null; @@ -8801,13 +8976,13 @@ class com_componentbuilderInstallerScript } // Create the snippet_type content type object. - $snippet_type = new stdClass(); + $snippet_type = new \stdClass(); $snippet_type->type_title = 'Componentbuilder Snippet_type'; $snippet_type->type_alias = 'com_componentbuilder.snippet_type'; $snippet_type->table = '{"special": {"dbtable": "#__componentbuilder_snippet_type","key": "id","type": "Snippet_type","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $snippet_type->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description"}}'; $snippet_type->router = 'ComponentbuilderHelperRoute::getSnippet_typeRoute'; - $snippet_type->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet_type.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $snippet_type->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet_type.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if snippet_type type is already in content_type DB. $snippet_type_id = null; @@ -8830,13 +9005,13 @@ class com_componentbuilderInstallerScript } // Create the library_config content type object. - $library_config = new stdClass(); + $library_config = new \stdClass(); $library_config->type_title = 'Componentbuilder Library_config'; $library_config->type_alias = 'com_componentbuilder.library_config'; $library_config->table = '{"special": {"dbtable": "#__componentbuilder_library_config","key": "id","type": "Library_config","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library_config->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "library","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"library":"library"}}'; $library_config->router = 'ComponentbuilderHelperRoute::getLibrary_configRoute'; - $library_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if library_config type is already in content_type DB. $library_config_id = null; @@ -8859,13 +9034,13 @@ class com_componentbuilderInstallerScript } // Create the library_files_folders_urls content type object. - $library_files_folders_urls = new stdClass(); + $library_files_folders_urls = new \stdClass(); $library_files_folders_urls->type_title = 'Componentbuilder Library_files_folders_urls'; $library_files_folders_urls->type_alias = 'com_componentbuilder.library_files_folders_urls'; $library_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_library_files_folders_urls","key": "id","type": "Library_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "library","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"library":"library"}}'; $library_files_folders_urls->router = 'ComponentbuilderHelperRoute::getLibrary_files_folders_urlsRoute'; - $library_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if library_files_folders_urls type is already in content_type DB. $library_files_folders_urls_id = null; @@ -8888,13 +9063,13 @@ class com_componentbuilderInstallerScript } // Create the class_extends content type object. - $class_extends = new stdClass(); + $class_extends = new \stdClass(); $class_extends->type_title = 'Componentbuilder Class_extends'; $class_extends->type_alias = 'com_componentbuilder.class_extends'; $class_extends->table = '{"special": {"dbtable": "#__componentbuilder_class_extends","key": "id","type": "Class_extends","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_extends->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","extension_type":"extension_type","head":"head","comment":"comment"}}'; $class_extends->router = 'ComponentbuilderHelperRoute::getClass_extendsRoute'; - $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if class_extends type is already in content_type DB. $class_extends_id = null; @@ -8917,13 +9092,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_module_updates content type object. - $joomla_module_updates = new stdClass(); + $joomla_module_updates = new \stdClass(); $joomla_module_updates->type_title = 'Componentbuilder Joomla_module_updates'; $joomla_module_updates->type_alias = 'com_componentbuilder.joomla_module_updates'; $joomla_module_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module_updates","key": "id","type": "Joomla_module_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_module","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_module":"joomla_module"}}'; $joomla_module_updates->router = 'ComponentbuilderHelperRoute::getJoomla_module_updatesRoute'; - $joomla_module_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_module_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if joomla_module_updates type is already in content_type DB. $joomla_module_updates_id = null; @@ -8946,13 +9121,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_module_files_folders_urls content type object. - $joomla_module_files_folders_urls = new stdClass(); + $joomla_module_files_folders_urls = new \stdClass(); $joomla_module_files_folders_urls->type_title = 'Componentbuilder Joomla_module_files_folders_urls'; $joomla_module_files_folders_urls->type_alias = 'com_componentbuilder.joomla_module_files_folders_urls'; $joomla_module_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module_files_folders_urls","key": "id","type": "Joomla_module_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_module","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_module":"joomla_module"}}'; $joomla_module_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_module_files_folders_urlsRoute'; - $joomla_module_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_module_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if joomla_module_files_folders_urls type is already in content_type DB. $joomla_module_files_folders_urls_id = null; @@ -8975,13 +9150,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_plugin_group content type object. - $joomla_plugin_group = new stdClass(); + $joomla_plugin_group = new \stdClass(); $joomla_plugin_group->type_title = 'Componentbuilder Joomla_plugin_group'; $joomla_plugin_group->type_alias = 'com_componentbuilder.joomla_plugin_group'; $joomla_plugin_group->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_group","key": "id","type": "Joomla_plugin_group","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_group->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","class_extends":"class_extends"}}'; $joomla_plugin_group->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_groupRoute'; - $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_plugin_group type is already in content_type DB. $joomla_plugin_group_id = null; @@ -9004,13 +9179,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_plugin_updates content type object. - $joomla_plugin_updates = new stdClass(); + $joomla_plugin_updates = new \stdClass(); $joomla_plugin_updates->type_title = 'Componentbuilder Joomla_plugin_updates'; $joomla_plugin_updates->type_alias = 'com_componentbuilder.joomla_plugin_updates'; $joomla_plugin_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_updates","key": "id","type": "Joomla_plugin_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}'; $joomla_plugin_updates->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_updatesRoute'; - $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if joomla_plugin_updates type is already in content_type DB. $joomla_plugin_updates_id = null; @@ -9033,13 +9208,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_plugin_files_folders_urls content type object. - $joomla_plugin_files_folders_urls = new stdClass(); + $joomla_plugin_files_folders_urls = new \stdClass(); $joomla_plugin_files_folders_urls->type_title = 'Componentbuilder Joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_files_folders_urls","key": "id","type": "Joomla_plugin_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}'; $joomla_plugin_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_files_folders_urlsRoute'; - $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if joomla_plugin_files_folders_urls type is already in content_type DB. $joomla_plugin_files_folders_urls_id = null; @@ -9102,7 +9277,7 @@ class com_componentbuilderInstallerScript if (strpos($row->url, $library['not']) === false) { // Create an object. - $updater[$row->id] = new stdClass(); + $updater[$row->id] = new \stdClass(); $updater[$row->id]->id = $row->id; $updater[$row->id]->library = $id; } @@ -9112,7 +9287,7 @@ class com_componentbuilderInstallerScript if (strpos($row->url, $library['and']) !== false) { // Create an object. - $updater[$row->id] = new stdClass(); + $updater[$row->id] = new \stdClass(); $updater[$row->id]->id = $row->id; $updater[$row->id]->library = $id; } @@ -9120,7 +9295,7 @@ class com_componentbuilderInstallerScript else { // Create an object. - $updater[$row->id] = new stdClass(); + $updater[$row->id] = new \stdClass(); $updater[$row->id]->id = $row->id; $updater[$row->id]->library = $id; } @@ -9132,7 +9307,7 @@ class com_componentbuilderInstallerScript if (!isset($updater[$row->id])) { // Create an object. - $updater[$row->id] = new stdClass(); + $updater[$row->id] = new \stdClass(); $updater[$row->id]->id = $row->id; $updater[$row->id]->library = 1; // default (no library) } @@ -9160,9 +9335,9 @@ class com_componentbuilderInstallerScript if ((isset($this->setFtpValues) && ArrayHelper::check($this->setFtpValues)) || (isset($this->setMoveValues) && ArrayHelper::check($this->setMoveValues))) { // Get the date - $today = JFactory::getDate()->toSql(); + $today = Factory::getDate()->toSql(); // Get the user object - $user = JFactory::getUser(); + $user = Factory::getUser(); } // check if we have stuff to move if (isset($this->setMoveValues) && ArrayHelper::check($this->setMoveValues)) @@ -9175,7 +9350,7 @@ class com_componentbuilderInstallerScript foreach($items as $item) { // okay if found ignore move - if (isset($item->{$this->dynamicTable[$table]}) && $item->{$this->dynamicTable[$table]} > 0 && !ComponentbuilderHelper::getVar($table, (int) $item->{$this->dynamicTable[$table]}, $this->dynamicTable[$table], 'id')) + if (isset($item->{$this->dynamicTable[$table]}) && $item->{$this->dynamicTable[$table]} > 0 && !GetHelper::var($table, (int) $item->{$this->dynamicTable[$table]}, $this->dynamicTable[$table], 'id')) { $item->published = 1; $item->version = 2; @@ -9210,7 +9385,7 @@ class com_componentbuilderInstallerScript { $name = explode('.', $hostusername); // Create an object. - $object = new stdClass(); + $object = new \stdClass(); $object->signature = $item['signature']; // the still locked version (if there is a basic key) $object->name = str_replace('@', ' ', $name[0]); $object->published = 1; @@ -9232,7 +9407,7 @@ class com_componentbuilderInstallerScript foreach ($item['ids'] as $compId) { // Create an object. - $object = new stdClass(); + $object = new \stdClass(); $object->id = $compId; $object->{$key} = $newId; // Update with the object the joomla_component table. @@ -9249,7 +9424,7 @@ class com_componentbuilderInstallerScript foreach ($item['ids'] as $compId) { // Create an object. - $object = new stdClass(); + $object = new \stdClass(); $object->id = $compId; $object->{$key} = ''; // remove all values to insure stability // Insert the object into the joomla_component table. @@ -9434,18 +9609,19 @@ class com_componentbuilderInstallerScript // set a notice that this was done $app->enqueueMessage('

Clean-up!
We have removed the internal old Gitea folder /libraries/jcb_powers/VDM.Gitea that is no longer used.
The new Gitea classes are now found here /libraries/jcb_powers/VDM.Joomla.Gitea and is available to any JCB project from the following super power: https://git.vdm.dev/joomla/gitea

', 'Notice'); } - echo ' + + echo '
-

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

'; +

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

'; // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the componentbuilder action logs extensions object. - $componentbuilder_action_logs_extensions = new stdClass(); + $componentbuilder_action_logs_extensions = new \stdClass(); $componentbuilder_action_logs_extensions->extension = 'com_componentbuilder'; // Check if componentbuilder action log extension is already in action logs extensions DB. @@ -9465,10 +9641,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_component action log config object. - $joomla_component_action_log_config = new stdClass(); + $joomla_component_action_log_config = new \stdClass(); $joomla_component_action_log_config->id = null; $joomla_component_action_log_config->type_title = 'JOOMLA_COMPONENT'; $joomla_component_action_log_config->type_alias = 'com_componentbuilder.joomla_component'; @@ -9499,10 +9675,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module action log config object. - $joomla_module_action_log_config = new stdClass(); + $joomla_module_action_log_config = new \stdClass(); $joomla_module_action_log_config->id = null; $joomla_module_action_log_config->type_title = 'JOOMLA_MODULE'; $joomla_module_action_log_config->type_alias = 'com_componentbuilder.joomla_module'; @@ -9533,10 +9709,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin action log config object. - $joomla_plugin_action_log_config = new stdClass(); + $joomla_plugin_action_log_config = new \stdClass(); $joomla_plugin_action_log_config->id = null; $joomla_plugin_action_log_config->type_title = 'JOOMLA_PLUGIN'; $joomla_plugin_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin'; @@ -9567,10 +9743,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the power action log config object. - $power_action_log_config = new stdClass(); + $power_action_log_config = new \stdClass(); $power_action_log_config->id = null; $power_action_log_config->type_title = 'POWER'; $power_action_log_config->type_alias = 'com_componentbuilder.power'; @@ -9601,10 +9777,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_view action log config object. - $admin_view_action_log_config = new stdClass(); + $admin_view_action_log_config = new \stdClass(); $admin_view_action_log_config->id = null; $admin_view_action_log_config->type_title = 'ADMIN_VIEW'; $admin_view_action_log_config->type_alias = 'com_componentbuilder.admin_view'; @@ -9635,10 +9811,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the custom_admin_view action log config object. - $custom_admin_view_action_log_config = new stdClass(); + $custom_admin_view_action_log_config = new \stdClass(); $custom_admin_view_action_log_config->id = null; $custom_admin_view_action_log_config->type_title = 'CUSTOM_ADMIN_VIEW'; $custom_admin_view_action_log_config->type_alias = 'com_componentbuilder.custom_admin_view'; @@ -9669,10 +9845,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the site_view action log config object. - $site_view_action_log_config = new stdClass(); + $site_view_action_log_config = new \stdClass(); $site_view_action_log_config->id = null; $site_view_action_log_config->type_title = 'SITE_VIEW'; $site_view_action_log_config->type_alias = 'com_componentbuilder.site_view'; @@ -9703,10 +9879,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the template action log config object. - $template_action_log_config = new stdClass(); + $template_action_log_config = new \stdClass(); $template_action_log_config->id = null; $template_action_log_config->type_title = 'TEMPLATE'; $template_action_log_config->type_alias = 'com_componentbuilder.template'; @@ -9737,10 +9913,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the layout action log config object. - $layout_action_log_config = new stdClass(); + $layout_action_log_config = new \stdClass(); $layout_action_log_config->id = null; $layout_action_log_config->type_title = 'LAYOUT'; $layout_action_log_config->type_alias = 'com_componentbuilder.layout'; @@ -9771,10 +9947,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the dynamic_get action log config object. - $dynamic_get_action_log_config = new stdClass(); + $dynamic_get_action_log_config = new \stdClass(); $dynamic_get_action_log_config->id = null; $dynamic_get_action_log_config->type_title = 'DYNAMIC_GET'; $dynamic_get_action_log_config->type_alias = 'com_componentbuilder.dynamic_get'; @@ -9805,10 +9981,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the custom_code action log config object. - $custom_code_action_log_config = new stdClass(); + $custom_code_action_log_config = new \stdClass(); $custom_code_action_log_config->id = null; $custom_code_action_log_config->type_title = 'CUSTOM_CODE'; $custom_code_action_log_config->type_alias = 'com_componentbuilder.custom_code'; @@ -9839,10 +10015,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_property action log config object. - $class_property_action_log_config = new stdClass(); + $class_property_action_log_config = new \stdClass(); $class_property_action_log_config->id = null; $class_property_action_log_config->type_title = 'CLASS_PROPERTY'; $class_property_action_log_config->type_alias = 'com_componentbuilder.class_property'; @@ -9873,10 +10049,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_method action log config object. - $class_method_action_log_config = new stdClass(); + $class_method_action_log_config = new \stdClass(); $class_method_action_log_config->id = null; $class_method_action_log_config->type_title = 'CLASS_METHOD'; $class_method_action_log_config->type_alias = 'com_componentbuilder.class_method'; @@ -9907,10 +10083,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the placeholder action log config object. - $placeholder_action_log_config = new stdClass(); + $placeholder_action_log_config = new \stdClass(); $placeholder_action_log_config->id = null; $placeholder_action_log_config->type_title = 'PLACEHOLDER'; $placeholder_action_log_config->type_alias = 'com_componentbuilder.placeholder'; @@ -9941,10 +10117,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library action log config object. - $library_action_log_config = new stdClass(); + $library_action_log_config = new \stdClass(); $library_action_log_config->id = null; $library_action_log_config->type_title = 'LIBRARY'; $library_action_log_config->type_alias = 'com_componentbuilder.library'; @@ -9975,10 +10151,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the snippet action log config object. - $snippet_action_log_config = new stdClass(); + $snippet_action_log_config = new \stdClass(); $snippet_action_log_config->id = null; $snippet_action_log_config->type_title = 'SNIPPET'; $snippet_action_log_config->type_alias = 'com_componentbuilder.snippet'; @@ -10009,10 +10185,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the validation_rule action log config object. - $validation_rule_action_log_config = new stdClass(); + $validation_rule_action_log_config = new \stdClass(); $validation_rule_action_log_config->id = null; $validation_rule_action_log_config->type_title = 'VALIDATION_RULE'; $validation_rule_action_log_config->type_alias = 'com_componentbuilder.validation_rule'; @@ -10043,10 +10219,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the field action log config object. - $field_action_log_config = new stdClass(); + $field_action_log_config = new \stdClass(); $field_action_log_config->id = null; $field_action_log_config->type_title = 'FIELD'; $field_action_log_config->type_alias = 'com_componentbuilder.field'; @@ -10077,10 +10253,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the fieldtype action log config object. - $fieldtype_action_log_config = new stdClass(); + $fieldtype_action_log_config = new \stdClass(); $fieldtype_action_log_config->id = null; $fieldtype_action_log_config->type_title = 'FIELDTYPE'; $fieldtype_action_log_config->type_alias = 'com_componentbuilder.fieldtype'; @@ -10111,10 +10287,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the language_translation action log config object. - $language_translation_action_log_config = new stdClass(); + $language_translation_action_log_config = new \stdClass(); $language_translation_action_log_config->id = null; $language_translation_action_log_config->type_title = 'LANGUAGE_TRANSLATION'; $language_translation_action_log_config->type_alias = 'com_componentbuilder.language_translation'; @@ -10145,10 +10321,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the language action log config object. - $language_action_log_config = new stdClass(); + $language_action_log_config = new \stdClass(); $language_action_log_config->id = null; $language_action_log_config->type_title = 'LANGUAGE'; $language_action_log_config->type_alias = 'com_componentbuilder.language'; @@ -10179,10 +10355,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the server action log config object. - $server_action_log_config = new stdClass(); + $server_action_log_config = new \stdClass(); $server_action_log_config->id = null; $server_action_log_config->type_title = 'SERVER'; $server_action_log_config->type_alias = 'com_componentbuilder.server'; @@ -10213,10 +10389,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the help_document action log config object. - $help_document_action_log_config = new stdClass(); + $help_document_action_log_config = new \stdClass(); $help_document_action_log_config->id = null; $help_document_action_log_config->type_title = 'HELP_DOCUMENT'; $help_document_action_log_config->type_alias = 'com_componentbuilder.help_document'; @@ -10247,10 +10423,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields action log config object. - $admin_fields_action_log_config = new stdClass(); + $admin_fields_action_log_config = new \stdClass(); $admin_fields_action_log_config->id = null; $admin_fields_action_log_config->type_title = 'ADMIN_FIELDS'; $admin_fields_action_log_config->type_alias = 'com_componentbuilder.admin_fields'; @@ -10281,10 +10457,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields_conditions action log config object. - $admin_fields_conditions_action_log_config = new stdClass(); + $admin_fields_conditions_action_log_config = new \stdClass(); $admin_fields_conditions_action_log_config->id = null; $admin_fields_conditions_action_log_config->type_title = 'ADMIN_FIELDS_CONDITIONS'; $admin_fields_conditions_action_log_config->type_alias = 'com_componentbuilder.admin_fields_conditions'; @@ -10315,10 +10491,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields_relations action log config object. - $admin_fields_relations_action_log_config = new stdClass(); + $admin_fields_relations_action_log_config = new \stdClass(); $admin_fields_relations_action_log_config->id = null; $admin_fields_relations_action_log_config->type_title = 'ADMIN_FIELDS_RELATIONS'; $admin_fields_relations_action_log_config->type_alias = 'com_componentbuilder.admin_fields_relations'; @@ -10349,10 +10525,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_custom_tabs action log config object. - $admin_custom_tabs_action_log_config = new stdClass(); + $admin_custom_tabs_action_log_config = new \stdClass(); $admin_custom_tabs_action_log_config->id = null; $admin_custom_tabs_action_log_config->type_title = 'ADMIN_CUSTOM_TABS'; $admin_custom_tabs_action_log_config->type_alias = 'com_componentbuilder.admin_custom_tabs'; @@ -10383,10 +10559,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_admin_views action log config object. - $component_admin_views_action_log_config = new stdClass(); + $component_admin_views_action_log_config = new \stdClass(); $component_admin_views_action_log_config->id = null; $component_admin_views_action_log_config->type_title = 'COMPONENT_ADMIN_VIEWS'; $component_admin_views_action_log_config->type_alias = 'com_componentbuilder.component_admin_views'; @@ -10417,10 +10593,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_site_views action log config object. - $component_site_views_action_log_config = new stdClass(); + $component_site_views_action_log_config = new \stdClass(); $component_site_views_action_log_config->id = null; $component_site_views_action_log_config->type_title = 'COMPONENT_SITE_VIEWS'; $component_site_views_action_log_config->type_alias = 'com_componentbuilder.component_site_views'; @@ -10451,10 +10627,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_custom_admin_views action log config object. - $component_custom_admin_views_action_log_config = new stdClass(); + $component_custom_admin_views_action_log_config = new \stdClass(); $component_custom_admin_views_action_log_config->id = null; $component_custom_admin_views_action_log_config->type_title = 'COMPONENT_CUSTOM_ADMIN_VIEWS'; $component_custom_admin_views_action_log_config->type_alias = 'com_componentbuilder.component_custom_admin_views'; @@ -10485,10 +10661,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_updates action log config object. - $component_updates_action_log_config = new stdClass(); + $component_updates_action_log_config = new \stdClass(); $component_updates_action_log_config->id = null; $component_updates_action_log_config->type_title = 'COMPONENT_UPDATES'; $component_updates_action_log_config->type_alias = 'com_componentbuilder.component_updates'; @@ -10519,10 +10695,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_mysql_tweaks action log config object. - $component_mysql_tweaks_action_log_config = new stdClass(); + $component_mysql_tweaks_action_log_config = new \stdClass(); $component_mysql_tweaks_action_log_config->id = null; $component_mysql_tweaks_action_log_config->type_title = 'COMPONENT_MYSQL_TWEAKS'; $component_mysql_tweaks_action_log_config->type_alias = 'com_componentbuilder.component_mysql_tweaks'; @@ -10553,10 +10729,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_custom_admin_menus action log config object. - $component_custom_admin_menus_action_log_config = new stdClass(); + $component_custom_admin_menus_action_log_config = new \stdClass(); $component_custom_admin_menus_action_log_config->id = null; $component_custom_admin_menus_action_log_config->type_title = 'COMPONENT_CUSTOM_ADMIN_MENUS'; $component_custom_admin_menus_action_log_config->type_alias = 'com_componentbuilder.component_custom_admin_menus'; @@ -10587,10 +10763,44 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); + } + // Create the component_router action log config object. + $component_router_action_log_config = new \stdClass(); + $component_router_action_log_config->id = null; + $component_router_action_log_config->type_title = 'COMPONENT_ROUTER'; + $component_router_action_log_config->type_alias = 'com_componentbuilder.component_router'; + $component_router_action_log_config->id_holder = 'id'; + $component_router_action_log_config->title_holder = 'joomla_component'; + $component_router_action_log_config->table_name = '#__componentbuilder_component_router'; + $component_router_action_log_config->text_prefix = 'COM_COMPONENTBUILDER'; + + // Check if component_router action log config is already in action_log_config DB. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('id'))); + $query->from($db->quoteName('#__action_log_config')); + $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($component_router_action_log_config->type_alias)); + $db->setQuery($query); + $db->execute(); + + // Set the object into the content types table. + if ($db->getNumRows()) + { + $component_router_action_log_config->id = $db->loadResult(); + $component_router_action_log_config_Updated = $db->updateObject('#__action_log_config', $component_router_action_log_config, 'id'); + } + else + { + $component_router_action_log_config_Inserted = $db->insertObject('#__action_log_config', $component_router_action_log_config); + } + + // Set db if not set already. + if (!isset($db)) + { + $db = Factory::getDbo(); } // Create the component_config action log config object. - $component_config_action_log_config = new stdClass(); + $component_config_action_log_config = new \stdClass(); $component_config_action_log_config->id = null; $component_config_action_log_config->type_title = 'COMPONENT_CONFIG'; $component_config_action_log_config->type_alias = 'com_componentbuilder.component_config'; @@ -10621,10 +10831,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_dashboard action log config object. - $component_dashboard_action_log_config = new stdClass(); + $component_dashboard_action_log_config = new \stdClass(); $component_dashboard_action_log_config->id = null; $component_dashboard_action_log_config->type_title = 'COMPONENT_DASHBOARD'; $component_dashboard_action_log_config->type_alias = 'com_componentbuilder.component_dashboard'; @@ -10655,10 +10865,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_files_folders action log config object. - $component_files_folders_action_log_config = new stdClass(); + $component_files_folders_action_log_config = new \stdClass(); $component_files_folders_action_log_config->id = null; $component_files_folders_action_log_config->type_title = 'COMPONENT_FILES_FOLDERS'; $component_files_folders_action_log_config->type_alias = 'com_componentbuilder.component_files_folders'; @@ -10689,10 +10899,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_placeholders action log config object. - $component_placeholders_action_log_config = new stdClass(); + $component_placeholders_action_log_config = new \stdClass(); $component_placeholders_action_log_config->id = null; $component_placeholders_action_log_config->type_title = 'COMPONENT_PLACEHOLDERS'; $component_placeholders_action_log_config->type_alias = 'com_componentbuilder.component_placeholders'; @@ -10723,10 +10933,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_plugins action log config object. - $component_plugins_action_log_config = new stdClass(); + $component_plugins_action_log_config = new \stdClass(); $component_plugins_action_log_config->id = null; $component_plugins_action_log_config->type_title = 'COMPONENT_PLUGINS'; $component_plugins_action_log_config->type_alias = 'com_componentbuilder.component_plugins'; @@ -10757,10 +10967,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_modules action log config object. - $component_modules_action_log_config = new stdClass(); + $component_modules_action_log_config = new \stdClass(); $component_modules_action_log_config->id = null; $component_modules_action_log_config->type_title = 'COMPONENT_MODULES'; $component_modules_action_log_config->type_alias = 'com_componentbuilder.component_modules'; @@ -10791,10 +11001,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the snippet_type action log config object. - $snippet_type_action_log_config = new stdClass(); + $snippet_type_action_log_config = new \stdClass(); $snippet_type_action_log_config->id = null; $snippet_type_action_log_config->type_title = 'SNIPPET_TYPE'; $snippet_type_action_log_config->type_alias = 'com_componentbuilder.snippet_type'; @@ -10825,10 +11035,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library_config action log config object. - $library_config_action_log_config = new stdClass(); + $library_config_action_log_config = new \stdClass(); $library_config_action_log_config->id = null; $library_config_action_log_config->type_title = 'LIBRARY_CONFIG'; $library_config_action_log_config->type_alias = 'com_componentbuilder.library_config'; @@ -10859,10 +11069,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library_files_folders_urls action log config object. - $library_files_folders_urls_action_log_config = new stdClass(); + $library_files_folders_urls_action_log_config = new \stdClass(); $library_files_folders_urls_action_log_config->id = null; $library_files_folders_urls_action_log_config->type_title = 'LIBRARY_FILES_FOLDERS_URLS'; $library_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.library_files_folders_urls'; @@ -10893,10 +11103,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_extends action log config object. - $class_extends_action_log_config = new stdClass(); + $class_extends_action_log_config = new \stdClass(); $class_extends_action_log_config->id = null; $class_extends_action_log_config->type_title = 'CLASS_EXTENDS'; $class_extends_action_log_config->type_alias = 'com_componentbuilder.class_extends'; @@ -10927,10 +11137,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module_updates action log config object. - $joomla_module_updates_action_log_config = new stdClass(); + $joomla_module_updates_action_log_config = new \stdClass(); $joomla_module_updates_action_log_config->id = null; $joomla_module_updates_action_log_config->type_title = 'JOOMLA_MODULE_UPDATES'; $joomla_module_updates_action_log_config->type_alias = 'com_componentbuilder.joomla_module_updates'; @@ -10961,10 +11171,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module_files_folders_urls action log config object. - $joomla_module_files_folders_urls_action_log_config = new stdClass(); + $joomla_module_files_folders_urls_action_log_config = new \stdClass(); $joomla_module_files_folders_urls_action_log_config->id = null; $joomla_module_files_folders_urls_action_log_config->type_title = 'JOOMLA_MODULE_FILES_FOLDERS_URLS'; $joomla_module_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.joomla_module_files_folders_urls'; @@ -10995,10 +11205,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_group action log config object. - $joomla_plugin_group_action_log_config = new stdClass(); + $joomla_plugin_group_action_log_config = new \stdClass(); $joomla_plugin_group_action_log_config->id = null; $joomla_plugin_group_action_log_config->type_title = 'JOOMLA_PLUGIN_GROUP'; $joomla_plugin_group_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_group'; @@ -11029,10 +11239,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_updates action log config object. - $joomla_plugin_updates_action_log_config = new stdClass(); + $joomla_plugin_updates_action_log_config = new \stdClass(); $joomla_plugin_updates_action_log_config->id = null; $joomla_plugin_updates_action_log_config->type_title = 'JOOMLA_PLUGIN_UPDATES'; $joomla_plugin_updates_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_updates'; @@ -11063,10 +11273,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_files_folders_urls action log config object. - $joomla_plugin_files_folders_urls_action_log_config = new stdClass(); + $joomla_plugin_files_folders_urls_action_log_config = new \stdClass(); $joomla_plugin_files_folders_urls_action_log_config->id = null; $joomla_plugin_files_folders_urls_action_log_config->type_title = 'JOOMLA_PLUGIN_FILES_FOLDERS_URLS'; $joomla_plugin_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls'; @@ -11099,12 +11309,12 @@ class com_componentbuilderInstallerScript /** * Remove folders with files - * + * * @param string $dir The path to folder to remove * @param boolean $ignore The folders and files to ignore and not remove * * @return boolean True in all is removed - * + * */ protected function removeFolder($dir, $ignore = false) { @@ -11173,7 +11383,7 @@ class com_componentbuilderInstallerScript /** * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * * @returns bool/int number of items in array on success */ @@ -11205,13 +11415,13 @@ class com_componentbuilderInstallerScript */ protected function setDynamicF0ld3rs($app, $parent) { - // get the instalation path + // get the installation path $installer = $parent->getParent(); $installPath = $installer->getPath('source'); // get all the folders $folders = Folder::folders($installPath); // check if we have folders we may want to copy - $doNotCopy = array('media','admin','site'); // Joomla already deals with these + $doNotCopy = ['media','admin','site']; // Joomla already deals with these if (count((array) $folders) > 1) { foreach ($folders as $folder) diff --git a/site/componentbuilder.php b/site/componentbuilder.php index d5fd77db9..a60acd2c9 100644 --- a/site/componentbuilder.php +++ b/site/componentbuilder.php @@ -19,8 +19,8 @@ if (file_exists($composer_autoloader)) require_once $composer_autoloader; } -// register this component namespace -spl_autoload_register(function ($class) { +// register additional namespace +\spl_autoload_register(function ($class) { // project-specific base directories and namespace prefix $search = [ 'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai', @@ -67,26 +67,28 @@ spl_autoload_register(function ($class) { } }); - +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\MVC\Controller\BaseController; // Set the component css/js -$document = JFactory::getDocument(); -$document->addStyleSheet('components/com_componentbuilder/assets/css/site.css'); -$document->addScript('components/com_componentbuilder/assets/js/site.js'); +Html::_('stylesheet', 'components/com_componentbuilder/assets/css/site.css', ['version' => 'auto']); +Html::_('script', 'components/com_componentbuilder/assets/js/site.js', ['version' => 'auto']); // Require helper files JLoader::register('ComponentbuilderHelper', __DIR__ . '/helpers/componentbuilder.php'); JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php'); JLoader::register('ComponentbuilderHelperRoute', __DIR__ . '/helpers/route.php'); -// Trigger the Global Site Event -ComponentbuilderHelper::globalEvent($document); +//Trigger the Global Site Event +ComponentbuilderHelper::globalEvent(Factory::getDocument()); // Get an instance of the controller prefixed by Componentbuilder -$controller = JControllerLegacy::getInstance('Componentbuilder'); +$controller = BaseController::getInstance('Componentbuilder'); // Perform the request task -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->execute(Factory::getApplication()->input->get('task')); // Redirect if set by the controller $controller->redirect(); diff --git a/site/controller.php b/site/controller.php index 90bb61f97..f4a4a6ea0 100644 --- a/site/controller.php +++ b/site/controller.php @@ -12,8 +12,13 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; /** * Componentbuilder Component Base Controller @@ -32,51 +37,51 @@ class ComponentbuilderController extends BaseController function display($cachable = false, $urlparams = false) { // set default view if not set - $view = $this->input->getCmd('view', ''); + $view = $this->input->getCmd('view', ''); $this->input->set('view', $view); - $isEdit = $this->checkEditView($view); - $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); - // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238) - + $isEdit = $this->checkEditView($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); + // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238) + // insure that the view is not cashable if edit view or if user is logged in - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->get('id') || $isEdit) { $cachable = false; } - + // Check for edit form. if($isEdit) { if ($layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$view, $id)) { // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); // set redirect - if ($refid > 0 && ComponentbuilderHelper::checkString($ref)) + if ($refid > 0 && StringHelper::check($ref)) { // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); } - elseif (ComponentbuilderHelper::checkString($ref)) + elseif (StringHelper::check($ref)) { // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); } else { // normal redirect back to the list default site view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=', false)); } return false; } } - + // we may need to make this more dynamic in the future. (TODO) $safeurlparams = array( 'catid' => 'INT', @@ -97,9 +102,9 @@ class ComponentbuilderController extends BaseController 'Itemid' => 'INT'); // should these not merge? - if (ComponentbuilderHelper::checkArray($urlparams)) + if (UtilitiesArrayHelper::check($urlparams)) { - $safeurlparams = ComponentbuilderHelper::mergeArrays(array($urlparams, $safeurlparams)); + $safeurlparams = UtilitiesArrayHelper::merge(array($urlparams, $safeurlparams)); } return parent::display($cachable, $safeurlparams); @@ -107,7 +112,7 @@ class ComponentbuilderController extends BaseController protected function checkEditView($view) { - if (ComponentbuilderHelper::checkString($view)) + if (StringHelper::check($view)) { $views = array( diff --git a/site/controllers/api.php b/site/controllers/api.php index 02d3a67fe..268aaaa87 100644 --- a/site/controllers/api.php +++ b/site/controllers/api.php @@ -12,10 +12,16 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use VDM\Joomla\Utilities\StringHelper; /** @@ -32,7 +38,7 @@ class ComponentbuilderControllerApi extends FormController */ protected $task; - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = ''; // safeguard for setting the return view listing to the default site view. parent::__construct($config); @@ -60,7 +66,7 @@ class ComponentbuilderControllerApi extends FormController public function translator() { // get params first - if (!isset($this->params) || !ComponentbuilderHelper::checkObject($this->params)) + if (!isset($this->params) || !ObjectHelper::check($this->params)) { $this->params = JComponentHelper::getParams('com_componentbuilder'); } @@ -120,11 +126,11 @@ class ComponentbuilderControllerApi extends FormController echo 1; } // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); // return bool echo 0; jexit(); @@ -212,20 +218,20 @@ class ComponentbuilderControllerApi extends FormController echo 1; } // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } // check if message is to be returned if (1== $returnOptionsBuild) { // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit('Access Denied!'); } } } // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); // check if message is to be returned if (1== $returnOptionsBuild) { @@ -244,7 +250,7 @@ class ComponentbuilderControllerApi extends FormController protected function getApiUser() { // return user object - return JFactory::getUser($this->params->get('api', 0, 'INT')); + return Factory::getUser($this->params->get('api', 0, 'INT')); } /** @@ -263,7 +269,7 @@ class ComponentbuilderControllerApi extends FormController // get params first if (!isset($this->params) || !ObjectHelper::check($this->params)) { - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); } // Get the model $model = componentbuilderHelper::getModel('joomla_components', JPATH_ADMINISTRATOR . '/components/com_componentbuilder'); @@ -279,83 +285,83 @@ class ComponentbuilderControllerApi extends FormController // set auto loader ComponentbuilderHelper::autoLoader('smart'); // manual backup message - $backupNotice = array(); + $backupNotice = []; // get the data to export if (UtilitiesArrayHelper::check($pks) && $model->getSmartExport($pks)) { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY'); $backupNoticeStatus = 'Success'; // set the key string if (StringHelper::check($model->key) && strlen($model->key) == 32) { $textNotice = array(); - $keyNotice = '

' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '

'; - $keyNotice .= '

' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '

'; - $textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key); + $keyNotice = '

' . Text::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '

'; + $keyNotice .= '

' . Text::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '

'; + $textNotice[] = Text::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key); // set the package owner info if ((isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner']))) { - $ownerDetails = '

' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '

'; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); + $ownerDetails = '

' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '

'; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); $ownerDetails .= '
    '; if (isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']); } // add value only if set if (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']); } // add value only if set if (isset($model->info['getKeyFrom']['website']) && StringHelper::check($model->info['getKeyFrom']['website'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']); } // add value only if set if (isset($model->info['getKeyFrom']['email']) && StringHelper::check($model->info['getKeyFrom']['email'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']); } // add value only if set if (isset($model->info['getKeyFrom']['license']) && StringHelper::check($model->info['getKeyFrom']['license'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']); } // add value only if set if (isset($model->info['getKeyFrom']['copyright']) && StringHelper::check($model->info['getKeyFrom']['copyright'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']); } $ownerDetails .= '
'; - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET'); } else { - $ownerDetails = '

' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '

'; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); - $ownerDetails .= JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '
'; - $textNotice[] = JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); - $ownerDetails .= '

' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '

'; - $textNotice[] = '## ' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS'); - $ownerDetails .= JText::_('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') . '
'; - $textNotice[] = JText::_('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'); - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); + $ownerDetails = '

' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '

'; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); + $ownerDetails .= Text::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '
'; + $textNotice[] = Text::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); + $ownerDetails .= '

' . Text::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '

'; + $textNotice[] = '## ' . Text::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS'); + $ownerDetails .= Text::_('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') . '
'; + $textNotice[] = Text::_('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'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); } } else { - $keyNotice = '

' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '

'; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY'); - $ownerDetails = JText::_('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') . '
'; - $textNotice[] = JText::_('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'); - $backupNotice[] = JText::_('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'); + $keyNotice = '

' . Text::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '

'; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY'); + $ownerDetails = Text::_('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') . '
'; + $textNotice[] = Text::_('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'); + $backupNotice[] = Text::_('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'); } // get email if ($email = $this->params->get('backup_email', null)) @@ -369,20 +375,20 @@ class ComponentbuilderControllerApi extends FormController // Build final massage. $message = $keyNotice . $ownerDetails . '
HASH: ' . $hashTracker . ''; // set the subject - $subject = JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY'); + $subject = Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY'); // email the message componentbuilderEmail::send($email, $subject, componentbuilderEmail::setTableBody($message, $subject), $plainText, 1); - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT'); } else { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED'); } } } else { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR'); $backupNoticeStatus = 'Error'; if (StringHelper::check($model->packagePath)) { @@ -392,7 +398,7 @@ class ComponentbuilderControllerApi extends FormController if (StringHelper::check($model->zipPath)) { // clear all if not successful - JFile::delete($model->zipPath); + File::delete($model->zipPath); } } // quite only if auto backup (adding this script from custom code :) @@ -400,21 +406,21 @@ class ComponentbuilderControllerApi extends FormController { echo "# " . $backupNoticeStatus . "\n" .implode("\n", $backupNotice); // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode("
", $backupNotice), $backupNoticeStatus); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode("
", $backupNotice), $backupNoticeStatus); return; } // quite only if auto backup (adding this script from custom code :) if ('backup' === $model->activeType) { - echo "# Error\n" . JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'); + echo "# Error\n" . Text::_('COM_COMPONENTBUILDER_ACCESS_DENIED'); // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), Text::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error'); return; } @@ -427,7 +433,7 @@ class ComponentbuilderControllerApi extends FormController public function worker() { // get input values - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; // get DATA $DATA = $input->post->get('VDM_DATA', null, 'STRING'); // get TASK @@ -465,14 +471,14 @@ class ComponentbuilderControllerApi extends FormController // return locked values echo ComponentbuilderHelper::lock($model->messages); // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } elseif ($result) { echo 1; // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } } @@ -481,7 +487,7 @@ class ComponentbuilderControllerApi extends FormController // not success echo 0; // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } @@ -498,13 +504,13 @@ class ComponentbuilderControllerApi extends FormController * * @since 12.2 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // to insure no other tampering return false; } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -513,7 +519,7 @@ class ComponentbuilderControllerApi extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // to insure no other tampering return false; @@ -548,7 +554,7 @@ class ComponentbuilderControllerApi extends FormController * * @since 12.2 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(JModelLegacy $model, $validData = []) { } } diff --git a/site/controllers/help.php b/site/controllers/help.php index 8beb6bb23..6fa11c5f9 100644 --- a/site/controllers/help.php +++ b/site/controllers/help.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -29,12 +32,12 @@ class ComponentbuilderControllerHelp extends BaseController public function help() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); - if($token == $call_token) + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) { $task = $this->getTask(); switch($task){ @@ -71,8 +74,8 @@ class ComponentbuilderControllerHelp extends BaseController protected function getHelpDocumentText($id) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true); + $db = Factory::getDbo(); + $query = $db->getQuery(true); $query->select(array('a.title','a.content')); $query->from('#__componentbuilder_help_document AS a'); $query->where('a.id = '.(int) $id); @@ -82,21 +85,21 @@ class ComponentbuilderControllerHelp extends BaseController $db->execute(); if($db->getNumRows()) { - $text = array(); + $text = []; $document = $db->loadObject(); // fix image issue - $images['src="images'] = 'src="'.JURI::root().'images'; - $images["src='images"] = "src='".JURI::root()."images"; - $images['src="/images'] = 'src="'.JURI::root().'images'; - $images["src='/images"] = "src='".JURI::root()."images"; + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; // set document template $text[] = ""; $text[] = ''; $text[] = ""; $text[] = ''; $text[] = "".$document->title.""; - $text[] = ''; - $text[] = ''; + $text[] = ''; + $text[] = ''; $text[] = ""; $text[] = '
'; $text[] = '
'; diff --git a/site/helpers/categoryfield.php b/site/helpers/categoryfield.php index 1f1c5bbb2..0f4648101 100644 --- a/site/helpers/categoryfield.php +++ b/site/helpers/categoryfield.php @@ -23,7 +23,7 @@ class ComponentbuilderFieldCategories extends JCategories * @param array $options Array of options * */ - public function __construct($options = array()) + public function __construct($options = []) { $options['table'] = '#__componentbuilder_field'; $options['extension'] = 'com_componentbuilder.field'; diff --git a/site/helpers/categoryfieldtype.php b/site/helpers/categoryfieldtype.php index fc72564d9..59d4b8de1 100644 --- a/site/helpers/categoryfieldtype.php +++ b/site/helpers/categoryfieldtype.php @@ -23,7 +23,7 @@ class ComponentbuilderFieldtypeCategories extends JCategories * @param array $options Array of options * */ - public function __construct($options = array()) + public function __construct($options = []) { $options['table'] = '#__componentbuilder_fieldtype'; $options['extension'] = 'com_componentbuilder.fieldtype'; diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index d645a8600..41e390406 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -19,8 +19,8 @@ if (file_exists($composer_autoloader)) require_once $composer_autoloader; } -// register this component namespace -spl_autoload_register(function ($class) { +// register additional namespace +\spl_autoload_register(function ($class) { // project-specific base directories and namespace prefix $search = [ 'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai', @@ -67,16 +67,26 @@ spl_autoload_register(function ($class) { } }); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Access\Access; +use Joomla\CMS\Access\Rules as AccessRules; +use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Language\Language; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Version; use Joomla\Registry\Registry; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities; use Joomla\Archive\Archive; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Filesystem\Path; -use VDM\Joomla\Componentbuilder\Compiler\Factory; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Openai\Factory as OpenaiFactory; use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; @@ -84,8 +94,17 @@ use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Componentbuilder\Compiler\Utilities\FieldHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CompilerFactory; use VDM\Joomla\Utilities\Base64Helper; use VDM\Joomla\FOF\Encrypt\AES; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\String\FieldHelper as StringFieldHelper; +use VDM\Joomla\Utilities\String\TypeHelper; +use VDM\Joomla\Utilities\String\NamespaceHelper; +use VDM\Joomla\Utilities\MathHelper; +use VDM\Joomla\Utilities\String\PluginHelper; +use VDM\Joomla\Utilities\GuidHelper; +use VDM\Joomla\Utilities\Component\Helper; use VDM\Joomla\Utilities\FormHelper; /** @@ -93,24 +112,19 @@ use VDM\Joomla\Utilities\FormHelper; */ abstract class ComponentbuilderHelper { - /** - * Adding the utilities trait to this class - * - * @deprecated 4.0 - Check the trait methods for details, a legacy implementation - */ - use Utilities; - - /** - * get the Component Code Name - */ - public static $ComponentCodeName = 'componentbuilder'; - /** * Composer Switch - * + * * @var array */ - protected static $composer = array(); + protected static $composer = []; + + /** + * The Main Active Language + * + * @var string + */ + public static $langTag; /** * The Global Site Event Method. @@ -124,7 +138,7 @@ abstract class ComponentbuilderHelper /** * Just to Add the OPEN AI api to JCB (soon) - * Factory + * OpenaiFactory **/ /** @@ -245,9 +259,9 @@ abstract class ComponentbuilderHelper if ('property' === $type || 'method' === $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Get user object - $user = JFactory::getUser(); + $user = Factory::getUser(); // Create a new query object. $query = $db->getQuery(true); // get method @@ -651,7 +665,7 @@ abstract class ComponentbuilderHelper if ('property' === $table || 'method' === $table) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); // get method @@ -837,7 +851,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = ComponentHelper::getParams('com_componentbuilder'); } // get the global company details if (!UtilitiesArrayHelper::check(self::$localCompany)) @@ -865,7 +879,7 @@ abstract class ComponentbuilderHelper // get the library files, folders, and urls $files = array(); // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('b.name','a.addurls','a.addfolders','a.addfiles'))); @@ -917,13 +931,13 @@ abstract class ComponentbuilderHelper if (isset($url['path'])) { // load document script - $files[md5($url['path'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LOCAL'); + $files[md5($url['path'])] = '(' . Text::_('URL') . ') ' . basename($url['url']) . ' - ' . Text::_('COM_COMPONENTBUILDER_LOCAL'); } // check if link must be added if (isset($url['url']) && ((isset($url['type']) && $url['type'] == 1) || (isset($url['type']) && $url['type'] == 3) || !isset($url['type']))) { // load url also if not building document - $files[md5($url['url'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LINK'); + $files[md5($url['url'])] = '(' . Text::_('URL') . ') ' . basename($url['url']) . ' - ' . Text::_('COM_COMPONENTBUILDER_LINK'); } } } @@ -947,12 +961,12 @@ abstract class ComponentbuilderHelper if (isset($pathInfo['extension']) && $pathInfo['extension']) { // load document script - $files[md5($path)] = '(' . JText::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; + $files[md5($path)] = '(' . Text::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; } else { // load document script - $files[md5($path.'/'.trim($file['file'],'/'))] = '(' . JText::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; + $files[md5($path.'/'.trim($file['file'],'/'))] = '(' . Text::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; } } } @@ -969,7 +983,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = ComponentHelper::getParams('com_componentbuilder'); } // reset bucket $bucket = array(); @@ -1007,7 +1021,7 @@ abstract class ComponentbuilderHelper // load per path foreach($paths as $path) { - $files[md5($root.'/'.trim($path, '/'))] = '(' . JText::_('COM_COMPONENTBUILDER_FOLDER') . ') ' . basename($path) . ' - ' . basename($root); + $files[md5($root.'/'.trim($path, '/'))] = '(' . Text::_('COM_COMPONENTBUILDER_FOLDER') . ') ' . basename($path) . ' - ' . basename($root); } } } @@ -1062,7 +1076,7 @@ abstract class ComponentbuilderHelper public static function getComponentIDs() { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('id'))); @@ -1204,7 +1218,7 @@ abstract class ComponentbuilderHelper $target = trim($_table) . '.' . trim($_key) . '.' . trim($_value); if (!isset(self::$globalUpdater[$target])) { - self::$globalUpdater[$target] = new stdClass; + self::$globalUpdater[$target] = new \stdClass; self::$globalUpdater[$target]->{$_key} = (int) $_value; } // load the new subform values to global updater @@ -1239,7 +1253,7 @@ abstract class ComponentbuilderHelper if (UtilitiesArrayHelper::check(self::$globalUpdater)) { // get the database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); foreach (self::$globalUpdater as $tableKeyID => $object) { // get the table @@ -1269,7 +1283,7 @@ abstract class ComponentbuilderHelper { // get the model $model = self::getModel($type); - $app = \JFactory::getApplication(); + $app = Factory::getApplication(); // get item if ($item = $model->getItem($id)) { @@ -1451,14 +1465,14 @@ abstract class ComponentbuilderHelper public static function getPackageOwnerDetailsDisplay(&$info, $trust = false) { $hasOwner = false; - $ownerDetails = ''; + $ownerDetails = ''; $ownerDetails .= '
'; // load the list items foreach (self::$pkOwnerSearch as $key => $dd) { if ($value = self::getPackageOwnerValue($key, $info)) { - $ownerDetails .= JText::sprintf($dd, $value); + $ownerDetails .= Text::sprintf($dd, $value); // check if we have a owner/source name if (('owner' === $key || 'company' === $key) && !$hasOwner) { @@ -1473,7 +1487,7 @@ abstract class ComponentbuilderHelper if ($hasOwner && isset($info['getKeyFrom']['buy_link']) && UtilitiesStringHelper::check($info['getKeyFrom']['buy_link'])) { $ownerDetails .= '
'; - $ownerDetails .= JText::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA', 'class="btn btn-primary" href="'.$info['getKeyFrom']['buy_link'].'" target="_blank" title="get a key from '.$owner.'"', $owner); + $ownerDetails .= Text::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA', 'class="btn btn-primary" href="'.$info['getKeyFrom']['buy_link'].'" target="_blank" title="get a key from '.$owner.'"', $owner); } // add more custom links elseif ($hasOwner && isset($info['getKeyFrom']['buy_links']) && UtilitiesArrayHelper::check($info['getKeyFrom']['buy_links'])) @@ -1481,7 +1495,7 @@ abstract class ComponentbuilderHelper $buttons = array(); foreach ($info['getKeyFrom']['buy_links'] as $keyName => $link) { - $buttons[] = JText::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA', $owner, 'class="btn btn-primary" href="'.$link.'" target="_blank" title="get a key from '.$owner.'"', $keyName); + $buttons[] = Text::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA', $owner, 'class="btn btn-primary" href="'.$link.'" target="_blank" title="get a key from '.$owner.'"', $keyName); } $ownerDetails .= '
'; $ownerDetails .= implode('
', $buttons); @@ -1489,10 +1503,10 @@ abstract class ComponentbuilderHelper // return the owner details if (!$hasOwner) { - $ownerDetails = '

' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND') . '

'; + $ownerDetails = '

' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND') . '

'; if (!$trust) { - $ownerDetails .= '

' . JText::_('COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE') . '

'; + $ownerDetails .= '

' . Text::_('COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE') . '

'; } } return '
'.$ownerDetails.'
'; @@ -1574,11 +1588,11 @@ abstract class ComponentbuilderHelper $display[] = $name; if ($needKey) { - $display[] = ' - ' . JText::sprintf('COM_COMPONENTBUILDER_PAIDLOCKED') . ''; + $display[] = ' - ' . Text::sprintf('COM_COMPONENTBUILDER_PAIDLOCKED') . ''; } else { - $display[] = ' - ' . JText::sprintf('COM_COMPONENTBUILDER_FREEOPEN') . ''; + $display[] = ' - ' . Text::sprintf('COM_COMPONENTBUILDER_FREEOPEN') . ''; } $display[] = '

'; $display[] = $info['short_description'][$key]; @@ -1589,7 +1603,7 @@ abstract class ComponentbuilderHelper { if (isset($info[$li]) && isset($info[$li][$key])) { - $display[] = '
  • '.JText::sprintf($value, $info[$li][$key]).'
  • '; + $display[] = '
  • '.Text::sprintf($value, $info[$li][$key]).'
  • '; } } $display[] = ''; @@ -1603,7 +1617,7 @@ abstract class ComponentbuilderHelper { if (isset($info[$other]) && isset($info[$other][$key])) { - $display[] = JText::sprintf($value, $info[$other][$key]); + $display[] = Text::sprintf($value, $info[$other][$key]); } } $display[] = '

    '; @@ -1617,7 +1631,7 @@ abstract class ComponentbuilderHelper } return implode("\n",$display); } - return '
    '.JText::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
    '; + return '
    '.Text::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
    '; } /** @@ -1626,7 +1640,7 @@ abstract class ComponentbuilderHelper public static function getDbTableColumns($tableName, $as, $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // get the columns $columns = $db->getTableColumns("#__" . $tableName); // set the type (multi or single) @@ -1654,7 +1668,7 @@ abstract class ComponentbuilderHelper public static function getViewTableColumns($admin_view, $as, $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -1734,7 +1748,7 @@ abstract class ComponentbuilderHelper public static function getFieldNameAndType($id, $spacers = false) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -1802,7 +1816,7 @@ abstract class ComponentbuilderHelper if (!$bool) { return array ( - 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER'), + 'message' => Text::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER'), 'status' => 'danger'); } return false; @@ -1815,7 +1829,7 @@ abstract class ComponentbuilderHelper if (!$bool) { return array ( - 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE'), + 'message' => Text::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE'), 'status' => 'danger'); } return false; @@ -1825,7 +1839,7 @@ abstract class ComponentbuilderHelper { return array ( 'name' => $name, - 'message' => JText::_('COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK'), + 'message' => Text::_('COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK'), 'status' => 'success'); } return true; @@ -1857,7 +1871,7 @@ abstract class ComponentbuilderHelper protected static function getPlaceholderTarget($id, $name) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('id', 'target'))); @@ -1886,7 +1900,7 @@ abstract class ComponentbuilderHelper if (!isset(self::$exPowers[$id])) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('a.id'))); @@ -2203,7 +2217,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // set the defaults self::setSessionDefaults(); @@ -2216,7 +2230,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // set to local memory to speed up program self::$localSession[$key] = $value; @@ -2231,7 +2245,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // check if in local memory if (!isset(self::$localSession[$key])) @@ -2252,7 +2266,7 @@ abstract class ComponentbuilderHelper public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $dbDefaults = false) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -2294,7 +2308,7 @@ abstract class ComponentbuilderHelper // value to check since there are false and null values even 0 in the values returned $confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB'; // set the headers - $field['values_description'] .= '' . JText::_('COM_COMPONENTBUILDER_PROPERTY') . '' . JText::_('COM_COMPONENTBUILDER_EXAMPLE') . '' . JText::_('COM_COMPONENTBUILDER_DESCRIPTION') . ''; + $field['values_description'] .= '' . Text::_('COM_COMPONENTBUILDER_PROPERTY') . '' . Text::_('COM_COMPONENTBUILDER_EXAMPLE') . '' . Text::_('COM_COMPONENTBUILDER_DESCRIPTION') . ''; foreach ($properties as $property) { $example = (isset($property['example']) && UtilitiesStringHelper::check($property['example'])) ? $property['example'] : ''; @@ -2425,7 +2439,7 @@ abstract class ComponentbuilderHelper public static function getFieldTypesProperties($targets = array(), $filter = array(), $exclude = array(), $type = 'id', $operator = 'IN') { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -2659,7 +2673,7 @@ abstract class ComponentbuilderHelper if (isset($errorMessage['error']) && UtilitiesStringHelper::check($errorMessage['error'])) { // set the error in the application - JFactory::getApplication()->enqueueMessage($errorMessage['error'], 'Error'); + Factory::getApplication()->enqueueMessage($errorMessage['error'], 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $errorMessage['error']; } @@ -2668,9 +2682,9 @@ abstract class ComponentbuilderHelper elseif (UtilitiesStringHelper::check($target)) { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $target); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $target); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2679,9 +2693,9 @@ abstract class ComponentbuilderHelper elseif ('nomemory' !== $type) { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $type); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $type); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2690,9 +2704,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID_DATA', $url, $type); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID_DATA', $url, $type); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2702,9 +2716,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA', $url); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA', $url); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2714,9 +2728,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST', $url); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST', $url); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2764,7 +2778,7 @@ abstract class ComponentbuilderHelper $type = 'data'; } // add little more help if it is an access token issue - $errorMessage = JText::sprintf('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', $errorMessage, $type); + $errorMessage = Text::sprintf('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', $errorMessage, $type); } // set error notice $message['error'] = $errorMessage; @@ -2854,7 +2868,7 @@ abstract class ComponentbuilderHelper $script['display'][] = self::_t(3) . "// Include helper submenu"; $script['display'][] = self::_t(3) . "[[[-#-#-Component]]]Helper::addSubmenu('import');"; $script['display'][] = self::_t(2) . "}"; - $script['display'][] = PHP_EOL . self::_t(2) . "\$paths = new stdClass;"; + $script['display'][] = PHP_EOL . self::_t(2) . "\$paths = new \stdClass;"; $script['display'][] = self::_t(2) . "\$paths->first = '';"; $script['display'][] = self::_t(2) . "\$state = \$this->get('state');"; $script['display'][] = PHP_EOL . self::_t(2) . "\$this->paths = &\$paths;"; @@ -2868,7 +2882,7 @@ abstract class ComponentbuilderHelper $script['display'][] = self::_t(3) . "\$this->sidebar = JHtmlSidebar::render();"; $script['display'][] = self::_t(2) . "}"; $script['display'][] = PHP_EOL . self::_t(2) . "// get the session object"; - $script['display'][] = self::_t(2) . "\$session = JFactory::getSession();"; + $script['display'][] = self::_t(2) . "\$session = Factory::getSession();"; $script['display'][] = self::_t(2) . "// check if it has package"; $script['display'][] = self::_t(2) . "\$this->hasPackage" . self::_t(1) . "= \$session->get('hasPackage', false);"; $script['display'][] = self::_t(2) . "\$this->dataType" . self::_t(1) . "= \$session->get('dataType', false);"; @@ -2901,11 +2915,11 @@ abstract class ComponentbuilderHelper $script['setdata'][] = self::_t(1) . "**/"; $script['setdata'][] = self::_t(1) . "protected function setData(\$package,\$table,\$target_headers)"; $script['setdata'][] = self::_t(1) . "{"; - $script['setdata'][] = self::_t(2) . "if ([[[-#-#-Component]]]Helper::checkArray(\$target_headers))"; + $script['setdata'][] = self::_t(2) . "if (Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$target_headers))"; $script['setdata'][] = self::_t(2) . "{"; $script['setdata'][] = self::_t(3) . "// make sure the file is loaded"; $script['setdata'][] = self::_t(3) . "[[[-#-#-Component]]]Helper::composerAutoload('phpspreadsheet');"; - $script['setdata'][] = self::_t(3) . "\$jinput = JFactory::getApplication()->input;"; + $script['setdata'][] = self::_t(3) . "\$jinput = Factory::getApplication()->input;"; $script['setdata'][] = self::_t(3) . "foreach(\$target_headers as \$header)"; $script['setdata'][] = self::_t(3) . "{"; $script['setdata'][] = self::_t(4) . "if ((\$column = \$jinput->getString(\$header, false)) !== false ||"; @@ -2945,16 +2959,16 @@ abstract class ComponentbuilderHelper $script['headers'][] = self::_t(1) . "public function getExImPortHeaders()"; $script['headers'][] = self::_t(1) . "{"; $script['headers'][] = self::_t(2) . "// Get a db connection."; - $script['headers'][] = self::_t(2) . "\$db = JFactory::getDbo();"; + $script['headers'][] = self::_t(2) . "\$db = Factory::getDbo();"; $script['headers'][] = self::_t(2) . "// get the columns"; $script['headers'][] = self::_t(2) . "\$columns = \$db->getTableColumns(\"#__[[[-#-#-component]]]_[[[-#-#-view]]]\");"; - $script['headers'][] = self::_t(2) . "if ([[[-#-#-Component]]]Helper::checkArray(\$columns))"; + $script['headers'][] = self::_t(2) . "if (Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$columns))"; $script['headers'][] = self::_t(2) . "{"; $script['headers'][] = self::_t(3) . "// remove the headers you don't import/export."; $script['headers'][] = self::_t(3) . "unset(\$columns['asset_id']);"; $script['headers'][] = self::_t(3) . "unset(\$columns['checked_out']);"; $script['headers'][] = self::_t(3) . "unset(\$columns['checked_out_time']);"; - $script['headers'][] = self::_t(3) . "\$headers = new stdClass();"; + $script['headers'][] = self::_t(3) . "\$headers = new \stdClass();"; $script['headers'][] = self::_t(3) . "foreach (\$columns as \$column => \$type)"; $script['headers'][] = self::_t(3) . "{"; $script['headers'][] = self::_t(4) . "\$headers->{\$column} = \$column;"; @@ -2978,10 +2992,10 @@ abstract class ComponentbuilderHelper $script['save'][] = self::_t(1) . "protected function save(\$data,\$table)"; $script['save'][] = self::_t(1) . "{"; $script['save'][] = self::_t(2) . "// import the data if there is any"; - $script['save'][] = self::_t(2) . "if([[[-#-#-Component]]]Helper::checkArray(\$data['array']))"; + $script['save'][] = self::_t(2) . "if(Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$data['array']))"; $script['save'][] = self::_t(2) . "{"; $script['save'][] = self::_t(3) . "// get user object"; - $script['save'][] = self::_t(3) . "\$user" . self::_t(2) . "= JFactory::getUser();"; + $script['save'][] = self::_t(3) . "\$user" . self::_t(2) . "= Factory::getUser();"; $script['save'][] = self::_t(3) . "// remove header if it has headers"; $script['save'][] = self::_t(3) . "\$id_key" . self::_t(1) . "= \$data['target_headers']['id'];"; $script['save'][] = self::_t(3) . "\$published_key" . self::_t(1) . "= \$data['target_headers']['published'];"; @@ -2996,14 +3010,14 @@ abstract class ComponentbuilderHelper $script['save'][] = self::_t(3) . "}"; $script['save'][] = self::_t(3) . ""; $script['save'][] = self::_t(3) . "// make sure there is still values in array and that it was not only headers"; - $script['save'][] = self::_t(3) . "if([[[-#-#-Component]]]Helper::checkArray(\$data['array']) && \$user->authorise(\$table.'.import', 'com_[[[-#-#-component]]]') && \$user->authorise('core.import', 'com_[[[-#-#-component]]]'))"; + $script['save'][] = self::_t(3) . "if(Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$data['array']) && \$user->authorise(\$table.'.import', 'com_[[[-#-#-component]]]') && \$user->authorise('core.import', 'com_[[[-#-#-component]]]'))"; $script['save'][] = self::_t(3) . "{"; $script['save'][] = self::_t(4) . "// set target."; $script['save'][] = self::_t(4) . "\$target" . self::_t(1) . "= array_flip(\$data['target_headers']);"; $script['save'][] = self::_t(4) . "// Get a db connection."; - $script['save'][] = self::_t(4) . "\$db = JFactory::getDbo();"; + $script['save'][] = self::_t(4) . "\$db = Factory::getDbo();"; $script['save'][] = self::_t(4) . "// set some defaults"; - $script['save'][] = self::_t(4) . "\$todayDate" . self::_t(2) . "= JFactory::getDate()->toSql();"; + $script['save'][] = self::_t(4) . "\$todayDate" . self::_t(2) . "= Factory::getDate()->toSql();"; $script['save'][] = self::_t(4) . "// get global action permissions"; $script['save'][] = self::_t(4) . "\$canDo" . self::_t(3) . "= [[[-#-#-Component]]]Helper::getActions(\$table);"; $script['save'][] = self::_t(4) . "\$canEdit" . self::_t(2) . "= \$canDo->get('core.edit');"; @@ -3191,7 +3205,7 @@ abstract class ComponentbuilderHelper { $script['view'] = array(); $script['view'][] = "