From 302328c92a9c360597340b119c232ff3846b4074 Mon Sep 17 00:00:00 2001
From: Llewellyn van der Merwe
Date: Thu, 26 Nov 2020 19:33:39 +0200
Subject: [PATCH] Add getFieldsetXML and getFieldXMLString method to build
fields in compiler gh-378. Refactoring the compiler to use camelcase for view
code names.
---
README.md | 6 +-
admin/README.txt | 6 +-
admin/compiler/joomla_3/JViewLegacy_list.php | 2 +-
admin/controllers/joomla_components.php | 2 +-
admin/helpers/compiler/c_Fields.php | 872 ++++---
admin/helpers/compiler/e_Interpretation.php | 2152 +++++++++--------
admin/helpers/compiler/f_Infusion.php | 472 ++--
.../en-GB/en-GB.com_componentbuilder.ini | 2 +-
admin/sql/install.mysql.utf8.sql | 2 +-
admin/views/admin_views/tmpl/default_body.php | 7 +-
admin/views/admin_views/tmpl/default_head.php | 12 +-
admin/views/admin_views/view.html.php | 158 +-
.../views/admins_custom_tabs/tmpl/default.php | 3 +-
.../admins_custom_tabs/tmpl/default_body.php | 7 +-
.../admins_custom_tabs/tmpl/default_head.php | 2 +-
admin/views/admins_custom_tabs/view.html.php | 4 +-
admin/views/admins_fields/tmpl/default.php | 3 +-
.../views/admins_fields/tmpl/default_body.php | 7 +-
.../views/admins_fields/tmpl/default_head.php | 2 +-
admin/views/admins_fields/view.html.php | 4 +-
.../admins_fields_conditions/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../admins_fields_conditions/view.html.php | 4 +-
.../admins_fields_relations/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../admins_fields_relations/view.html.php | 4 +-
admin/views/class_extendings/tmpl/default.php | 3 +-
.../class_extendings/tmpl/default_body.php | 7 +-
.../class_extendings/tmpl/default_head.php | 2 +-
admin/views/class_extendings/view.html.php | 4 +-
admin/views/class_methods/tmpl/default.php | 3 +-
.../views/class_methods/tmpl/default_body.php | 7 +-
.../views/class_methods/tmpl/default_head.php | 2 +-
admin/views/class_methods/view.html.php | 4 +-
admin/views/class_properties/tmpl/default.php | 3 +-
.../class_properties/tmpl/default_body.php | 7 +-
.../class_properties/tmpl/default_head.php | 2 +-
admin/views/class_properties/view.html.php | 4 +-
.../components_admin_views/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../components_admin_views/view.html.php | 4 +-
.../views/components_config/tmpl/default.php | 3 +-
.../components_config/tmpl/default_body.php | 7 +-
.../components_config/tmpl/default_head.php | 2 +-
admin/views/components_config/view.html.php | 4 +-
.../tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../view.html.php | 4 +-
.../tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../view.html.php | 4 +-
.../components_dashboard/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../views/components_dashboard/view.html.php | 4 +-
.../components_files_folders/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../components_files_folders/view.html.php | 4 +-
.../views/components_modules/tmpl/default.php | 3 +-
.../components_modules/tmpl/default_body.php | 7 +-
.../components_modules/tmpl/default_head.php | 2 +-
admin/views/components_modules/view.html.php | 4 +-
.../components_mysql_tweaks/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../components_mysql_tweaks/view.html.php | 4 +-
.../components_placeholders/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../components_placeholders/view.html.php | 4 +-
.../views/components_plugins/tmpl/default.php | 3 +-
.../components_plugins/tmpl/default_body.php | 7 +-
.../components_plugins/tmpl/default_head.php | 2 +-
admin/views/components_plugins/view.html.php | 4 +-
.../components_site_views/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../views/components_site_views/view.html.php | 4 +-
.../views/components_updates/tmpl/default.php | 3 +-
.../components_updates/tmpl/default_body.php | 7 +-
.../components_updates/tmpl/default_head.php | 2 +-
admin/views/components_updates/view.html.php | 4 +-
.../views/custom_admin_views/tmpl/default.php | 3 +-
.../custom_admin_views/tmpl/default_body.php | 7 +-
.../custom_admin_views/tmpl/default_head.php | 2 +-
admin/views/custom_admin_views/view.html.php | 4 +-
.../views/custom_codes/tmpl/default_body.php | 7 +-
.../views/custom_codes/tmpl/default_head.php | 2 +-
admin/views/custom_codes/view.html.php | 4 +-
.../views/dynamic_gets/tmpl/default_body.php | 7 +-
.../views/dynamic_gets/tmpl/default_head.php | 2 +-
admin/views/dynamic_gets/view.html.php | 4 +-
admin/views/fields/tmpl/default_body.php | 7 +-
admin/views/fields/tmpl/default_head.php | 2 +-
admin/views/fields/view.html.php | 4 +-
admin/views/fieldtypes/tmpl/default.php | 3 +-
admin/views/fieldtypes/tmpl/default_body.php | 7 +-
admin/views/fieldtypes/tmpl/default_head.php | 2 +-
admin/views/fieldtypes/view.html.php | 4 +-
admin/views/help_documents/tmpl/default.php | 3 +-
.../help_documents/tmpl/default_body.php | 7 +-
.../help_documents/tmpl/default_head.php | 2 +-
admin/views/help_documents/view.html.php | 4 +-
.../joomla_components/tmpl/default_body.php | 7 +-
.../joomla_components/tmpl/default_head.php | 2 +-
admin/views/joomla_components/view.html.php | 4 +-
.../joomla_modules/tmpl/default_body.php | 7 +-
.../joomla_modules/tmpl/default_head.php | 2 +-
admin/views/joomla_modules/view.html.php | 4 +-
.../tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../view.html.php | 4 +-
.../joomla_modules_updates/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../joomla_modules_updates/view.html.php | 4 +-
.../joomla_plugin_groups/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../views/joomla_plugin_groups/view.html.php | 4 +-
.../joomla_plugins/tmpl/default_body.php | 7 +-
.../joomla_plugins/tmpl/default_head.php | 2 +-
admin/views/joomla_plugins/view.html.php | 4 +-
.../tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../view.html.php | 4 +-
.../joomla_plugins_updates/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../joomla_plugins_updates/view.html.php | 4 +-
.../language_translations/tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../views/language_translations/view.html.php | 4 +-
admin/views/languages/tmpl/default_body.php | 7 +-
admin/views/languages/tmpl/default_head.php | 2 +-
admin/views/languages/view.html.php | 4 +-
admin/views/layouts/tmpl/default_body.php | 7 +-
admin/views/layouts/tmpl/default_head.php | 2 +-
admin/views/layouts/view.html.php | 4 +-
admin/views/libraries/tmpl/default.php | 3 +-
admin/views/libraries/tmpl/default_body.php | 7 +-
admin/views/libraries/tmpl/default_head.php | 2 +-
admin/views/libraries/view.html.php | 4 +-
admin/views/libraries_config/tmpl/default.php | 3 +-
.../libraries_config/tmpl/default_body.php | 7 +-
.../libraries_config/tmpl/default_head.php | 2 +-
admin/views/libraries_config/view.html.php | 4 +-
.../tmpl/default.php | 3 +-
.../tmpl/default_body.php | 7 +-
.../tmpl/default_head.php | 2 +-
.../view.html.php | 4 +-
admin/views/placeholders/tmpl/default.php | 3 +-
.../views/placeholders/tmpl/default_body.php | 7 +-
.../views/placeholders/tmpl/default_head.php | 2 +-
admin/views/placeholders/view.html.php | 4 +-
admin/views/servers/tmpl/default.php | 3 +-
admin/views/servers/tmpl/default_body.php | 7 +-
admin/views/servers/tmpl/default_head.php | 2 +-
admin/views/servers/view.html.php | 4 +-
admin/views/site_views/tmpl/default.php | 3 +-
admin/views/site_views/tmpl/default_body.php | 7 +-
admin/views/site_views/tmpl/default_head.php | 2 +-
admin/views/site_views/view.html.php | 4 +-
admin/views/snippet_types/tmpl/default.php | 3 +-
.../views/snippet_types/tmpl/default_body.php | 7 +-
.../views/snippet_types/tmpl/default_head.php | 2 +-
admin/views/snippet_types/view.html.php | 4 +-
admin/views/snippets/tmpl/default.php | 3 +-
admin/views/snippets/tmpl/default_body.php | 7 +-
admin/views/snippets/tmpl/default_head.php | 2 +-
admin/views/snippets/view.html.php | 4 +-
admin/views/templates/tmpl/default_body.php | 7 +-
admin/views/templates/tmpl/default_head.php | 2 +-
admin/views/templates/view.html.php | 4 +-
admin/views/validation_rules/tmpl/default.php | 3 +-
.../validation_rules/tmpl/default_body.php | 7 +-
.../validation_rules/tmpl/default_head.php | 2 +-
admin/views/validation_rules/view.html.php | 4 +-
componentbuilder.xml | 4 +-
site/controllers/api.php | 2 +-
.../en-GB/en-GB.com_componentbuilder.ini | 2 +-
190 files changed, 2186 insertions(+), 2224 deletions(-)
diff --git a/README.md b/README.md
index fba3b9200..99086cb7a 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder
The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
-Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
+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 [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.11.7) with **ALL** its features and **ALL** concepts totally open-source and free!
@@ -144,11 +144,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
-+ *Last Build*: 21st November, 2020
++ *Last Build*: 24th November, 2020
+ *Version*: 2.11.7
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **284083**
++ *Line count*: **283833**
+ *Field count*: **1537**
+ *File count*: **1799**
+ *Folder count*: **304**
diff --git a/admin/README.txt b/admin/README.txt
index fba3b9200..99086cb7a 100644
--- a/admin/README.txt
+++ b/admin/README.txt
@@ -10,7 +10,7 @@ This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder
The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
-Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
+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 [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.11.7) with **ALL** its features and **ALL** concepts totally open-source and free!
@@ -144,11 +144,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
-+ *Last Build*: 21st November, 2020
++ *Last Build*: 24th November, 2020
+ *Version*: 2.11.7
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **284083**
++ *Line count*: **283833**
+ *Field count*: **1537**
+ *File count*: **1799**
+ *Folder count*: **304**
diff --git a/admin/compiler/joomla_3/JViewLegacy_list.php b/admin/compiler/joomla_3/JViewLegacy_list.php
index e05449944..0f819adde 100644
--- a/admin/compiler/joomla_3/JViewLegacy_list.php
+++ b/admin/compiler/joomla_3/JViewLegacy_list.php
@@ -39,7 +39,7 @@ class ###Component###View###Views### extends JViewLegacy
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();###ADMIN_DIPLAY_METHOD###
- $this->saveOrder = $this->listOrder == 'ordering';
+ $this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
diff --git a/admin/controllers/joomla_components.php b/admin/controllers/joomla_components.php
index 6dae9b775..b6268f976 100644
--- a/admin/controllers/joomla_components.php
+++ b/admin/controllers/joomla_components.php
@@ -391,7 +391,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
$subject = JText::_('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_SEND');
+ $backupNotice[] = JText::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT');
}
else
{
diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php
index 934f70b9e..306ec094e 100644
--- a/admin/helpers/compiler/c_Fields.php
+++ b/admin/helpers/compiler/c_Fields.php
@@ -375,16 +375,16 @@ class Fields extends Structure
/**
* set the Field set of a view
*
- * @param array $view The view data
- * @param string $component The component name
- * @param string $view_name_single The single view name
- * @param string $view_name_list The list view name
+ * @param array $view The view data
+ * @param string $component The component name
+ * @param string $nameSingleCode The single view name
+ * @param string $nameListCode The list view name
*
* @return string The fields set in xml
*
*/
- public function setFieldSet($view, $component, $view_name_single,
- $view_name_list
+ public function setFieldSet($view, $component, $nameSingleCode,
+ $nameListCode
) {
// setup the fieldset of this view
if (isset($view['settings']->fields)
@@ -393,12 +393,12 @@ class Fields extends Structure
// add metadata to the view
if (isset($view['metadata']) && $view['metadata'])
{
- $this->metadataBuilder[$view_name_single] = $view_name_single;
+ $this->metadataBuilder[$nameSingleCode] = $nameSingleCode;
}
// add access to the view
if (isset($view['access']) && $view['access'])
{
- $this->accessBuilder[$view_name_single] = $view_name_single;
+ $this->accessBuilder[$nameSingleCode] = $nameSingleCode;
}
// main lang prefix
$langView = $this->langPrefix . '_'
@@ -560,7 +560,7 @@ class Fields extends Structure
{
// build field set using string manipulation
return $this->stringFieldSet(
- $view, $component, $view_name_single, $view_name_list,
+ $view, $component, $nameSingleCode, $nameListCode,
$langView, $langViews
);
}
@@ -568,7 +568,7 @@ class Fields extends Structure
{
// build field set with simpleXMLElement class
return $this->simpleXMLFieldSet(
- $view, $component, $view_name_single, $view_name_list,
+ $view, $component, $nameSingleCode, $nameListCode,
$langView, $langViews
);
}
@@ -580,18 +580,18 @@ class Fields extends Structure
/**
* build field set using string manipulation
*
- * @param array $view The view data
- * @param string $component The component name
- * @param string $view_name_single The single view name
- * @param string $view_name_list The list view name
- * @param string $langView The language string of the view
- * @param string $langViews The language string of the views
+ * @param array $view The view data
+ * @param string $component The component name
+ * @param string $nameSingleCode The single view name
+ * @param string $nameListCode The list view name
+ * @param string $langView The language string of the view
+ * @param string $langViews The language string of the views
*
* @return string The fields set in xml
*
*/
- protected function stringFieldSet($view, $component, $view_name_single,
- $view_name_list, $langView, $langViews
+ protected function stringFieldSet($view, $component, $nameSingleCode,
+ $nameListCode, $langView, $langViews
) {
// set the read only
$readOnly = false;
@@ -609,8 +609,8 @@ class Fields extends Structure
$this->triggerEvent(
'jcb_ce_onBeforeBuildFields',
array(&$this->componentContext, &$dynamicFields, &$readOnly,
- &$dbkey, &$view, &$component, &$view_name_single,
- &$view_name_list, &$this->placeholders, &$langView,
+ &$dbkey, &$view, &$component, &$nameSingleCode,
+ &$nameListCode, &$this->placeholders, &$langView,
&$langViews)
);
// TODO we should add the global and local view switch if field for front end
@@ -618,7 +618,7 @@ class Fields extends Structure
{
$dynamicFields .= $this->setDynamicField(
$field, $view, $view['settings']->type, $langView,
- $view_name_single, $view_name_list, $this->placeholders, $dbkey,
+ $nameSingleCode, $nameListCode, $this->placeholders, $dbkey,
true
);
}
@@ -626,8 +626,8 @@ class Fields extends Structure
$this->triggerEvent(
'jcb_ce_onAfterBuildFields',
array(&$this->componentContext, &$dynamicFields, &$readOnly,
- &$dbkey, &$view, &$component, &$view_name_single,
- &$view_name_list, &$this->placeholders, &$langView,
+ &$dbkey, &$view, &$component, &$nameSingleCode,
+ &$nameListCode, &$this->placeholders, &$langView,
&$langViews)
);
// set the default fields
@@ -638,7 +638,7 @@ class Fields extends Structure
$fieldSet[] = $this->_t(2) . "";
// if id is not set
- if (!isset($this->fieldsNames[$view_name_single]['id']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['id']))
{
$fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"id"';
@@ -652,7 +652,7 @@ class Fields extends Structure
$this->fieldCount++;
}
// if created is not set
- if (!isset($this->fieldsNames[$view_name_single]['created']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['created']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -675,7 +675,7 @@ class Fields extends Structure
$this->fieldCount++;
}
// if created_by is not set
- if (!isset($this->fieldsNames[$view_name_single]['created_by']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['created_by']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -695,7 +695,7 @@ class Fields extends Structure
$this->fieldCount++;
}
// if published is not set
- if (!isset($this->fieldsNames[$view_name_single]['published']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['published']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -722,7 +722,7 @@ class Fields extends Structure
$this->fieldCount++;
}
// if modified is not set
- if (!isset($this->fieldsNames[$view_name_single]['modified']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['modified']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -737,7 +737,7 @@ class Fields extends Structure
$this->fieldCount++;
}
// if modified_by is not set
- if (!isset($this->fieldsNames[$view_name_single]['modified_by']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['modified_by']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -755,11 +755,11 @@ class Fields extends Structure
$this->fieldCount++;
}
// check if view has access
- if (isset($this->accessBuilder[$view_name_single])
+ if (isset($this->accessBuilder[$nameSingleCode])
&& ComponentbuilderHelper::checkString(
- $this->accessBuilder[$view_name_single]
+ $this->accessBuilder[$nameSingleCode]
)
- && !isset($this->fieldsNames[$view_name_single]['access']))
+ && !isset($this->fieldsNames[$nameSingleCode]['access']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -778,7 +778,7 @@ class Fields extends Structure
$this->fieldCount++;
}
// if ordering is not set
- if (!isset($this->fieldsNames[$view_name_single]['ordering']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['ordering']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -801,7 +801,7 @@ class Fields extends Structure
$this->fieldCount++;
}
// if version is not set
- if (!isset($this->fieldsNames[$view_name_single]['version']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['version']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -821,13 +821,13 @@ class Fields extends Structure
$this->fieldCount++;
}
// check if metadata is added to this view
- if (isset($this->metadataBuilder[$view_name_single])
+ if (isset($this->metadataBuilder[$nameSingleCode])
&& ComponentbuilderHelper::checkString(
- $this->metadataBuilder[$view_name_single]
+ $this->metadataBuilder[$nameSingleCode]
))
{
// metakey
- if (!isset($this->fieldsNames[$view_name_single]['metakey']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['metakey']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -845,7 +845,7 @@ class Fields extends Structure
$this->fieldCount++;
}
// metadesc
- if (!isset($this->fieldsNames[$view_name_single]['metadesc']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['metadesc']))
{
$fieldSet[] = $this->_t(2) . "";
@@ -872,14 +872,14 @@ class Fields extends Structure
// close fieldset
$fieldSet[] = $this->_t(1) . "";
// check if metadata is added to this view
- if (isset($this->metadataBuilder[$view_name_single])
+ if (isset($this->metadataBuilder[$nameSingleCode])
&& ComponentbuilderHelper::checkString(
- $this->metadataBuilder[$view_name_single]
+ $this->metadataBuilder[$nameSingleCode]
))
{
- if (!isset($this->fieldsNames[$view_name_single]['robots'])
- || !isset($this->fieldsNames[$view_name_single]['rights'])
- || !isset($this->fieldsNames[$view_name_single]['author']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['robots'])
+ || !isset($this->fieldsNames[$nameSingleCode]['rights'])
+ || !isset($this->fieldsNames[$nameSingleCode]['author']))
{
$fieldSet[] = PHP_EOL . $this->_t(1) . "' . PHP_EOL
+ . $this->_t(1) . $this->xmlPrettyPrint(
+ $xmlField, 'field'
+ );
+ }
+ }
+
+ // return the string
+ return $xmlField;
+ }
+
/**
* set a field
*
- * @param string $setType The set of fields type
- * @param array $fieldAttributes The field values
- * @param string $name The field name
- * @param string $typeName The field type
- * @param string $langView The language string of the view
- * @param string $view_name_single The single view name
- * @param string $view_name_list The list view name
- * @param array $placeholders The place holder and replace values
- * @param string $optionArray The option bucket array used to set the field options if needed.
- * @param array $custom Used when field is from config
- * @param string $taber The tabs to add in layout (only in string manipulation)
+ * @param string $setType The set of fields type
+ * @param array $fieldAttributes The field values
+ * @param string $name The field name
+ * @param string $typeName The field type
+ * @param string $langView The language string of the view
+ * @param string $nameSingleCode The single view name
+ * @param string $nameListCode The list view name
+ * @param array $placeholders The place holder and replace values
+ * @param string $optionArray The option bucket array used to set the field options if needed.
+ * @param array $custom Used when field is from config
+ * @param string $taber The tabs to add in layout (only in string manipulation)
*
* @return SimpleXMLElement The field in xml
*
*/
private function setField($setType, &$fieldAttributes, &$name, &$typeName,
- &$langView, &$view_name_single, &$view_name_list, $placeholders,
+ &$langView, &$nameSingleCode, &$nameListCode, $placeholders,
&$optionArray, $custom = null, $taber = ''
) {
// count the dynamic fields created
@@ -1605,7 +1725,7 @@ class Fields extends Structure
// build field set using string manipulation
return $this->stringSetField(
$setType, $fieldAttributes, $name, $typeName, $langView,
- $view_name_single, $view_name_list, $placeholders, $optionArray,
+ $nameSingleCode, $nameListCode, $placeholders, $optionArray,
$custom, $taber
);
}
@@ -1614,7 +1734,7 @@ class Fields extends Structure
// build field set with simpleXMLElement class
return $this->simpleXMLSetField(
$setType, $fieldAttributes, $name, $typeName, $langView,
- $view_name_single, $view_name_list, $placeholders, $optionArray,
+ $nameSingleCode, $nameListCode, $placeholders, $optionArray,
$custom
);
}
@@ -1623,23 +1743,23 @@ class Fields extends Structure
/**
* set a field using string manipulation
*
- * @param string $setType The set of fields type
- * @param array $fieldAttributes The field values
- * @param string $name The field name
- * @param string $typeName The field type
- * @param string $langView The language string of the view
- * @param string $view_name_single The single view name
- * @param string $view_name_list The list view name
- * @param array $placeholders The place holder and replace values
- * @param string $optionArray The option bucket array used to set the field options if needed.
- * @param array $custom Used when field is from config
- * @param string $taber The tabs to add in layout
+ * @param string $setType The set of fields type
+ * @param array $fieldAttributes The field values
+ * @param string $name The field name
+ * @param string $typeName The field type
+ * @param string $langView The language string of the view
+ * @param string $nameSingleCode The single view name
+ * @param string $nameListCode The list view name
+ * @param array $placeholders The place holder and replace values
+ * @param string $optionArray The option bucket array used to set the field options if needed.
+ * @param array $custom Used when field is from config
+ * @param string $taber The tabs to add in layout
*
* @return SimpleXMLElement The field in xml
*
*/
protected function stringSetField($setType, &$fieldAttributes, &$name,
- &$typeName, &$langView, &$view_name_single, &$view_name_list,
+ &$typeName, &$langView, &$nameSingleCode, &$nameListCode,
$placeholders, &$optionArray, $custom = null, $taber = ''
) {
$field = '';
@@ -2013,14 +2133,14 @@ class Fields extends Structure
// load the field data
$fieldsSets = array_map(
function ($id) use (
- $view_name_single, $view_name_list, $_resolverKey
+ $nameSingleCode, $nameListCode, $_resolverKey
) {
// start field
$field = array();
$field['field'] = $id;
// set the field details
$this->setFieldDetails(
- $field, $view_name_single, $view_name_list,
+ $field, $nameSingleCode, $nameListCode,
$_resolverKey
);
@@ -2037,7 +2157,7 @@ class Fields extends Structure
))
{
$r_name = $this->getFieldName(
- $fieldData, $view_name_list, $_resolverKey
+ $fieldData, $nameListCode, $_resolverKey
);
$r_typeName = $this->getFieldType($fieldData);
$r_multiple = false;
@@ -2048,7 +2168,7 @@ class Fields extends Structure
$r_fieldValues = $this->setFieldAttributes(
$fieldData, $view, $r_name, $r_typeName,
$r_multiple, $r_langLabel, $langView,
- $view_name_list, $view_name_single,
+ $nameListCode, $nameSingleCode,
$placeholders, true
);
// check if values were set
@@ -2066,7 +2186,7 @@ class Fields extends Structure
$field .= $this->setField(
'option', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray, null,
$r_taber
);
@@ -2083,7 +2203,7 @@ class Fields extends Structure
$field .= $this->setField(
'custom', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray, null,
$r_taber
);
@@ -2113,8 +2233,8 @@ class Fields extends Structure
'custom' => $custom);
// set the custom field file
$this->setCustomFieldTypeFile(
- $data, $view_name_list,
- $view_name_single
+ $data, $nameListCode,
+ $nameSingleCode
);
}
else
@@ -2123,7 +2243,7 @@ class Fields extends Structure
$field .= $this->setField(
'plain', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray, null,
$r_taber
);
@@ -2179,14 +2299,14 @@ class Fields extends Structure
// load the field data
$fieldsSets = array_map(
function ($id) use (
- $view_name_single, $view_name_list, $_resolverKey
+ $nameSingleCode, $nameListCode, $_resolverKey
) {
// start field
$field = array();
$field['field'] = $id;
// set the field details
$this->setFieldDetails(
- $field, $view_name_single, $view_name_list,
+ $field, $nameSingleCode, $nameListCode,
$_resolverKey
);
@@ -2203,7 +2323,7 @@ class Fields extends Structure
))
{
$r_name = $this->getFieldName(
- $fieldData, $view_name_list, $_resolverKey
+ $fieldData, $nameListCode, $_resolverKey
);
$r_typeName = $this->getFieldType($fieldData);
$r_multiple = false;
@@ -2214,7 +2334,7 @@ class Fields extends Structure
$r_fieldValues = $this->setFieldAttributes(
$fieldData, $view, $r_name, $r_typeName,
$r_multiple, $r_langLabel, $langView,
- $view_name_list, $view_name_single,
+ $nameListCode, $nameSingleCode,
$placeholders, true
);
// check if values were set
@@ -2232,7 +2352,7 @@ class Fields extends Structure
$field .= $this->setField(
'option', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray, null,
$r_taber
);
@@ -2256,7 +2376,7 @@ class Fields extends Structure
$field .= $this->setField(
'special', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray, null,
$r_taber
);
@@ -2274,7 +2394,7 @@ class Fields extends Structure
$field .= $this->setField(
'custom', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray, null,
$r_taber
);
@@ -2304,8 +2424,8 @@ class Fields extends Structure
'custom' => $custom);
// set the custom field file
$this->setCustomFieldTypeFile(
- $data, $view_name_list,
- $view_name_single
+ $data, $nameListCode,
+ $nameSingleCode
);
}
else
@@ -2314,7 +2434,7 @@ class Fields extends Structure
$field .= $this->setField(
'plain', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray, null,
$r_taber
);
@@ -2614,10 +2734,10 @@ class Fields extends Structure
$field .= PHP_EOL . $this->_t(2) . $taber . "/>";
}
// incase the field is in the config and has not been set
- if ('config' === $view_name_single && 'configs' === $view_name_list
- || (strpos($view_name_single, 'P|uG!n') !== false
+ if ('config' === $nameSingleCode && 'configs' === $nameListCode
+ || (strpos($nameSingleCode, 'P|uG!n') !== false
|| strpos(
- $view_name_single, 'M0dU|3'
+ $nameSingleCode, 'M0dU|3'
) !== false))
{
// set lang (just incase)
@@ -2628,7 +2748,7 @@ class Fields extends Structure
'lang' => $listLangName, 'custom' => $custom);
// set the custom field file
$this->setCustomFieldTypeFile(
- $data, $view_name_list, $view_name_single
+ $data, $nameListCode, $nameSingleCode
);
}
}
@@ -2640,22 +2760,22 @@ class Fields extends Structure
/**
* set a field with simpleXMLElement class
*
- * @param string $setType The set of fields type
- * @param array $fieldAttributes The field values
- * @param string $name The field name
- * @param string $typeName The field type
- * @param string $langView The language string of the view
- * @param string $view_name_single The single view name
- * @param string $view_name_list The list view name
- * @param array $placeholders The place holder and replace values
- * @param string $optionArray The option bucket array used to set the field options if needed.
- * @param array $custom Used when field is from config
+ * @param string $setType The set of fields type
+ * @param array $fieldAttributes The field values
+ * @param string $name The field name
+ * @param string $typeName The field type
+ * @param string $langView The language string of the view
+ * @param string $nameSingleCode The single view name
+ * @param string $nameListCode The list view name
+ * @param array $placeholders The place holder and replace values
+ * @param string $optionArray The option bucket array used to set the field options if needed.
+ * @param array $custom Used when field is from config
*
* @return SimpleXMLElement The field in xml
*
*/
protected function simpleXMLSetField($setType, &$fieldAttributes, &$name,
- &$typeName, &$langView, &$view_name_single, &$view_name_list,
+ &$typeName, &$langView, &$nameSingleCode, &$nameListCode,
$placeholders, &$optionArray, $custom = null
) {
$field = new stdClass();
@@ -3009,14 +3129,14 @@ class Fields extends Structure
// load the field data
$fieldsSets = array_map(
function ($id) use (
- $view_name_single, $view_name_list, $_resolverKey
+ $nameSingleCode, $nameListCode, $_resolverKey
) {
// start field
$field = array();
$field['field'] = $id;
// set the field details
$this->setFieldDetails(
- $field, $view_name_single, $view_name_list,
+ $field, $nameSingleCode, $nameListCode,
$_resolverKey
);
@@ -3033,7 +3153,7 @@ class Fields extends Structure
))
{
$r_name = $this->getFieldName(
- $fieldData, $view_name_list, $_resolverKey
+ $fieldData, $nameListCode, $_resolverKey
);
$r_typeName = $this->getFieldType($fieldData);
$r_multiple = false;
@@ -3042,7 +3162,7 @@ class Fields extends Structure
$r_fieldValues = $this->setFieldAttributes(
$fieldData, $view, $r_name, $r_typeName,
$r_multiple, $r_langLabel, $langView,
- $view_name_list, $view_name_single,
+ $nameListCode, $nameSingleCode,
$placeholders, true
);
// check if values were set
@@ -3061,7 +3181,7 @@ class Fields extends Structure
$fieldSetXML, $this->setField(
'option', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray
)
);
@@ -3079,7 +3199,7 @@ class Fields extends Structure
$fieldSetXML, $this->setField(
'custom', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray
)
);
@@ -3109,8 +3229,8 @@ class Fields extends Structure
'custom' => $custom);
// set the custom field file
$this->setCustomFieldTypeFile(
- $data, $view_name_list,
- $view_name_single
+ $data, $nameListCode,
+ $nameSingleCode
);
}
else
@@ -3120,7 +3240,7 @@ class Fields extends Structure
$fieldSetXML, $this->setField(
'plain', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray
)
);
@@ -3192,7 +3312,7 @@ class Fields extends Structure
// load the field data
$fieldsSets = array_map(
function ($id) use (
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$_resolverKey
) {
// start field
@@ -3200,7 +3320,7 @@ class Fields extends Structure
$field['field'] = $id;
// set the field details
$this->setFieldDetails(
- $field, $view_name_single, $view_name_list,
+ $field, $nameSingleCode, $nameListCode,
$_resolverKey
);
@@ -3217,7 +3337,7 @@ class Fields extends Structure
))
{
$r_name = $this->getFieldName(
- $fieldData, $view_name_list, $_resolverKey
+ $fieldData, $nameListCode, $_resolverKey
);
$r_typeName = $this->getFieldType($fieldData);
$r_multiple = false;
@@ -3226,7 +3346,7 @@ class Fields extends Structure
$r_fieldValues = $this->setFieldAttributes(
$fieldData, $view, $r_name, $r_typeName,
$r_multiple, $r_langLabel, $langView,
- $view_name_list, $view_name_single,
+ $nameListCode, $nameSingleCode,
$placeholders, true
);
// check if values were set
@@ -3245,7 +3365,7 @@ class Fields extends Structure
$form, $this->setField(
'option', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray
)
);
@@ -3271,8 +3391,8 @@ class Fields extends Structure
$form, $this->setField(
'special', $r_fieldValues,
$r_name, $r_typeName, $langView,
- $view_name_single,
- $view_name_list, $placeholders,
+ $nameSingleCode,
+ $nameListCode, $placeholders,
$r_optionArray
)
);
@@ -3292,7 +3412,7 @@ class Fields extends Structure
$form, $this->setField(
'custom', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray
)
);
@@ -3322,8 +3442,8 @@ class Fields extends Structure
'custom' => $custom);
// set the custom field file
$this->setCustomFieldTypeFile(
- $data, $view_name_list,
- $view_name_single
+ $data, $nameListCode,
+ $nameSingleCode
);
}
else
@@ -3333,7 +3453,7 @@ class Fields extends Structure
$form, $this->setField(
'plain', $r_fieldValues, $r_name,
$r_typeName, $langView,
- $view_name_single, $view_name_list,
+ $nameSingleCode, $nameListCode,
$placeholders, $r_optionArray
)
);
@@ -3599,11 +3719,11 @@ class Fields extends Structure
}
}
// incase the field is in the config and has not been set (or is part of a plugin or module)
- if (('config' === $view_name_single
- && 'configs' === $view_name_list)
- || (strpos($view_name_single, 'P|uG!n') !== false
+ if (('config' === $nameSingleCode
+ && 'configs' === $nameListCode)
+ || (strpos($nameSingleCode, 'P|uG!n') !== false
|| strpos(
- $view_name_single, 'M0dU|3'
+ $nameSingleCode, 'M0dU|3'
) !== false))
{
// set lang (just incase)
@@ -3614,7 +3734,7 @@ class Fields extends Structure
'lang' => $listLangName, 'custom' => $custom);
// set the custom field file
$this->setCustomFieldTypeFile(
- $data, $view_name_list, $view_name_single
+ $data, $nameListCode, $nameSingleCode
);
}
}
@@ -3625,15 +3745,15 @@ class Fields extends Structure
/**
* set the layout builder
*
- * @param string $view_name_single The single edit view code name
- * @param string $tabName The tab code name
- * @param string $name The field code name
- * @param array $field The field details
+ * @param string $nameSingleCode The single edit view code name
+ * @param string $tabName The tab code name
+ * @param string $name The field code name
+ * @param array $field The field details
*
* @return void
*
*/
- public function setLayoutBuilder(&$view_name_single, &$tabName, &$name,
+ public function setLayoutBuilder(&$nameSingleCode, &$tabName, &$name,
&$field
) {
// first fix the zero order
@@ -3641,100 +3761,100 @@ class Fields extends Structure
// as zero is expected to behave
if ($field['order_edit'] == 0)
{
- if (!isset($this->zeroOrderFix[$view_name_single]))
+ if (!isset($this->zeroOrderFix[$nameSingleCode]))
{
- $this->zeroOrderFix[$view_name_single] = array();
+ $this->zeroOrderFix[$nameSingleCode] = array();
}
- if (!isset($this->zeroOrderFix[$view_name_single][(int) $field['tab']]))
+ if (!isset($this->zeroOrderFix[$nameSingleCode][(int) $field['tab']]))
{
- $this->zeroOrderFix[$view_name_single][(int) $field['tab']]
+ $this->zeroOrderFix[$nameSingleCode][(int) $field['tab']]
= -999;
}
else
{
- $this->zeroOrderFix[$view_name_single][(int) $field['tab']]++;
+ $this->zeroOrderFix[$nameSingleCode][(int) $field['tab']]++;
}
$field['order_edit']
- = $this->zeroOrderFix[$view_name_single][(int) $field['tab']];
+ = $this->zeroOrderFix[$nameSingleCode][(int) $field['tab']];
}
// now build the layout
if (ComponentbuilderHelper::checkString($tabName)
&& $tabName != 'publishing')
{
- $this->tabCounter[$view_name_single][(int) $field['tab']]
+ $this->tabCounter[$nameSingleCode][(int) $field['tab']]
= $tabName;
- if (isset($this->layoutBuilder[$view_name_single][$tabName][(int) $field['alignment']][(int) $field['order_edit']]))
+ if (isset($this->layoutBuilder[$nameSingleCode][$tabName][(int) $field['alignment']][(int) $field['order_edit']]))
{
$size = (int) count(
- (array) $this->layoutBuilder[$view_name_single][$tabName][(int) $field['alignment']]
+ (array) $this->layoutBuilder[$nameSingleCode][$tabName][(int) $field['alignment']]
) + 1;
- while (isset($this->layoutBuilder[$view_name_single][$tabName][(int) $field['alignment']][$size]))
+ while (isset($this->layoutBuilder[$nameSingleCode][$tabName][(int) $field['alignment']][$size]))
{
$size++;
}
- $this->layoutBuilder[$view_name_single][$tabName][(int) $field['alignment']][$size]
+ $this->layoutBuilder[$nameSingleCode][$tabName][(int) $field['alignment']][$size]
= $name;
}
else
{
- $this->layoutBuilder[$view_name_single][$tabName][(int) $field['alignment']][(int) $field['order_edit']]
+ $this->layoutBuilder[$nameSingleCode][$tabName][(int) $field['alignment']][(int) $field['order_edit']]
= $name;
}
// check if default fields were over written
if (in_array($name, $this->defaultFields))
{
// just to eliminate
- $this->movedPublishingFields[$view_name_single][$name] = $name;
+ $this->movedPublishingFields[$nameSingleCode][$name] = $name;
}
}
elseif ($tabName === 'publishing' || $tabName === 'Publishing')
{
if (!in_array($name, $this->defaultFields))
{
- if (isset($this->newPublishingFields[$view_name_single][(int) $field['alignment']][(int) $field['order_edit']]))
+ if (isset($this->newPublishingFields[$nameSingleCode][(int) $field['alignment']][(int) $field['order_edit']]))
{
$size = (int) count(
- (array) $this->newPublishingFields[$view_name_single][(int) $field['alignment']]
+ (array) $this->newPublishingFields[$nameSingleCode][(int) $field['alignment']]
) + 1;
- while (isset($this->newPublishingFields[$view_name_single][(int) $field['alignment']][$size]))
+ while (isset($this->newPublishingFields[$nameSingleCode][(int) $field['alignment']][$size]))
{
$size++;
}
- $this->newPublishingFields[$view_name_single][(int) $field['alignment']][$size]
+ $this->newPublishingFields[$nameSingleCode][(int) $field['alignment']][$size]
= $name;
}
else
{
- $this->newPublishingFields[$view_name_single][(int) $field['alignment']][(int) $field['order_edit']]
+ $this->newPublishingFields[$nameSingleCode][(int) $field['alignment']][(int) $field['order_edit']]
= $name;
}
}
}
else
{
- $this->tabCounter[$view_name_single][1] = 'Details';
- if (isset($this->layoutBuilder[$view_name_single]['Details'][(int) $field['alignment']][(int) $field['order_edit']]))
+ $this->tabCounter[$nameSingleCode][1] = 'Details';
+ if (isset($this->layoutBuilder[$nameSingleCode]['Details'][(int) $field['alignment']][(int) $field['order_edit']]))
{
$size = (int) count(
- (array) $this->layoutBuilder[$view_name_single]['Details'][(int) $field['alignment']]
+ (array) $this->layoutBuilder[$nameSingleCode]['Details'][(int) $field['alignment']]
) + 1;
- while (isset($this->layoutBuilder[$view_name_single]['Details'][(int) $field['alignment']][$size]))
+ while (isset($this->layoutBuilder[$nameSingleCode]['Details'][(int) $field['alignment']][$size]))
{
$size++;
}
- $this->layoutBuilder[$view_name_single]['Details'][(int) $field['alignment']][$size]
+ $this->layoutBuilder[$nameSingleCode]['Details'][(int) $field['alignment']][$size]
= $name;
}
else
{
- $this->layoutBuilder[$view_name_single]['Details'][(int) $field['alignment']][(int) $field['order_edit']]
+ $this->layoutBuilder[$nameSingleCode]['Details'][(int) $field['alignment']][(int) $field['order_edit']]
= $name;
}
// check if default fields were over written
if (in_array($name, $this->defaultFields))
{
// just to eliminate
- $this->movedPublishingFields[$view_name_single][$name] = $name;
+ $this->movedPublishingFields[$nameSingleCode][$name] = $name;
}
}
}
@@ -3812,23 +3932,23 @@ class Fields extends Structure
/**
* set field attributes
*
- * @param array $field The field data
- * @param int $viewType The view type
- * @param string $name The field name
- * @param string $typeName The field type
- * @param boolean $multiple The switch to set multiple selection option
- * @param string $langLabel The language string for field label
- * @param string $langView The language string of the view
- * @param string $view_name_list The list view name
- * @param string $view_name_single The single view name
- * @param array $placeholders The place holder and replace values
- * @param boolean $repeatable The repeatable field switch
+ * @param array $field The field data
+ * @param int $viewType The view type
+ * @param string $name The field name
+ * @param string $typeName The field type
+ * @param boolean $multiple The switch to set multiple selection option
+ * @param string $langLabel The language string for field label
+ * @param string $langView The language string of the view
+ * @param string $nameListCode The list view name
+ * @param string $nameSingleCode The single view name
+ * @param array $placeholders The place holder and replace values
+ * @param boolean $repeatable The repeatable field switch
*
* @return array The field attributes
*
*/
private function setFieldAttributes(&$field, &$viewType, &$name, &$typeName,
- &$multiple, &$langLabel, $langView, $view_name_list, $view_name_single,
+ &$multiple, &$langLabel, $langView, $nameListCode, $nameSingleCode,
$placeholders, $repeatable = false
) {
// reset array
@@ -4098,11 +4218,11 @@ class Fields extends Structure
if ($property['name'] === 'label')
{
if (isset($fieldAttributes['name'])
- && isset($this->uniqueNames[$view_name_list]['names'][$fieldAttributes['name']]))
+ && isset($this->uniqueNames[$nameListCode]['names'][$fieldAttributes['name']]))
{
$xmlValue .= ' ('
. ComponentbuilderHelper::safeString(
- $this->uniqueNames[$view_name_list]['names'][$fieldAttributes['name']]
+ $this->uniqueNames[$nameListCode]['names'][$fieldAttributes['name']]
) . ')';
}
}
@@ -4226,7 +4346,7 @@ class Fields extends Structure
);
if (ComponentbuilderHelper::checkString($listclass))
{
- $this->listFieldClass[$view_name_list][$fieldAttributes['name']]
+ $this->listFieldClass[$nameListCode][$fieldAttributes['name']]
= $listclass;
}
// check if we find reason to remove this field from being escaped
@@ -4235,7 +4355,7 @@ class Fields extends Structure
);
if (ComponentbuilderHelper::checkString($escaped))
{
- $this->doNotEscape[$view_name_list][]
+ $this->doNotEscape[$nameListCode][]
= $fieldAttributes['name'];
}
// check if we have display switch for dynamic placment
@@ -4275,23 +4395,23 @@ class Fields extends Structure
/**
* set Builders
*
- * @param string $langLabel The language string for field label
- * @param string $langView The language string of the view
- * @param string $view_name_single The single view name
- * @param string $view_name_list The list view name
- * @param string $name The field name
- * @param array $view The view data
- * @param array $field The field data
- * @param string $typeName The field type
- * @param boolean $multiple The switch to set multiple selection option
- * @param boolean $custom The custom field switch
- * @param boolean $options The options switch
+ * @param string $langLabel The language string for field label
+ * @param string $langView The language string of the view
+ * @param string $nameSingleCode The single view name
+ * @param string $nameListCode The list view name
+ * @param string $name The field name
+ * @param array $view The view data
+ * @param array $field The field data
+ * @param string $typeName The field type
+ * @param boolean $multiple The switch to set multiple selection option
+ * @param boolean $custom The custom field switch
+ * @param boolean $options The options switch
*
* @return void
*
*/
- public function setBuilders($langLabel, $langView, $view_name_single,
- $view_name_list, $name, $view, $field, $typeName, $multiple,
+ public function setBuilders($langLabel, $langView, $nameSingleCode,
+ $nameListCode, $name, $view, $field, $typeName, $multiple,
$custom = false, $options = false
) {
// dbSwitch
@@ -4304,7 +4424,7 @@ class Fields extends Structure
elseif ($typeName === 'tag')
{
// set tags for this view but don't load to DB
- $this->tagsBuilder[$view_name_single] = $view_name_single;
+ $this->tagsBuilder[$nameSingleCode] = $nameSingleCode;
}
elseif (isset($field['settings']->datatype))
{
@@ -4315,7 +4435,7 @@ class Fields extends Structure
$textKeys = array('TEXT', 'TINYTEXT', 'MEDIUMTEXT', 'LONGTEXT',
'BLOB', 'TINYBLOB', 'MEDIUMBLOB', 'LONGBLOB');
// build the query values
- $this->queryBuilder[$view_name_single][$name]['type']
+ $this->queryBuilder[$nameSingleCode][$name]['type']
= $field['settings']->datatype;
// check if this is a number
if (in_array($field['settings']->datatype, $numberKeys))
@@ -4346,25 +4466,25 @@ class Fields extends Structure
// check if this is not text
if (!in_array($field['settings']->datatype, $textKeys))
{
- $this->queryBuilder[$view_name_single][$name]['lenght']
+ $this->queryBuilder[$nameSingleCode][$name]['lenght']
= $field['settings']->datalenght;
- $this->queryBuilder[$view_name_single][$name]['lenght_other']
+ $this->queryBuilder[$nameSingleCode][$name]['lenght_other']
= $field['settings']->datalenght_other;
- $this->queryBuilder[$view_name_single][$name]['default']
+ $this->queryBuilder[$nameSingleCode][$name]['default']
= $field['settings']->datadefault;
- $this->queryBuilder[$view_name_single][$name]['other']
+ $this->queryBuilder[$nameSingleCode][$name]['other']
= $field['settings']->datadefault_other;
}
// fall back unto EMPTY for text
else
{
- $this->queryBuilder[$view_name_single][$name]['default']
+ $this->queryBuilder[$nameSingleCode][$name]['default']
= 'EMPTY';
}
// to identify the field
- $this->queryBuilder[$view_name_single][$name]['ID']
+ $this->queryBuilder[$nameSingleCode][$name]['ID']
= $field['settings']->id;
- $this->queryBuilder[$view_name_single][$name]['null_switch']
+ $this->queryBuilder[$nameSingleCode][$name]['null_switch']
= $field['settings']->null_switch;
// set index types
$_guid = true;
@@ -4374,7 +4494,7 @@ class Fields extends Structure
))
{
// build unique keys of this view for db
- $this->dbUniqueKeys[$view_name_single][] = $name;
+ $this->dbUniqueKeys[$nameSingleCode][] = $name;
// prevent guid from being added twice
if ('guid' === $name)
{
@@ -4389,12 +4509,12 @@ class Fields extends Structure
&& !in_array($field['settings']->datatype, $textKeys))
{
// build keys of this view for db
- $this->dbKeys[$view_name_single][] = $name;
+ $this->dbKeys[$nameSingleCode][] = $name;
}
// special treatment for GUID
if ('guid' === $name && $_guid)
{
- $this->dbUniqueGuid[$view_name_single] = true;
+ $this->dbUniqueGuid[$nameSingleCode] = true;
}
}
// set list switch
@@ -4404,37 +4524,37 @@ class Fields extends Structure
|| $field['list'] == 4));
// set list join
$listJoin
- = (isset($this->listJoinBuilder[$view_name_list][(int) $field['field']]));
+ = (isset($this->listJoinBuilder[$nameListCode][(int) $field['field']]));
// add history to this view
if (isset($view['history']) && $view['history'])
{
- $this->historyBuilder[$view_name_single] = $view_name_single;
+ $this->historyBuilder[$nameSingleCode] = $nameSingleCode;
}
// set Alias (only one title per view)
if ($dbSwitch && isset($field['alias']) && $field['alias']
- && !isset($this->aliasBuilder[$view_name_single]))
+ && !isset($this->aliasBuilder[$nameSingleCode]))
{
- $this->aliasBuilder[$view_name_single] = $name;
+ $this->aliasBuilder[$nameSingleCode] = $name;
}
// set Titles (only one title per view)
if ($dbSwitch && isset($field['title']) && $field['title']
- && !isset($this->titleBuilder[$view_name_single]))
+ && !isset($this->titleBuilder[$nameSingleCode]))
{
- $this->titleBuilder[$view_name_single] = $name;
+ $this->titleBuilder[$nameSingleCode] = $name;
}
// category name fix
if ($typeName === 'category')
{
- if (isset($this->catOtherName[$view_name_list])
+ if (isset($this->catOtherName[$nameListCode])
&& ComponentbuilderHelper::checkArray(
- $this->catOtherName[$view_name_list]
+ $this->catOtherName[$nameListCode]
))
{
- $tempName = $this->catOtherName[$view_name_list]['name'];
+ $tempName = $this->catOtherName[$nameListCode]['name'];
}
else
{
- $tempName = $view_name_list . ' categories';
+ $tempName = $nameListCode . ' categories';
}
// set lang
$listLangName = $langView . '_'
@@ -4468,7 +4588,7 @@ class Fields extends Structure
// load to list builder
if ($listSwitch)
{
- $this->listBuilder[$view_name_list][] = array(
+ $this->listBuilder[$nameListCode][] = array(
'id' => (int) $field['field'],
'type' => $typeName,
'code' => $name,
@@ -4489,13 +4609,13 @@ class Fields extends Structure
// build custom builder list
if ($listSwitch || $listJoin)
{
- $this->customBuilderList[$view_name_list][] = $name;
+ $this->customBuilderList[$nameListCode][] = $name;
}
}
// load the list join builder
if ($listJoin)
{
- $this->listJoinBuilder[$view_name_list][(int) $field['field']]
+ $this->listJoinBuilder[$nameListCode][(int) $field['field']]
= array(
'type' => $typeName,
'code' => $name,
@@ -4513,14 +4633,14 @@ class Fields extends Structure
'options' => $options);
}
// update the field relations
- if (isset($this->fieldRelations[$view_name_list])
- && isset($this->fieldRelations[$view_name_list][(int) $field['field']])
+ if (isset($this->fieldRelations[$nameListCode])
+ && isset($this->fieldRelations[$nameListCode][(int) $field['field']])
&& ComponentbuilderHelper::checkArray(
- $this->fieldRelations[$view_name_list][(int) $field['field']]
+ $this->fieldRelations[$nameListCode][(int) $field['field']]
))
{
foreach (
- $this->fieldRelations[$view_name_list][(int) $field['field']] as
+ $this->fieldRelations[$nameListCode][(int) $field['field']] as
$area => &$field_values
)
{
@@ -4532,11 +4652,11 @@ class Fields extends Structure
// set the hidden field of this view
if ($typeName === 'hidden')
{
- if (!isset($this->hiddenFieldsBuilder[$view_name_single]))
+ if (!isset($this->hiddenFieldsBuilder[$nameSingleCode]))
{
- $this->hiddenFieldsBuilder[$view_name_single] = '';
+ $this->hiddenFieldsBuilder[$nameSingleCode] = '';
}
- $this->hiddenFieldsBuilder[$view_name_single] .= ',"' . $name . '"';
+ $this->hiddenFieldsBuilder[$nameSingleCode] .= ',"' . $name . '"';
}
// set all int fields of this view
if ($dbSwitch && isset($field['settings']->datatype)
@@ -4544,32 +4664,32 @@ class Fields extends Structure
|| $field['settings']->datatype === 'TINYINT'
|| $field['settings']->datatype === 'BIGINT'))
{
- if (!isset($this->intFieldsBuilder[$view_name_single]))
+ if (!isset($this->intFieldsBuilder[$nameSingleCode]))
{
- $this->intFieldsBuilder[$view_name_single] = '';
+ $this->intFieldsBuilder[$nameSingleCode] = '';
}
- $this->intFieldsBuilder[$view_name_single] .= ',"' . $name . '"';
+ $this->intFieldsBuilder[$nameSingleCode] .= ',"' . $name . '"';
}
// set all dynamic field of this view
if ($typeName != 'category' && $typeName != 'repeatable'
&& $typeName != 'subform'
&& !in_array($name, $this->defaultFields))
{
- if (!isset($this->dynamicfieldsBuilder[$view_name_single]))
+ if (!isset($this->dynamicfieldsBuilder[$nameSingleCode]))
{
- $this->dynamicfieldsBuilder[$view_name_single] = '';
+ $this->dynamicfieldsBuilder[$nameSingleCode] = '';
}
- if (isset($this->dynamicfieldsBuilder[$view_name_single])
+ if (isset($this->dynamicfieldsBuilder[$nameSingleCode])
&& ComponentbuilderHelper::checkString(
- $this->dynamicfieldsBuilder[$view_name_single]
+ $this->dynamicfieldsBuilder[$nameSingleCode]
))
{
- $this->dynamicfieldsBuilder[$view_name_single] .= ',"' . $name
+ $this->dynamicfieldsBuilder[$nameSingleCode] .= ',"' . $name
. '":"' . $name . '"';
}
else
{
- $this->dynamicfieldsBuilder[$view_name_single] .= '"' . $name
+ $this->dynamicfieldsBuilder[$nameSingleCode] .= '"' . $name
. '":"' . $name . '"';
}
}
@@ -4577,12 +4697,12 @@ class Fields extends Structure
// set the main(biggest) text field of this view
if ($dbSwitch && $typeName === 'editor')
{
- if (!isset($this->maintextBuilder[$view_name_single])
+ if (!isset($this->maintextBuilder[$nameSingleCode])
|| !ComponentbuilderHelper::checkString(
- $this->maintextBuilder[$view_name_single]
+ $this->maintextBuilder[$nameSingleCode]
))
{
- $this->maintextBuilder[$view_name_single] = $name;
+ $this->maintextBuilder[$nameSingleCode] = $name;
}
}
// set the custom builder
@@ -4591,15 +4711,15 @@ class Fields extends Structure
&& $typeName != 'repeatable'
&& $typeName != 'subform')
{
- $this->customBuilder[$view_name_list][] = array('type' => $typeName,
- 'code' => $name,
- 'lang' => $listLangName,
- 'custom' => $custom,
- 'method' => $field['settings']->store);
+ $this->customBuilder[$nameListCode][] = array('type' => $typeName,
+ 'code' => $name,
+ 'lang' => $listLangName,
+ 'custom' => $custom,
+ 'method' => $field['settings']->store);
// set the custom fields needed in content type data
- if (!isset($this->customFieldLinksBuilder[$view_name_single]))
+ if (!isset($this->customFieldLinksBuilder[$nameSingleCode]))
{
- $this->customFieldLinksBuilder[$view_name_single] = '';
+ $this->customFieldLinksBuilder[$nameSingleCode] = '';
}
// only load this if table is set
if (isset($custom['table'])
@@ -4607,7 +4727,7 @@ class Fields extends Structure
$custom['table']
))
{
- $this->customFieldLinksBuilder[$view_name_single] .= ',{"sourceColumn": "'
+ $this->customFieldLinksBuilder[$nameSingleCode] .= ',{"sourceColumn": "'
. $name . '","targetTable": "' . $custom['table']
. '","targetColumn": "' . $custom['id']
. '","displayColumn": "' . $custom['text'] . '"}';
@@ -4625,18 +4745,18 @@ class Fields extends Structure
// setup category for this view
if ($dbSwitch && $typeName === 'category')
{
- if (isset($this->catOtherName[$view_name_list])
+ if (isset($this->catOtherName[$nameListCode])
&& ComponentbuilderHelper::checkArray(
- $this->catOtherName[$view_name_list]
+ $this->catOtherName[$nameListCode]
))
{
- $otherViews = $this->catOtherName[$view_name_list]['views'];
- $otherView = $this->catOtherName[$view_name_list]['view'];
+ $otherViews = $this->catOtherName[$nameListCode]['views'];
+ $otherView = $this->catOtherName[$nameListCode]['view'];
}
else
{
- $otherViews = $view_name_list;
- $otherView = $view_name_single;
+ $otherViews = $nameListCode;
+ $otherView = $nameSingleCode;
}
// get the xml extension name
$_extension = $this->setPlaceholders(
@@ -4672,20 +4792,20 @@ class Fields extends Structure
Please watch
this tutorial before proceeding!!!,
code fix
',
- $field['field'], $view_name_single, $_extension,
+ $field['field'], $nameSingleCode, $_extension,
$field['field'], $correction
), 'Error'
);
}
}
// load the category builder - TODO must move all to single view
- $this->categoryBuilder[$view_name_list] = array('code' => $name,
- 'name' => $listLangName,
- 'extension' => $_extension);
+ $this->categoryBuilder[$nameListCode] = array('code' => $name,
+ 'name' => $listLangName,
+ 'extension' => $_extension);
// also set code name for title alias fix
- $this->catCodeBuilder[$view_name_single] = array('code' => $name,
- 'views' => $otherViews,
- 'view' => $otherView);
+ $this->catCodeBuilder[$nameSingleCode] = array('code' => $name,
+ 'views' => $otherViews,
+ 'view' => $otherView);
}
// setup checkbox for this view
if ($dbSwitch
@@ -4694,7 +4814,7 @@ class Fields extends Structure
&& isset($custom['extends'])
&& $custom['extends'] === 'checkboxes')))
{
- $this->checkboxBuilder[$view_name_single][] = $name;
+ $this->checkboxBuilder[$nameSingleCode][] = $name;
}
// setup checkboxes and other json items for this view
// if we have advance field modeling and the field is not being set in the DB
@@ -4710,42 +4830,42 @@ class Fields extends Structure
{
case 1:
// JSON_STRING_ENCODE
- $this->jsonStringBuilder[$view_name_single][] = $name;
+ $this->jsonStringBuilder[$nameSingleCode][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData(
- $view_name_single, $name, 'json', $typeName
+ $nameSingleCode, $name, 'json', $typeName
);
break;
case 2:
// BASE_SIXTY_FOUR
- $this->base64Builder[$view_name_single][] = $name;
+ $this->base64Builder[$nameSingleCode][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData(
- $view_name_single, $name, 'base64', $typeName
+ $nameSingleCode, $name, 'base64', $typeName
);
break;
case 3:
// BASIC_ENCRYPTION_LOCALKEY
- $this->basicFieldModeling[$view_name_single][] = $name;
+ $this->basicFieldModeling[$nameSingleCode][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData(
- $view_name_single, $name, 'basic_encryption', $typeName
+ $nameSingleCode, $name, 'basic_encryption', $typeName
);
break;
case 4:
// WHMCS_ENCRYPTION_VDMKEY
- $this->whmcsFieldModeling[$view_name_single][] = $name;
+ $this->whmcsFieldModeling[$nameSingleCode][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData(
- $view_name_single, $name, 'whmcs_encryption', $typeName
+ $nameSingleCode, $name, 'whmcs_encryption', $typeName
);
break;
case 5:
// MEDIUM_ENCRYPTION_LOCALFILE
- $this->mediumFieldModeling[$view_name_single][] = $name;
+ $this->mediumFieldModeling[$nameSingleCode][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData(
- $view_name_single, $name, 'medium_encryption', $typeName
+ $nameSingleCode, $name, 'medium_encryption', $typeName
);
break;
case 6:
@@ -4754,28 +4874,28 @@ class Fields extends Structure
{
if (isset($field['settings']->initiator_save_key))
{
- $this->expertFieldModelInitiator[$view_name_single]['save'][$field['settings']->initiator_save_key]
+ $this->expertFieldModelInitiator[$nameSingleCode]['save'][$field['settings']->initiator_save_key]
= $field['settings']->initiator_save;
}
if (isset($field['settings']->initiator_get_key))
{
- $this->expertFieldModelInitiator[$view_name_single]['get'][$field['settings']->initiator_get_key]
+ $this->expertFieldModelInitiator[$nameSingleCode]['get'][$field['settings']->initiator_get_key]
= $field['settings']->initiator_get;
}
- $this->expertFieldModeling[$view_name_single][$name]
+ $this->expertFieldModeling[$nameSingleCode][$name]
= $field['settings']->model_field;
// Site settings of each field if needed
$this->buildSiteFieldData(
- $view_name_single, $name, 'expert_mode', $typeName
+ $nameSingleCode, $name, 'expert_mode', $typeName
);
}
break;
default:
// JSON_ARRAY_ENCODE
- $this->jsonItemBuilder[$view_name_single][] = $name;
+ $this->jsonItemBuilder[$nameSingleCode][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData(
- $view_name_single, $name, 'json', $typeName
+ $nameSingleCode, $name, 'json', $typeName
);
// no londer add the json again (already added)
$subformJsonSwitch = false;
@@ -4785,7 +4905,7 @@ class Fields extends Structure
if ($typeName === 'usergroup')
{
$this->buildSiteFieldData(
- $view_name_single, $name, 'json', $typeName
+ $nameSingleCode, $name, 'json', $typeName
);
}
@@ -4797,14 +4917,14 @@ class Fields extends Structure
{
if (ComponentbuilderHelper::checkArray($options))
{
- $this->getItemsMethodListStringFixBuilder[$view_name_single][]
+ $this->getItemsMethodListStringFixBuilder[$nameSingleCode][]
= array('name' => $name, 'type' => $typeName,
'translation' => true, 'custom' => $custom,
'method' => $field['settings']->store);
}
else
{
- $this->getItemsMethodListStringFixBuilder[$view_name_single][]
+ $this->getItemsMethodListStringFixBuilder[$nameSingleCode][]
= array('name' => $name, 'type' => $typeName,
'translation' => false, 'custom' => $custom,
'method' => $field['settings']->store);
@@ -4815,15 +4935,15 @@ class Fields extends Structure
if ('subform' === $typeName && $field['settings']->store != 6)
{
// the values must revert to array
- $this->jsonItemBuilderArray[$view_name_single][] = $name;
+ $this->jsonItemBuilderArray[$nameSingleCode][] = $name;
// should the json builder still be added
if ($subformJsonSwitch)
{
// and insure the if is converted to json
- $this->jsonItemBuilder[$view_name_single][] = $name;
+ $this->jsonItemBuilder[$nameSingleCode][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData(
- $view_name_single, $name, 'json', $typeName
+ $nameSingleCode, $name, 'json', $typeName
);
}
}
@@ -4834,13 +4954,13 @@ class Fields extends Structure
|| $field['settings']->store != 0)
&& !ComponentbuilderHelper::checkArray($options)))
{
- $this->getItemsMethodEximportStringFixBuilder[$view_name_single][]
+ $this->getItemsMethodEximportStringFixBuilder[$nameSingleCode][]
= array('name' => $name, 'type' => $typeName,
'translation' => false, 'custom' => $custom,
'method' => $field['settings']->store);
}
// check if field should be added to uikit
- $this->buildSiteFieldData($view_name_single, $name, 'uikit', $typeName);
+ $this->buildSiteFieldData($nameSingleCode, $name, 'uikit', $typeName);
// load the selection translation fix
if (ComponentbuilderHelper::checkArray($options)
&& ($listSwitch
@@ -4848,7 +4968,7 @@ class Fields extends Structure
&& $typeName != 'repeatable'
&& $typeName != 'subform')
{
- $this->selectionTranslationFixBuilder[$view_name_list][$name]
+ $this->selectionTranslationFixBuilder[$nameListCode][$name]
= $options;
}
// build the sort values
@@ -4859,21 +4979,21 @@ class Fields extends Structure
&& $typeName != 'repeatable'
&& $typeName != 'subform'))
{
- $this->sortBuilder[$view_name_list][] = array('type' => $typeName,
- 'code' => $name,
- 'lang' => $listLangName,
- 'custom' => $custom,
- 'options' => $options);
+ $this->sortBuilder[$nameListCode][] = array('type' => $typeName,
+ 'code' => $name,
+ 'lang' => $listLangName,
+ 'custom' => $custom,
+ 'options' => $options);
}
// build the search values
if ($dbSwitch && isset($field['search']) && $field['search'] == 1)
{
- $_list = (isset($field['list']))
+ $_list = (isset($field['list']))
? $field['list'] : 0;
- $this->searchBuilder[$view_name_list][] = array('type' => $typeName,
- 'code' => $name,
- 'custom' => $custom,
- 'list' => $_list);
+ $this->searchBuilder[$nameListCode][] = array('type' => $typeName,
+ 'code' => $name,
+ 'custom' => $custom,
+ 'list' => $_list);
}
// build the filter values
if ($dbSwitch && (isset($field['filter']) && $field['filter'] >= 1)
@@ -4883,16 +5003,16 @@ class Fields extends Structure
&& $typeName != 'repeatable'
&& $typeName != 'subform'))
{
- $this->filterBuilder[$view_name_list][] = array('type' => $typeName,
- 'multi' => $field['filter'],
- 'code' => $name,
- 'lang' => $listLangName,
- 'database' => $view_name_single,
- 'function' => ComponentbuilderHelper::safeString(
- $name, 'F'
- ),
- 'custom' => $custom,
- 'options' => $options);
+ $this->filterBuilder[$nameListCode][] = array('type' => $typeName,
+ 'multi' => $field['filter'],
+ 'code' => $name,
+ 'lang' => $listLangName,
+ 'database' => $nameSingleCode,
+ 'function' => ComponentbuilderHelper::safeString(
+ $name, 'F'
+ ),
+ 'custom' => $custom,
+ 'options' => $options);
}
// build the layout
@@ -4907,21 +5027,21 @@ class Fields extends Structure
// set to publishing tab
$tabName = 'publishing';
}
- $this->setLayoutBuilder($view_name_single, $tabName, $name, $field);
+ $this->setLayoutBuilder($nameSingleCode, $tabName, $name, $field);
}
/**
* set Custom Field Type File
*
- * @param array $data The field complete data set
- * @param string $view_name_list The list view code name
- * @param string $view_name_single The single view code name
+ * @param array $data The field complete data set
+ * @param string $nameListCode The list view code name
+ * @param string $nameSingleCode The single view code name
*
* @return void
*
*/
- public function setCustomFieldTypeFile($data, $view_name_list,
- $view_name_single
+ public function setCustomFieldTypeFile($data, $nameListCode,
+ $nameSingleCode
) {
// make sure it is not already been build or if it is prime
if (isset($data['custom']) && isset($data['custom']['extends'])
@@ -4972,7 +5092,7 @@ class Fields extends Structure
? $data['code'] . '_' . $data['custom']['text'] : '',
$this->bbb . 'CODE' . $this->ddd => (isset($data['code']))
? $data['code'] : '',
- $this->bbb . 'view_type' . $this->ddd => $view_name_single
+ $this->bbb . 'view_type' . $this->ddd => $nameSingleCode
. '_' . $data['type'],
$this->bbb . 'type' . $this->ddd => (isset($data['type']))
? $data['type'] : '',
@@ -4995,14 +5115,14 @@ class Fields extends Structure
$data['custom']['view']
)) ? ComponentbuilderHelper::safeString(
$data['custom']['view']
- ) : $view_name_single,
+ ) : $nameSingleCode,
$this->bbb . 'views'
. $this->ddd => (isset($data['custom']['views'])
&& ComponentbuilderHelper::checkString(
$data['custom']['views']
)) ? ComponentbuilderHelper::safeString(
$data['custom']['views']
- ) : $view_name_list
+ ) : $nameListCode
);
// now set the ###PLACEHOLDER### options
foreach ($replace as $replacekey => $replacevalue)
@@ -5282,9 +5402,9 @@ class Fields extends Structure
}
}
// if this field gets used in plugin or module we should track it so if needed we can copy it over
- if ((strpos($view_name_single, 'P|uG!n') !== false
+ if ((strpos($nameSingleCode, 'P|uG!n') !== false
|| strpos(
- $view_name_single, 'M0dU|3'
+ $nameSingleCode, 'M0dU|3'
) !== false)
&& isset($data['custom'])
&& isset($data['custom']['type']))
diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php
index 06dcfdfc8..3e5905a2f 100644
--- a/admin/helpers/compiler/e_Interpretation.php
+++ b/admin/helpers/compiler/e_Interpretation.php
@@ -1453,9 +1453,9 @@ class Interpretation extends Fields
return implode(PHP_EOL, $help);
}
- public function checkHelp($viewName_single)
+ public function checkHelp($nameSingleCode)
{
- if ($viewName_single == "help_document")
+ if ($nameSingleCode == "help_document")
{
// set help file into admin place
$target = array('admin' => 'help');
@@ -2198,17 +2198,18 @@ class Interpretation extends Fields
return '';
}
- public function setAdminViewMenu(&$viewName_single, &$view)
+ public function setAdminViewMenu(&$nameSingleCode, &$view)
{
$xml = '';
// build the file target values
- $target = array('site' => $viewName_single);
+ $target = array('site' => $nameSingleCode);
// build the edit.xml file
if ($this->buildDynamique($target, 'admin_menu'))
{
// set the lang
$lang = ComponentbuilderHelper::safeString(
- 'com_' . $this->componentCodeName . '_menu_' . $viewName_single,
+ 'com_' . $this->componentCodeName . '_menu_'
+ . $nameSingleCode,
'U'
);
$this->setLangContent(
@@ -2239,7 +2240,7 @@ class Interpretation extends Fields
$this->app->enqueueMessage(
JText::sprintf(
'
Site menu for %s was not build.
',
- $viewName_single
+ $nameSingleCode
), 'Warning'
);
}
@@ -5092,23 +5093,49 @@ class Interpretation extends Fields
return $script . $getItem;
}
- public function setAdminViewDisplayMethod($viewName_list)
+ /**
+ * build code for the admin view display method
+ *
+ * @param string $nameListCode The list view name
+ *
+ * @return string The php to place in view.html.php
+ *
+ */
+ public function setAdminViewDisplayMethod($nameListCode)
{
$script = '';
- if (isset($this->viewsDefaultOrdering[$viewName_list])
- && $this->viewsDefaultOrdering[$viewName_list]['add_admin_ordering']
+ // add the the new filter methods for the search toolbar above the list view
+ if (isset($this->adminFilterType[$nameListCode])
+ && $this->adminFilterType[$nameListCode] == 2)
+ {
+ $script .= PHP_EOL . $this->_t(2) . "//"
+ . $this->setLine(
+ __LINE__
+ ) . " Load the filter form from xml.";
+ $script .= PHP_EOL . $this->_t(2) . "\$this->filterForm "
+ . "= \$this->get('FilterForm');";
+ $script .= PHP_EOL . $this->_t(2) . "//"
+ . $this->setLine(
+ __LINE__
+ ) . " Load the active filters.";
+ $script .= PHP_EOL . $this->_t(2) . "\$this->activeFilters "
+ . "= \$this->get('ActiveFilters');";
+ }
+ // add the custom ordering if set
+ if (isset($this->viewsDefaultOrdering[$nameListCode])
+ && $this->viewsDefaultOrdering[$nameListCode]['add_admin_ordering']
== 1)
{
// the first is from the state
$order_first = true;
foreach (
- $this->viewsDefaultOrdering[$viewName_list]['admin_ordering_fields']
+ $this->viewsDefaultOrdering[$nameListCode]['admin_ordering_fields']
as $order_field
)
{
if ($order_first
&& ($order_field_name = $this->getFieldDatabaseName(
- $viewName_list, $order_field['field']
+ $nameListCode, $order_field['field']
)) !== false)
{
// just the first field is based on state
@@ -5546,38 +5573,32 @@ class Interpretation extends Fields
{
if (1 == $type)
{
- $viewName = $view['settings']->code;
+ $viewCodeName = $view['settings']->code;
}
if (2 == $type)
{
- $viewName = ComponentbuilderHelper::safeString(
- $view['settings']->name_single
- );
+ $viewCodeName = $view['settings']->name_single_code;
}
// set the custom buttons CUSTOM_BUTTONS_CONTROLLER
- $this->fileContentDynamic[$viewName][$this->hhh . $TARGET
+ $this->fileContentDynamic[$viewCodeName][$this->hhh . $TARGET
. '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh]
= '';
// set the custom buttons CUSTOM_BUTTONS_METHOD
- $this->fileContentDynamic[$viewName][$this->hhh . $TARGET
+ $this->fileContentDynamic[$viewCodeName][$this->hhh . $TARGET
. '_CUSTOM_BUTTONS_METHOD' . $this->hhh]
= '';
}
elseif (3 == $type)
{
// set the names
- $viewName = ComponentbuilderHelper::safeString(
- $view['settings']->name_single
- );
- $viewsName = ComponentbuilderHelper::safeString(
- $view['settings']->name_list
- );
+ $viewCodeName = $view['settings']->name_single_code;
+ $viewsCodeName = $view['settings']->name_list_code;
// set the custom buttons CUSTOM_BUTTONS_CONTROLLER_LIST
- $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET
+ $this->fileContentDynamic[$viewsCodeName][$this->hhh . $TARGET
. '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh]
= '';
// set the custom buttons CUSTOM_BUTTONS_METHOD_LIST
- $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET
+ $this->fileContentDynamic[$viewsCodeName][$this->hhh . $TARGET
. '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh]
= '';
// validate selection
@@ -5589,11 +5610,12 @@ class Interpretation extends Fields
if ($this->target === 'site')
{
// set the custom buttons SITE_TOP_BUTTON
- $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_TOP_BUTTON'
+ $this->fileContentDynamic[$viewCodeName][$this->hhh
+ . 'SITE_TOP_BUTTON'
. $this->hhh]
= '';
// set the custom buttons SITE_BOTTOM_BUTTON
- $this->fileContentDynamic[$viewName][$this->hhh
+ $this->fileContentDynamic[$viewCodeName][$this->hhh
. 'SITE_BOTTOM_BUTTON' . $this->hhh]
= '';
// load into place
@@ -5601,25 +5623,25 @@ class Interpretation extends Fields
{
case 1:
// set buttons to top right of the view
- $this->fileContentDynamic[$viewName][$this->hhh
+ $this->fileContentDynamic[$viewCodeName][$this->hhh
. 'SITE_TOP_BUTTON' . $this->hhh]
= '
toolbar->render(); ?>
';
break;
case 2:
// set buttons to top left of the view
- $this->fileContentDynamic[$viewName][$this->hhh
+ $this->fileContentDynamic[$viewCodeName][$this->hhh
. 'SITE_TOP_BUTTON' . $this->hhh]
= 'toolbar->render(); ?>';
break;
case 3:
// set buttons to buttom right of the view
- $this->fileContentDynamic[$viewName][$this->hhh
+ $this->fileContentDynamic[$viewCodeName][$this->hhh
. 'SITE_BOTTOM_BUTTON' . $this->hhh]
= '
toolbar->render(); ?>
';
break;
case 4:
// set buttons to buttom left of the view
- $this->fileContentDynamic[$viewName][$this->hhh
+ $this->fileContentDynamic[$viewCodeName][$this->hhh
. 'SITE_BOTTOM_BUTTON' . $this->hhh]
= 'toolbar->render(); ?>';
break;
@@ -5637,12 +5659,12 @@ class Interpretation extends Fields
// add this button only if this is not the default view
if ($this->dynamicDashboardType !== 'custom_admin_views'
|| ($this->dynamicDashboardType === 'custom_admin_views'
- && $this->dynamicDashboard !== $viewName))
+ && $this->dynamicDashboard !== $viewCodeName))
{
$buttons[] = $tab . $this->_t(2)
. "//" . $this->setLine(__LINE__) . " add cpanel button";
$buttons[] = $tab . $this->_t(2)
- . "JToolBarHelper::custom('" . $viewName . "."
+ . "JToolBarHelper::custom('" . $viewCodeName . "."
. "dashboard', 'grid-2', '', 'COM_"
. $this->fileContentStatic[$this->hhh
. 'COMPONENT' . $this->hhh]
@@ -5683,14 +5705,16 @@ class Interpretation extends Fields
|| $this->target === 'site')
{
$buttons[] = $this->_t(1) . $tab . $this->_t(1)
- . "if (\$this->user->authorise('" . $viewName
+ . "if (\$this->user->authorise('"
+ . $viewCodeName
. "." . $keyCode . "', 'com_"
. $this->componentCodeName . "'))";
}
else
{
$buttons[] = $this->_t(1) . $tab . $this->_t(1)
- . "if (\$this->canDo->get('" . $viewName . "."
+ . "if (\$this->canDo->get('" . $viewCodeName
+ . "."
. $keyCode . "'))";
}
$buttons[] = $this->_t(1) . $tab . $this->_t(1) . "{";
@@ -5698,7 +5722,7 @@ class Interpretation extends Fields
. $this->setLine(__LINE__) . " add "
. $custom_button['name'] . " button.";
$buttons[] = $this->_t(1) . $tab . $this->_t(2)
- . "JToolBarHelper::custom('" . $viewName . "."
+ . "JToolBarHelper::custom('" . $viewCodeName . "."
. $custom_button['method'] . "', '"
. $custom_button['icomoon'] . " custom-button-"
. strtolower($custom_button['method']) . "', '', '"
@@ -5713,41 +5737,49 @@ class Interpretation extends Fields
if (isset($custom_button['type'])
&& $custom_button['type'] == 2)
{
- if (!isset($this->onlyFunctionButton[$viewsName]))
+ if (!isset($this->onlyFunctionButton[$viewsCodeName]))
{
- $this->onlyFunctionButton[$viewsName] = array();
+ $this->onlyFunctionButton[$viewsCodeName]
+ = array();
}
- $this->onlyFunctionButton[$viewsName][] = $this->_t(
+ $this->onlyFunctionButton[$viewsCodeName][]
+ = $this->_t(
1
) . $tab . "if (\$this->user->authorise('"
- . $viewName . "." . $keyCode . "', 'com_"
+ . $viewCodeName . "." . $keyCode . "', 'com_"
. $this->componentCodeName . "'))";
- $this->onlyFunctionButton[$viewsName][] = $this->_t(
+ $this->onlyFunctionButton[$viewsCodeName][]
+ = $this->_t(
1
) . $tab . "{";
- $this->onlyFunctionButton[$viewsName][] = $this->_t(
+ $this->onlyFunctionButton[$viewsCodeName][]
+ = $this->_t(
1
) . $tab . $this->_t(1) . "//" . $this->setLine(
__LINE__
) . " add " . $custom_button['name']
. " button.";
- $this->onlyFunctionButton[$viewsName][] = $this->_t(
+ $this->onlyFunctionButton[$viewsCodeName][]
+ = $this->_t(
1
) . $tab . $this->_t(1)
- . "JToolBarHelper::custom('" . $viewsName . "."
+ . "JToolBarHelper::custom('" . $viewsCodeName
+ . "."
. $custom_button['method'] . "', '"
. $custom_button['icomoon'] . " custom-button-"
. strtolower($custom_button['method'])
. "', '', '"
. $keyLang . "', false);";
- $this->onlyFunctionButton[$viewsName][] = $this->_t(
+ $this->onlyFunctionButton[$viewsCodeName][]
+ = $this->_t(
1
) . $tab . "}";
}
else
{
$buttons[] = $this->_t(1) . $tab . $this->_t(1)
- . "if (\$this->user->authorise('" . $viewName
+ . "if (\$this->user->authorise('"
+ . $viewCodeName
. "." . $keyCode . "', 'com_"
. $this->componentCodeName . "'))";
$buttons[] = $this->_t(1) . $tab . $this->_t(1)
@@ -5756,7 +5788,8 @@ class Interpretation extends Fields
. "//" . $this->setLine(__LINE__) . " add "
. $custom_button['name'] . " button.";
$buttons[] = $this->_t(1) . $tab . $this->_t(2)
- . "JToolBarHelper::custom('" . $viewsName . "."
+ . "JToolBarHelper::custom('" . $viewsCodeName
+ . "."
. $custom_button['method'] . "', '"
. $custom_button['icomoon'] . " custom-button-"
. strtolower($custom_button['method'])
@@ -5780,7 +5813,8 @@ class Interpretation extends Fields
&& $view['settings']->php_controller_list != '//')
{
// set the custom buttons CUSTOM_BUTTONS_CONTROLLER
- $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET
+ $this->fileContentDynamic[$viewsCodeName][$this->hhh
+ . $TARGET
. '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh]
= PHP_EOL . PHP_EOL . $this->setPlaceholders(
$view['settings']->php_controller_list,
@@ -5795,7 +5829,8 @@ class Interpretation extends Fields
&& $view['settings']->php_model_list != '//')
{
// set the custom buttons CUSTOM_BUTTONS_METHOD
- $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET
+ $this->fileContentDynamic[$viewsCodeName][$this->hhh
+ . $TARGET
. '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh]
= PHP_EOL . PHP_EOL . $this->setPlaceholders(
$view['settings']->php_model_list,
@@ -5812,7 +5847,8 @@ class Interpretation extends Fields
&& $view['settings']->php_controller != '//')
{
// set the custom buttons CUSTOM_BUTTONS_CONTROLLER
- $this->fileContentDynamic[$viewName][$this->hhh . $TARGET
+ $this->fileContentDynamic[$viewCodeName][$this->hhh
+ . $TARGET
. '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh]
= PHP_EOL . PHP_EOL . $this->setPlaceholders(
$view['settings']->php_controller,
@@ -5822,7 +5858,7 @@ class Interpretation extends Fields
{
// add the controller for this view
// build the file
- $target = array($this->target => $viewName);
+ $target = array($this->target => $viewCodeName);
$this->buildDynamique($target, 'custom_form');
// GET_FORM_CUSTOM
}
@@ -5834,7 +5870,8 @@ class Interpretation extends Fields
&& $view['settings']->php_model != '//')
{
// set the custom buttons CUSTOM_BUTTONS_METHOD
- $this->fileContentDynamic[$viewName][$this->hhh . $TARGET
+ $this->fileContentDynamic[$viewCodeName][$this->hhh
+ . $TARGET
. '_CUSTOM_BUTTONS_METHOD' . $this->hhh]
= PHP_EOL . PHP_EOL . $this->setPlaceholders(
$view['settings']->php_model, $this->placeholders
@@ -5887,16 +5924,16 @@ class Interpretation extends Fields
return PHP_EOL . implode(PHP_EOL, $script);
}
- public function setFunctionOnlyButtons($viewName_list)
+ public function setFunctionOnlyButtons($nameListCode)
{
// return buttons if they were build
- if (isset($this->onlyFunctionButton[$viewName_list])
+ if (isset($this->onlyFunctionButton[$nameListCode])
&& ComponentbuilderHelper::checkArray(
- $this->onlyFunctionButton[$viewName_list]
+ $this->onlyFunctionButton[$nameListCode]
))
{
return PHP_EOL . implode(
- PHP_EOL, $this->onlyFunctionButton[$viewName_list]
+ PHP_EOL, $this->onlyFunctionButton[$nameListCode]
);
}
@@ -8091,14 +8128,16 @@ class Interpretation extends Fields
) . " Get The Database object";
$script .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDbo();";
- foreach ($this->uninstallScriptBuilder as $viewName => $typeAlias)
+ foreach (
+ $this->uninstallScriptBuilder as $viewsCodeName => $typeAlias
+ )
{
// set a var value
- $view = ComponentbuilderHelper::safeString($viewName);
+ $view = ComponentbuilderHelper::safeString($viewsCodeName);
// check if it has field relations
if (isset($this->uninstallScriptFields)
- && isset($this->uninstallScriptFields[$viewName]))
+ && isset($this->uninstallScriptFields[$viewsCodeName]))
{
// First check if data is till in table
$script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
@@ -8115,7 +8154,7 @@ class Interpretation extends Fields
. "\$query->from(\$db->quoteName('#__fields'));";
$script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
__LINE__
- ) . " Where " . $viewName . " context is found";
+ ) . " Where " . $viewsCodeName . " context is found";
$script .= PHP_EOL . $this->_t(2)
. "\$query->where( \$db->quoteName('context') . ' = '. \$db->quote('"
. $typeAlias . "') );";
@@ -8143,7 +8182,8 @@ class Interpretation extends Fields
// Now remove the actual type entry
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Remove " . $viewName . " from the field table";
+ ) . " Remove " . $viewsCodeName
+ . " from the field table";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_condition = array( \$db->quoteName('context') . ' = '. \$db->quote('"
. $typeAlias . "') );";
@@ -8160,7 +8200,7 @@ class Interpretation extends Fields
. "\$db->setQuery(\$query);";
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Execute the query to remove " . $viewName
+ ) . " Execute the query to remove " . $viewsCodeName
. " items";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_done = \$db->execute();";
@@ -8169,7 +8209,7 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(3) . "{";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " If succesfully remove " . $viewName
+ ) . " If succesfully remove " . $viewsCodeName
. " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . $this->_t(4)
@@ -8179,7 +8219,7 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(3) . "}";
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Also Remove " . $viewName . " field values";
+ ) . " Also Remove " . $viewsCodeName . " field values";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_condition = array( \$db->quoteName('field_id') . ' IN ('. implode(',', \$"
. $view . "_field_ids) .')');";
@@ -8196,7 +8236,7 @@ class Interpretation extends Fields
. "\$db->setQuery(\$query);";
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Execute the query to remove " . $viewName
+ ) . " Execute the query to remove " . $viewsCodeName
. " field values";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_done = \$db->execute();";
@@ -8205,12 +8245,12 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(3) . "{";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " If succesfully remove " . $viewName
+ ) . " If succesfully remove " . $viewsCodeName
. " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . $this->_t(4)
. "\$app->enqueueMessage(JText:"
- . ":_('The fields values for " . $viewName
+ . ":_('The fields values for " . $viewsCodeName
. " was removed from the #__fields_values table'));";
$script .= PHP_EOL . $this->_t(3) . "}";
$script .= PHP_EOL . $this->_t(2) . "}";
@@ -8230,7 +8270,7 @@ class Interpretation extends Fields
. "\$query->from(\$db->quoteName('#__fields_groups'));";
$script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
__LINE__
- ) . " Where " . $viewName . " context is found";
+ ) . " Where " . $viewsCodeName . " context is found";
$script .= PHP_EOL . $this->_t(2)
. "\$query->where( \$db->quoteName('context') . ' = '. \$db->quote('"
. $typeAlias . "') );";
@@ -8252,7 +8292,7 @@ class Interpretation extends Fields
// Now remove the actual type entry
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Remove " . $viewName
+ ) . " Remove " . $viewsCodeName
. " from the field groups table";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_condition = array( \$db->quoteName('context') . ' = '. \$db->quote('"
@@ -8270,7 +8310,7 @@ class Interpretation extends Fields
. "\$db->setQuery(\$query);";
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Execute the query to remove " . $viewName
+ ) . " Execute the query to remove " . $viewsCodeName
. " items";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_done = \$db->execute();";
@@ -8279,7 +8319,7 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(3) . "{";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " If succesfully remove " . $viewName
+ ) . " If succesfully remove " . $viewsCodeName
. " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . $this->_t(4)
@@ -8303,7 +8343,7 @@ class Interpretation extends Fields
. "\$query->from(\$db->quoteName('#__content_types'));";
$script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
__LINE__
- ) . " Where " . $viewName . " alias is found";
+ ) . " Where " . $viewsCodeName . " alias is found";
$script .= PHP_EOL . $this->_t(2)
. "\$query->where( \$db->quoteName('type_alias') . ' = '. \$db->quote('"
. $typeAlias . "') );";
@@ -8330,7 +8370,8 @@ class Interpretation extends Fields
// Now remove the actual type entry
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Remove " . $viewName . " from the content type table";
+ ) . " Remove " . $viewsCodeName
+ . " from the content type table";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('"
. $typeAlias . "') );";
@@ -8346,14 +8387,15 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);";
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Execute the query to remove " . $viewName . " items";
+ ) . " Execute the query to remove " . $viewsCodeName
+ . " items";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_done = \$db->execute();";
$script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done)";
$script .= PHP_EOL . $this->_t(3) . "{";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " If succesfully remove " . $viewName
+ ) . " If succesfully remove " . $viewsCodeName
. " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . $this->_t(4)
@@ -8363,7 +8405,7 @@ class Interpretation extends Fields
// Now remove the related items from contentitem tag map table
$script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(__LINE__) . " Remove " . $viewName
+ . $this->setLine(__LINE__) . " Remove " . $viewsCodeName
. " items from the contentitem tag map table";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('"
@@ -8380,14 +8422,15 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);";
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Execute the query to remove " . $viewName . " items";
+ ) . " Execute the query to remove " . $viewsCodeName
+ . " items";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_done = \$db->execute();";
$script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done)";
$script .= PHP_EOL . $this->_t(3) . "{";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " If succesfully remove " . $viewName
+ ) . " If succesfully remove " . $viewsCodeName
. " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . $this->_t(4)
@@ -8397,7 +8440,7 @@ class Interpretation extends Fields
// Now remove the related items from ucm content table
$script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(__LINE__) . " Remove " . $viewName
+ . $this->setLine(__LINE__) . " Remove " . $viewsCodeName
. " items from the ucm content table";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_condition = array( \$db->quoteName('core_type_alias') . ' = ' . \$db->quote('"
@@ -8414,14 +8457,15 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);";
$script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
__LINE__
- ) . " Execute the query to remove " . $viewName . " items";
+ ) . " Execute the query to remove " . $viewsCodeName
+ . " items";
$script .= PHP_EOL . $this->_t(3) . "\$" . $view
. "_done = \$db->execute();";
$script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done)";
$script .= PHP_EOL . $this->_t(3) . "{";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " If succesfully remove " . $viewName
+ ) . " If succesfully remove " . $viewsCodeName
. " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . $this->_t(4)
@@ -8432,7 +8476,7 @@ class Interpretation extends Fields
// setup the foreach loop of ids
$script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//"
. $this->setLine(__LINE__) . " Make sure that all the "
- . $viewName . " items are cleared from DB";
+ . $viewsCodeName . " items are cleared from DB";
$script .= PHP_EOL . $this->_t(3) . "foreach (\$" . $view
. "_ids as \$" . $view . "_id)";
$script .= PHP_EOL . $this->_t(3) . "{";
@@ -8440,7 +8484,7 @@ class Interpretation extends Fields
// Now remove the related items from ucm base table
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " Remove " . $viewName
+ ) . " Remove " . $viewsCodeName
. " items from the ucm base table";
$script .= PHP_EOL . $this->_t(4) . "\$" . $view
. "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$"
@@ -8457,12 +8501,13 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(4) . "\$db->setQuery(\$query);";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " Execute the query to remove " . $viewName . " items";
+ ) . " Execute the query to remove " . $viewsCodeName
+ . " items";
$script .= PHP_EOL . $this->_t(4) . "\$db->execute();";
// Now remove the related items from ucm history table
$script .= PHP_EOL . PHP_EOL . $this->_t(4) . "//"
- . $this->setLine(__LINE__) . " Remove " . $viewName
+ . $this->setLine(__LINE__) . " Remove " . $viewsCodeName
. " items from the ucm history table";
$script .= PHP_EOL . $this->_t(4) . "\$" . $view
. "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$"
@@ -8479,7 +8524,8 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(4) . "\$db->setQuery(\$query);";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
- ) . " Execute the query to remove " . $viewName . " items";
+ ) . " Execute the query to remove " . $viewsCodeName
+ . " items";
$script .= PHP_EOL . $this->_t(4) . "\$db->execute();";
$script .= PHP_EOL . $this->_t(3) . "}";
@@ -8779,30 +8825,30 @@ class Interpretation extends Fields
return $array;
}
- public function setRouterHelp($viewName_single, $viewName_list,
+ public function setRouterHelp($nameSingleCode, $nameListCode,
$front = false
) {
// add if tags is added, also for all front item views
- if (((isset($this->tagsBuilder[$viewName_single])
+ if (((isset($this->tagsBuilder[$nameSingleCode])
&& ComponentbuilderHelper::checkString(
- $this->tagsBuilder[$viewName_single]
+ $this->tagsBuilder[$nameSingleCode]
))
|| $front)
- && (!in_array($viewName_single, $this->setRouterHelpDone)))
+ && (!in_array($nameSingleCode, $this->setRouterHelpDone)))
{
// insure we load a view only once
- $this->setRouterHelpDone[] = $viewName_single;
+ $this->setRouterHelpDone[] = $nameSingleCode;
// build view route helper
$View = ComponentbuilderHelper::safeString(
- $viewName_single, 'F'
+ $nameSingleCode, 'F'
);
$routeHelper = array();
$routeHelper[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
$routeHelper[] = $this->_t(1) . " * @param int The route of the "
. $View;
$routeHelper[] = $this->_t(1) . " */";
- if ('category' === $viewName_single
- || 'categories' === $viewName_single)
+ if ('category' === $nameSingleCode
+ || 'categories' === $nameSingleCode)
{
$routeHelper[] = $this->_t(1) . "public static function get"
. $View . "Route(\$id = 0)";
@@ -8818,13 +8864,13 @@ class Interpretation extends Fields
$routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Initialize the needel array.";
$routeHelper[] = $this->_t(3) . "\$needles = array(";
- $routeHelper[] = $this->_t(4) . "'" . $viewName_single
+ $routeHelper[] = $this->_t(4) . "'" . $nameSingleCode
. "' => array((int) \$id)";
$routeHelper[] = $this->_t(3) . ");";
$routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Create the link";
$routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_"
- . $this->componentCodeName . "&view=" . $viewName_single
+ . $this->componentCodeName . "&view=" . $nameSingleCode
. "&id='. \$id;";
$routeHelper[] = $this->_t(2) . "}";
$routeHelper[] = $this->_t(2) . "else";
@@ -8832,22 +8878,23 @@ class Interpretation extends Fields
$routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Initialize the needel array.";
$routeHelper[] = $this->_t(3) . "\$needles = array(";
- $routeHelper[] = $this->_t(4) . "'" . $viewName_single
+ $routeHelper[] = $this->_t(4) . "'" . $nameSingleCode
. "' => array()";
$routeHelper[] = $this->_t(3) . ");";
$routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Create the link but don't add the id.";
$routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_"
- . $this->componentCodeName . "&view=" . $viewName_single . "';";
+ . $this->componentCodeName . "&view=" . $nameSingleCode
+ . "';";
$routeHelper[] = $this->_t(2) . "}";
- if ('category' != $viewName_single
- && 'categories' != $viewName_single)
+ if ('category' != $nameSingleCode
+ && 'categories' != $nameSingleCode)
{
$routeHelper[] = $this->_t(2) . "if (\$catid > 1)";
$routeHelper[] = $this->_t(2) . "{";
$routeHelper[] = $this->_t(3)
. "\$categories = JCategories::getInstance('"
- . $this->componentCodeName . "." . $viewName_list . "');";
+ . $this->componentCodeName . "." . $nameListCode . "');";
$routeHelper[] = $this->_t(3)
. "\$category = \$categories->get(\$catid);";
$routeHelper[] = $this->_t(3) . "if (\$category)";
@@ -8860,11 +8907,11 @@ class Interpretation extends Fields
$routeHelper[] = $this->_t(3) . "}";
$routeHelper[] = $this->_t(2) . "}";
}
- if (isset($this->hasMenuGlobal[$viewName_single]))
+ if (isset($this->hasMenuGlobal[$nameSingleCode]))
{
$routeHelper[] = PHP_EOL . $this->_t(2)
. "if (\$item = self::_findItem(\$needles, '"
- . $viewName_single . "'))";
+ . $nameSingleCode . "'))";
}
else
{
@@ -9029,30 +9076,30 @@ class Interpretation extends Fields
}
}
- public function setBatchMove($viewName_single)
+ public function setBatchMove($nameSingleCode)
{
// set needed defaults
$category = false;
$batchmove = array();
- $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U');
+ $VIEW = ComponentbuilderHelper::safeString($nameSingleCode, 'U');
// component helper name
$Helper = $this->fileContentStatic[$this->hhh . 'Component'
. $this->hhh] . 'Helper';
// setup correct core target
$coreLoad = false;
- if (isset($this->permissionCore[$viewName_single]))
+ if (isset($this->permissionCore[$nameSingleCode]))
{
- $core = $this->permissionCore[$viewName_single];
+ $core = $this->permissionCore[$nameSingleCode];
$coreLoad = true;
}
// only load category if set in this view
- if (array_key_exists($viewName_single, $this->catCodeBuilder))
+ if (array_key_exists($nameSingleCode, $this->catCodeBuilder))
{
- $category = $this->catCodeBuilder[$viewName_single]['code'];
+ $category = $this->catCodeBuilder[$nameSingleCode]['code'];
}
// prepare custom script
$customScript = $this->getCustomScriptBuilder(
- 'php_batchmove', $viewName_single, PHP_EOL . PHP_EOL, null, true
+ 'php_batchmove', $nameSingleCode, PHP_EOL . PHP_EOL, null, true
);
$batchmove[] = PHP_EOL . $this->_t(1) . "/**";
@@ -9084,7 +9131,7 @@ class Interpretation extends Fields
$batchmove[] = $this->_t(3)
. "\$this->tableClassName = get_class(\$this->table);";
$batchmove[] = $this->_t(3) . "\$this->canDo = " . $Helper
- . "::getActions('" . $viewName_single . "');";
+ . "::getActions('" . $nameSingleCode . "');";
$batchmove[] = $this->_t(2) . "}";
if ($coreLoad && isset($core['core.edit'])
@@ -9093,7 +9140,7 @@ class Interpretation extends Fields
$this->permissionBuilder['global'][$core['core.edit']]
)
&& in_array(
- $viewName_single,
+ $nameSingleCode,
$this->permissionBuilder['global'][$core['core.edit']]
))
{
@@ -9120,7 +9167,7 @@ class Interpretation extends Fields
$this->permissionBuilder['global'][$core['core.edit.state']]
)
&& in_array(
- $viewName_single,
+ $nameSingleCode,
$this->permissionBuilder['global'][$core['core.edit.state']]
))
{
@@ -9174,7 +9221,7 @@ class Interpretation extends Fields
$this->permissionBuilder[$core['core.edit']]
)
&& in_array(
- $viewName_single, $this->permissionBuilder[$core['core.edit']]
+ $nameSingleCode, $this->permissionBuilder[$core['core.edit']]
))
{
$batchmove[] = $this->_t(3) . "if (!\$this->user->authorise('"
@@ -9274,7 +9321,7 @@ class Interpretation extends Fields
return PHP_EOL . implode(PHP_EOL, $batchmove);
}
- public function setBatchCopy($viewName_single)
+ public function setBatchCopy($nameSingleCode)
{
// set needed defaults
$title = false;
@@ -9282,37 +9329,39 @@ class Interpretation extends Fields
$alias = false;
$category = false;
$batchcopy = array();
- $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U');
+ $VIEW = ComponentbuilderHelper::safeString($nameSingleCode, 'U');
// component helper name
$Helper = $this->fileContentStatic[$this->hhh . 'Component'
. $this->hhh] . 'Helper';
// setup correct core target
$coreLoad = false;
- if (isset($this->permissionCore[$viewName_single]))
+ if (isset($this->permissionCore[$nameSingleCode]))
{
- $core = $this->permissionCore[$viewName_single];
+ $core = $this->permissionCore[$nameSingleCode];
$coreLoad = true;
}
// only load category if set in this view
- if (array_key_exists($viewName_single, $this->catCodeBuilder))
+ if (array_key_exists($nameSingleCode, $this->catCodeBuilder))
{
- $category = $this->catCodeBuilder[$viewName_single]['code'];
+ $category = $this->catCodeBuilder[$nameSingleCode]['code'];
}
// only load alias if set in this view
- if (array_key_exists($viewName_single, $this->aliasBuilder))
+ if (array_key_exists($nameSingleCode, $this->aliasBuilder))
{
- $alias = $this->aliasBuilder[$viewName_single];
+ $alias = $this->aliasBuilder[$nameSingleCode];
}
// only load title if set in this view
- if (isset($this->customAliasBuilder[$viewName_single]))
+ if (isset($this->customAliasBuilder[$nameSingleCode]))
{
- $titles = array_values($this->customAliasBuilder[$viewName_single]);
+ $titles = array_values(
+ $this->customAliasBuilder[$nameSingleCode]
+ );
$title = true;
}
- elseif (array_key_exists($viewName_single, $this->titleBuilder))
+ elseif (array_key_exists($nameSingleCode, $this->titleBuilder))
{
- $titles = array($this->titleBuilder[$viewName_single]);
+ $titles = array($this->titleBuilder[$nameSingleCode]);
$title = true;
}
// se the dynamic title
@@ -9328,7 +9377,7 @@ class Interpretation extends Fields
}
// prepare custom script
$customScript = $this->getCustomScriptBuilder(
- 'php_batchcopy', $viewName_single, PHP_EOL . PHP_EOL, null, true
+ 'php_batchcopy', $nameSingleCode, PHP_EOL . PHP_EOL, null, true
);
$batchcopy[] = PHP_EOL . $this->_t(1) . "/**";
@@ -9362,7 +9411,7 @@ class Interpretation extends Fields
$batchcopy[] = $this->_t(3)
. "\$this->tableClassName = get_class(\$this->table);";
$batchcopy[] = $this->_t(3) . "\$this->canDo = " . $Helper
- . "::getActions('" . $viewName_single . "');";
+ . "::getActions('" . $nameSingleCode . "');";
$batchcopy[] = $this->_t(2) . "}";
if ($coreLoad && isset($core['core.create'])
&& isset($this->permissionBuilder['global'][$core['core.create']])
@@ -9370,7 +9419,7 @@ class Interpretation extends Fields
$this->permissionBuilder['global'][$core['core.create']]
)
&& in_array(
- $viewName_single,
+ $nameSingleCode,
$this->permissionBuilder['global'][$core['core.create']]
))
{
@@ -9407,7 +9456,7 @@ class Interpretation extends Fields
$this->permissionBuilder['global'][$core['core.edit.state']]
)
&& in_array(
- $viewName_single,
+ $nameSingleCode,
$this->permissionBuilder['global'][$core['core.edit.state']]
))
{
@@ -9467,7 +9516,7 @@ class Interpretation extends Fields
$this->permissionBuilder[$core['core.edit']]
)
&& in_array(
- $viewName_single, $this->permissionBuilder[$core['core.edit']]
+ $nameSingleCode, $this->permissionBuilder[$core['core.edit']]
))
{
$batchcopy[] = $this->_t(3) . "if (!\$this->user->authorise('"
@@ -9668,39 +9717,39 @@ class Interpretation extends Fields
return PHP_EOL . implode(PHP_EOL, $batchcopy);
}
- public function setAliasTitleFix($viewName_single)
+ public function setAliasTitleFix($nameSingleCode)
{
$fixUnique = array();
// only load this if these two items are set
- if (array_key_exists($viewName_single, $this->aliasBuilder)
- && (array_key_exists($viewName_single, $this->titleBuilder)
- || isset($this->customAliasBuilder[$viewName_single])))
+ if (array_key_exists($nameSingleCode, $this->aliasBuilder)
+ && (array_key_exists($nameSingleCode, $this->titleBuilder)
+ || isset($this->customAliasBuilder[$nameSingleCode])))
{
// set needed defaults
$setCategory = false;
- $alias = $this->aliasBuilder[$viewName_single];
+ $alias = $this->aliasBuilder[$nameSingleCode];
$VIEW = ComponentbuilderHelper::safeString(
- $viewName_single, 'U'
+ $nameSingleCode, 'U'
);
- if (array_key_exists($viewName_single, $this->catCodeBuilder))
+ if (array_key_exists($nameSingleCode, $this->catCodeBuilder))
{
- $category = $this->catCodeBuilder[$viewName_single]['code'];
+ $category = $this->catCodeBuilder[$nameSingleCode]['code'];
$setCategory = true;
}
// set the title stuff
- if (isset($this->customAliasBuilder[$viewName_single]))
+ if (isset($this->customAliasBuilder[$nameSingleCode]))
{
$titles = array_values(
- $this->customAliasBuilder[$viewName_single]
+ $this->customAliasBuilder[$nameSingleCode]
);
- if (isset($this->titleBuilder[$viewName_single]))
+ if (isset($this->titleBuilder[$nameSingleCode]))
{
- // $titles[] = $this->titleBuilder[$viewName_single]; // TODO this may be unexpected
+ // $titles[] = $this->titleBuilder[$nameSingleCode]; // TODO this may be unexpected
}
}
else
{
- $titles = array($this->titleBuilder[$viewName_single]);
+ $titles = array($this->titleBuilder[$nameSingleCode]);
}
// start building the fix
$fixUnique[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(
@@ -9796,7 +9845,7 @@ class Interpretation extends Fields
) . ");";
$fixUnique[] = $this->_t(4) . "}";
$fixUnique[] = PHP_EOL . $this->_t(4)
- . "\$table = JTable::getInstance('" . $viewName_single . "', '"
+ . "\$table = JTable::getInstance('" . $nameSingleCode . "', '"
. $this->componentCodeName . "Table');";
if ($setCategory && count($titles) == 1)
{
@@ -9880,12 +9929,12 @@ class Interpretation extends Fields
return PHP_EOL . implode(PHP_EOL, $fixUnique);
}
- public function setGenerateNewTitle($viewName_single)
+ public function setGenerateNewTitle($nameSingleCode)
{
// if category is added to this view then do nothing
- if (array_key_exists($viewName_single, $this->aliasBuilder)
- && (array_key_exists($viewName_single, $this->titleBuilder)
- || isset($this->customAliasBuilder[$viewName_single])))
+ if (array_key_exists($nameSingleCode, $this->aliasBuilder)
+ && (array_key_exists($nameSingleCode, $this->titleBuilder)
+ || isset($this->customAliasBuilder[$nameSingleCode])))
{
// get component name
$Component = $this->fileContentStatic[$this->hhh . 'Component'
@@ -9958,7 +10007,7 @@ class Interpretation extends Fields
return implode(PHP_EOL, $newFunction);
}
- elseif (array_key_exists($viewName_single, $this->titleBuilder))
+ elseif (array_key_exists($nameSingleCode, $this->titleBuilder))
{
$newFunction = array();
$newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
@@ -9993,21 +10042,21 @@ class Interpretation extends Fields
return '';
}
- public function setGenerateNewAlias($viewName_single)
+ public function setGenerateNewAlias($nameSingleCode)
{
// make sure this view has an alias
- if (isset($this->aliasBuilder[$viewName_single]))
+ if (isset($this->aliasBuilder[$nameSingleCode]))
{
// set the title stuff
- if (isset($this->customAliasBuilder[$viewName_single]))
+ if (isset($this->customAliasBuilder[$nameSingleCode]))
{
$titles = array_values(
- $this->customAliasBuilder[$viewName_single]
+ $this->customAliasBuilder[$nameSingleCode]
);
}
- elseif (isset($this->titleBuilder[$viewName_single]))
+ elseif (isset($this->titleBuilder[$nameSingleCode]))
{
- $titles = array($this->titleBuilder[$viewName_single]);
+ $titles = array($this->titleBuilder[$nameSingleCode]);
}
// reset the bucket
$titleData = array();
@@ -11012,7 +11061,7 @@ class Interpretation extends Fields
return false;
}
- public function setCustomAdminViewListLink($view, $viewName_list)
+ public function setCustomAdminViewListLink($view, $nameListCode)
{
if (isset($this->componentData->custom_admin_views)
&& ComponentbuilderHelper::checkArray(
@@ -11061,7 +11110,7 @@ class Interpretation extends Fields
if ($setId)
{
// now load it to the global object for items list
- $this->customAdminViewListLink[$viewName_list][]
+ $this->customAdminViewListLink[$nameListCode][]
= $set;
// add to set id for list view if needed
$this->customAdminViewListId[$custom_admin_view['settings']->code]
@@ -11070,7 +11119,7 @@ class Interpretation extends Fields
else
{
// now load it to the global object for tool bar
- $this->customAdminDynamicButtons[$viewName_list][]
+ $this->customAdminDynamicButtons[$nameListCode][]
= $set;
}
// log that it has been added already
@@ -11086,16 +11135,16 @@ class Interpretation extends Fields
/**
* set the list body
*
- * @param string $viewName_single
- * @param string $viewName_list
+ * @param string $nameSingleCode
+ * @param string $nameListCode
*
* @return string
*/
- public function setListBody($viewName_single, $viewName_list)
+ public function setListBody($nameSingleCode, $nameListCode)
{
- if (isset($this->listBuilder[$viewName_list])
+ if (isset($this->listBuilder[$nameListCode])
&& ComponentbuilderHelper::checkArray(
- $this->listBuilder[$viewName_list]
+ $this->listBuilder[$nameListCode]
))
{
// component helper name
@@ -11104,9 +11153,9 @@ class Interpretation extends Fields
// setup correct core target
$coreLoad = false;
$core = null;
- if (isset($this->permissionCore[$viewName_single]))
+ if (isset($this->permissionCore[$nameSingleCode]))
{
- $core = $this->permissionCore[$viewName_single];
+ $core = $this->permissionCore[$nameSingleCode];
$coreLoad = true;
}
// make sure the custom links are only added once
@@ -11119,13 +11168,13 @@ class Interpretation extends Fields
$body .= PHP_EOL . $this->_t(2)
. "\$userChkOut = JFactory::getUser(\$item->checked_out);";
$body .= PHP_EOL . $this->_t(2) . "\$canDo = " . $Helper
- . "::getActions('" . $viewName_single . "',\$item,'"
- . $viewName_list . "');";
+ . "::getActions('" . $nameSingleCode . "',\$item,'"
+ . $nameListCode . "');";
$body .= PHP_EOL . $this->_t(1) . "?>";
$body .= PHP_EOL . $this->_t(1)
. '
';
// only load if not over written
- if (!isset($this->fieldsNames[$viewName_single]['ordering']))
+ if (!isset($this->fieldsNames[$nameSingleCode]['ordering']))
{
$body .= PHP_EOL . $this->_t(2)
. '
";
// check if this view has fields that should not be escaped
$doNotEscape = false;
- if (isset($this->doNotEscape[$viewName_list]))
+ if (isset($this->doNotEscape[$nameListCode]))
{
$doNotEscape = true;
}
// start adding the dynamic
- foreach ($this->listBuilder[$viewName_list] as $item)
+ foreach ($this->listBuilder[$nameListCode] as $item)
{
// check if target is admin list
if (1 == $item['target'] || 3 == $item['target'])
@@ -11231,7 +11277,7 @@ class Interpretation extends Fields
$itemClass = 'hidden-phone';
// set the item row
$itemRow = $this->getListItemBuilder(
- $item, $viewName_single, $viewName_list, $itemClass,
+ $item, $nameSingleCode, $nameListCode, $itemClass,
$doNotEscape, $coreLoad, $core
);
// check if buttons was aready added
@@ -11239,14 +11285,14 @@ class Interpretation extends Fields
{
// get custom admin view buttons
$customAdminViewButtons
- = $this->getCustomAdminViewButtons($viewName_list);
+ = $this->getCustomAdminViewButtons($nameListCode);
// make sure the custom admin view buttons are only added once
$firstTimeBeingAdded = false;
}
// add row to body
$body .= PHP_EOL . $this->_t(2) . "
";
}
@@ -11435,7 +11481,7 @@ class Interpretation extends Fields
}
return $this->getListItem(
- $item, $viewName_single, $viewName_list, $itemClass, $doNotEscape,
+ $item, $nameSingleCode, $nameListCode, $itemClass, $doNotEscape,
$coreLoad, $core, $class, $ref, $escape, $user, $refview
);
}
@@ -11443,29 +11489,29 @@ class Interpretation extends Fields
/**
* Get the list item row value
*
- * @param array $item The item array
- * @param string $viewName_single The single view code name
- * @param string $viewName_list The list view code name
- * @param string $itemClass The table row default class
- * @param bool $doNotEscape The do not escape global switch
- * @param bool $coreLoad The core permission loader switch
- * @param array $core The core permission values
- * @param bool $class The dive class adding switch
- * @param string $ref The link referral string
- * @param string $escape The escape code name
- * @param string $user The user code name
- * @param string $refview The override of the referral view code name
+ * @param array $item The item array
+ * @param string $nameSingleCode The single view code name
+ * @param string $nameListCode The list view code name
+ * @param string $itemClass The table row default class
+ * @param bool $doNotEscape The do not escape global switch
+ * @param bool $coreLoad The core permission loader switch
+ * @param array $core The core permission values
+ * @param bool $class The dive class adding switch
+ * @param string $ref The link referral string
+ * @param string $escape The escape code name
+ * @param string $user The user code name
+ * @param string $refview The override of the referral view code name
*
* @return string of the single item value for the table row
*
*/
- protected function getListItem($item, $viewName_single, $viewName_list,
+ protected function getListItem($item, $nameSingleCode, $nameListCode,
&$itemClass, $doNotEscape, $coreLoad, $core, $class = true, $ref = null,
$escape = '$this->escape', $user = '$this->user', $refview = null
) {
// get list item code
$itemCode = $this->getListItemCode(
- $item, $viewName_list, $doNotEscape, $escape
+ $item, $nameListCode, $doNotEscape, $escape
);
// add default links
$defaultLink = true;
@@ -11490,16 +11536,17 @@ class Interpretation extends Fields
$itemClass = 'nowrap';
// get list item link
$itemLink = $this->getListItemLink(
- $item, $checkoutTriger, $viewName_single, $viewName_list, $ref
+ $item, $checkoutTriger, $nameSingleCode, $nameListCode, $ref
);
// get list item link authority
$itemLinkAuthority = $this->getListItemLinkAuthority(
- $item, $viewName_single, $viewName_list, $coreLoad, $core, $user
+ $item, $nameSingleCode, $nameListCode, $coreLoad, $core,
+ $user
);
// set item row
return $this->getListItemLinkLogic(
- $itemCode, $itemLink, $itemLinkAuthority, $viewName_list,
+ $itemCode, $itemLink, $itemLinkAuthority, $nameListCode,
$checkoutTriger, $class
);
}
@@ -11514,7 +11561,7 @@ class Interpretation extends Fields
* @param string $itemCode The item code string
* @param string $itemLink The item link string
* @param string $itemLinkAuthority The link authority string
- * @param string $viewName_list The list view code name
+ * @param string $nameListCode The list view code name
* @param bool $checkoutTriger The check out trigger
* @param bool $class The dive class adding switch
*
@@ -11522,7 +11569,7 @@ class Interpretation extends Fields
*
*/
protected function getListItemLinkLogic($itemCode, $itemLink,
- $itemLinkAuthority, $viewName_list, $checkoutTriger, $class = true
+ $itemLinkAuthority, $nameListCode, $checkoutTriger, $class = true
) {
// build link
$link = '';
@@ -11544,7 +11591,7 @@ class Interpretation extends Fields
. "checked_out): ?>";
$link .= PHP_EOL . $tab . $this->_t(5)
. "name, \$item->checked_out_time, '"
- . $viewName_list . ".', \$canCheckin); ?>";
+ . $nameListCode . ".', \$canCheckin); ?>";
$link .= PHP_EOL . $tab . $this->_t(4) . "";
}
$link .= PHP_EOL . $tab . $this->_t(3) . "";
@@ -11564,26 +11611,26 @@ class Interpretation extends Fields
/**
* Get the custom admin view buttons
*
- * @param string $viewName_list The list view code name
- * @param string $ref The link referral string
+ * @param string $nameListCode The list view code name
+ * @param string $ref The link referral string
*
* @return string of the custom admin view buttons
*
*/
- protected function getCustomAdminViewButtons($viewName_list, $ref = '')
+ protected function getCustomAdminViewButtons($nameListCode, $ref = '')
{
$customAdminViewButton = '';
// check if custom links should be added to this list views
- if (isset($this->customAdminViewListLink[$viewName_list])
+ if (isset($this->customAdminViewListLink[$nameListCode])
&& ComponentbuilderHelper::checkArray(
- $this->customAdminViewListLink[$viewName_list]
+ $this->customAdminViewListLink[$nameListCode]
))
{
// start building the links
$customAdminViewButton .= PHP_EOL . $this->_t(3)
. '
';
foreach (
- $this->customAdminViewListLink[$viewName_list] as
+ $this->customAdminViewListLink[$nameListCode] as
$customLinkView
)
{
@@ -11619,15 +11666,15 @@ class Interpretation extends Fields
/**
* Get the list item code value
*
- * @param array $item The item array
- * @param string $viewName_list The list view code name
- * @param bool $doNotEscape The do not escape global switch
- * @param string $escape The escape code name
+ * @param array $item The item array
+ * @param string $nameListCode The list view code name
+ * @param bool $doNotEscape The do not escape global switch
+ * @param string $escape The escape code name
*
* @return string of the single item code
*
*/
- protected function getListItemCode(&$item, $viewName_list, $doNotEscape,
+ protected function getListItemCode(&$item, $nameListCode, $doNotEscape,
$escape = '$this->escape'
) {
// first update the code id needed
@@ -11666,13 +11713,13 @@ class Interpretation extends Fields
. ')->name';
}
// check if translated value is used
- elseif (isset($this->selectionTranslationFixBuilder[$viewName_list])
+ elseif (isset($this->selectionTranslationFixBuilder[$nameListCode])
&& ComponentbuilderHelper::checkArray(
- $this->selectionTranslationFixBuilder[$viewName_list]
+ $this->selectionTranslationFixBuilder[$nameListCode]
)
&& array_key_exists(
$item['code'],
- $this->selectionTranslationFixBuilder[$viewName_list]
+ $this->selectionTranslationFixBuilder[$nameListCode]
))
{
return 'JText:' . ':_($item->' . $item['code'] . ')';
@@ -11687,7 +11734,7 @@ class Interpretation extends Fields
}
elseif ($doNotEscape)
{
- if (in_array($item['code'], $this->doNotEscape[$viewName_list]))
+ if (in_array($item['code'], $this->doNotEscape[$nameListCode]))
{
return '$item->' . $item['code'];
}
@@ -11700,17 +11747,17 @@ class Interpretation extends Fields
/**
* Get the list item link
*
- * @param array $item The item array
- * @param bool $checkoutTriger The checkout trigger switch
- * @param string $viewName_single The single view code name
- * @param string $viewName_list The list view code name
- * @param string $ref The link referral string
+ * @param array $item The item array
+ * @param bool $checkoutTriger The checkout trigger switch
+ * @param string $nameSingleCode The single view code name
+ * @param string $nameListCode The list view code name
+ * @param string $ref The link referral string
*
* @return string of the single item link
*
*/
protected function getListItemLink($item, &$checkoutTriger,
- $viewName_single, $viewName_list, $ref = null
+ $nameSingleCode, $nameListCode, $ref = null
) {
// set referal if not set
$referal = '';
@@ -11729,7 +11776,7 @@ class Interpretation extends Fields
// return the link to category
return 'index.php?option=com_categories&task=category.edit&id='
. $item['code'] . '; ?>&extension='
- . $this->categoryBuilder[$viewName_list]['extension'];
+ . $this->categoryBuilder[$nameListCode]['extension'];
}
elseif ($item['type'] === 'user' && !$item['title'])
{
@@ -11773,24 +11820,24 @@ class Interpretation extends Fields
/**
* Get the list item authority
*
- * @param array $item The item array
- * @param string $viewName_single The single view code name
- * @param string $viewName_list The list view code name
- * @param bool $coreLoad The core permission loader switch
- * @param array $core The core permission values
- * @param string $user The user code name
+ * @param array $item The item array
+ * @param string $nameSingleCode The single view code name
+ * @param string $nameListCode The list view code name
+ * @param bool $coreLoad The core permission loader switch
+ * @param array $core The core permission values
+ * @param string $user The user code name
*
* @return string of the single item link authority
*
*/
- protected function getListItemLinkAuthority($item, $viewName_single,
- $viewName_list, $coreLoad, $core, $user = '$this->user'
+ protected function getListItemLinkAuthority($item, $nameSingleCode,
+ $nameListCode, $coreLoad, $core, $user = '$this->user'
) {
// if to be linked
if ($item['type'] === 'category' && !$item['title'])
{
// get the other view
- $otherView = $this->catCodeBuilder[$viewName_single]['view'];
+ $otherView = $this->catCodeBuilder[$nameSingleCode]['view'];
// return the authority to category
return $user . "->authorise('core.edit', 'com_"
@@ -11858,7 +11905,7 @@ class Interpretation extends Fields
$this->permissionBuilder['global'][$core['core.edit']]
)
&& in_array(
- $viewName_single,
+ $nameSingleCode,
$this->permissionBuilder['global'][$core['core.edit']]
))
{
@@ -11874,37 +11921,49 @@ class Interpretation extends Fields
* Get the list field class
*
* @param string $name The field code name
- * @param string $listViewName The list view code name
+ * @param string $nameListCode The list view code name
* @param string $default The default
*
* @return string The list field class
*
*/
- protected function getListFieldClass($name, $listViewName, $default = '')
+ protected function getListFieldClass($name, $nameListCode, $default = '')
{
- return (isset($this->listFieldClass[$listViewName])
- && isset($this->listFieldClass[$listViewName][$name]))
- ? $this->listFieldClass[$listViewName][$name] : $default;
+ return (isset($this->listFieldClass[$nameListCode])
+ && isset($this->listFieldClass[$nameListCode][$name]))
+ ? $this->listFieldClass[$nameListCode][$name] : $default;
}
/**
* set the list body table head
*
- * @param string $viewName_single
- * @param string $viewName_list
+ * @param string $nameSingleCode
+ * @param string $nameListCode
*
* @return string
*/
- public function setListHead($viewName_single, $viewName_list)
+ public function setListHead($nameSingleCode, $nameListCode)
{
- if (isset($this->listBuilder[$viewName_list])
+ if (isset($this->listBuilder[$nameListCode])
&& ComponentbuilderHelper::checkArray(
- $this->listBuilder[$viewName_list]
+ $this->listBuilder[$nameListCode]
))
{
+ // set the JHtml values based on filter type
+ $jhtml_sort = "grid.sort";
+ $jhtml_sort_icon = "";
+ $jhtml_sort_icon_2 = "";
+ // for the new filter
+ if (isset($this->adminFilterType[$nameListCode])
+ && $this->adminFilterType[$nameListCode] == 2)
+ {
+ $jhtml_sort = "searchtools.sort";
+ $jhtml_sort_icon = "";
+ $jhtml_sort_icon_2 = ", 'icon-menu-2'";
+ }
// main lang prefix
$langView = $this->langPrefix . '_'
- . ComponentbuilderHelper::safeString($viewName_single, 'U');
+ . ComponentbuilderHelper::safeString($nameSingleCode, 'U');
// set status lang
$statusLangName = $langView . '_STATUS';
// set id lang
@@ -11917,14 +11976,15 @@ class Interpretation extends Fields
$head = '
diff --git a/admin/views/validation_rules/view.html.php b/admin/views/validation_rules/view.html.php
index 0b1f3d44c..31fa34589 100644
--- a/admin/views/validation_rules/view.html.php
+++ b/admin/views/validation_rules/view.html.php
@@ -37,7 +37,7 @@ class ComponentbuilderViewValidation_rules extends JViewLegacy
// Add the list ordering clause.
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
- $this->saveOrder = $this->listOrder == 'ordering';
+ $this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
@@ -234,7 +234,7 @@ class ComponentbuilderViewValidation_rules extends JViewLegacy
protected function getSortFields()
{
return array(
- 'ordering' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_COMPONENTBUILDER_VALIDATION_RULE_NAME_LABEL'),
'a.short_description' => JText::_('COM_COMPONENTBUILDER_VALIDATION_RULE_SHORT_DESCRIPTION_LABEL'),
diff --git a/componentbuilder.xml b/componentbuilder.xml
index bc8ff8604..096495187 100644
--- a/componentbuilder.xml
+++ b/componentbuilder.xml
@@ -1,7 +1,7 @@
COM_COMPONENTBUILDER
- 21st November, 2020
+ 24th November, 2020Llewellyn van der Merwellewellyn@joomlacomponentbuilder.comhttp://www.joomlacomponentbuilder.com
@@ -13,7 +13,7 @@
The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
-Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
+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!
"
COM_COMPONENTBUILDER_EDIT="Edit"
COM_COMPONENTBUILDER_EDIT_S="Edit %s"
COM_COMPONENTBUILDER_EMAIL_S="Email: %s"
-COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SEND="Email with the new key was send"
+COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT="Email with the new key was sent"
COM_COMPONENTBUILDER_EMCOMPANYEM_BSB="Company:%s"
COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB="Copyright:%s"
COM_COMPONENTBUILDER_EMEMAILEM_BSB="Email:%s"