From d5482d65cb1df921d2e1aeada4bd0894c5825e0d Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 19 May 2021 17:44:14 +0200 Subject: [PATCH] Fixed gh-748 so that tags are able to be added to the list admin view. Makes the adding of tags dynamic based on tag field in the view. --- README.md | 4 +- admin/README.txt | 4 +- admin/compiler/joomla_3/JModelAdmin.php | 6 --- admin/compiler/joomla_3/JModelAdmin_site.php | 6 --- admin/helpers/compiler/c_Fields.php | 11 ++-- admin/helpers/compiler/e_Interpretation.php | 53 ++++++++++++++++++- admin/models/admin_custom_tabs.php | 6 --- admin/models/admin_fields.php | 6 --- admin/models/admin_fields_conditions.php | 6 --- admin/models/admin_fields_relations.php | 6 --- admin/models/admin_view.php | 6 --- admin/models/class_extends.php | 6 --- admin/models/class_method.php | 6 --- admin/models/class_property.php | 6 --- admin/models/component_admin_views.php | 6 --- admin/models/component_config.php | 6 --- admin/models/component_custom_admin_menus.php | 6 --- admin/models/component_custom_admin_views.php | 6 --- admin/models/component_dashboard.php | 6 --- admin/models/component_files_folders.php | 6 --- admin/models/component_modules.php | 6 --- admin/models/component_mysql_tweaks.php | 6 --- admin/models/component_placeholders.php | 6 --- admin/models/component_plugins.php | 6 --- admin/models/component_site_views.php | 6 --- admin/models/component_updates.php | 6 --- admin/models/custom_admin_view.php | 6 --- admin/models/custom_code.php | 6 --- admin/models/dynamic_get.php | 6 --- admin/models/field.php | 6 --- admin/models/fieldtype.php | 6 --- admin/models/help_document.php | 6 --- admin/models/joomla_component.php | 6 --- admin/models/joomla_module.php | 6 --- .../joomla_module_files_folders_urls.php | 6 --- admin/models/joomla_module_updates.php | 6 --- admin/models/joomla_plugin.php | 6 --- .../joomla_plugin_files_folders_urls.php | 6 --- admin/models/joomla_plugin_group.php | 6 --- admin/models/joomla_plugin_updates.php | 6 --- admin/models/language.php | 6 --- admin/models/language_translation.php | 6 --- admin/models/layout.php | 6 --- admin/models/library.php | 6 --- admin/models/library_config.php | 6 --- admin/models/library_files_folders_urls.php | 6 --- admin/models/placeholder.php | 6 --- admin/models/server.php | 6 --- admin/models/site_view.php | 6 --- admin/models/snippet.php | 6 --- admin/models/snippet_type.php | 6 --- admin/models/template.php | 6 --- admin/models/validation_rule.php | 6 --- admin/sql/install.mysql.utf8.sql | 2 +- componentbuilder.xml | 2 +- 55 files changed, 64 insertions(+), 306 deletions(-) diff --git a/README.md b/README.md index 7e1433018..e3836b369 100644 --- a/README.md +++ b/README.md @@ -143,11 +143,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*: 17th May, 2021 ++ *Last Build*: 19th May, 2021 + *Version*: 2.12.9 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **292237** ++ *Line count*: **291955** + *Field count*: **1629** + *File count*: **1935** + *Folder count*: **322** diff --git a/admin/README.txt b/admin/README.txt index 7e1433018..e3836b369 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,11 +143,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*: 17th May, 2021 ++ *Last Build*: 19th May, 2021 + *Version*: 2.12.9 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **292237** ++ *Line count*: **291955** + *Field count*: **1629** + *File count*: **1935** + *Folder count*: **322** diff --git a/admin/compiler/joomla_3/JModelAdmin.php b/admin/compiler/joomla_3/JModelAdmin.php index 9922d920b..eccb3d614 100644 --- a/admin/compiler/joomla_3/JModelAdmin.php +++ b/admin/compiler/joomla_3/JModelAdmin.php @@ -92,12 +92,6 @@ class ###Component###Model###View### extends JModelAdmin $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); }###METHOD_GET_ITEM### - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_###component###.###view###'); - } }###LINKEDVIEWGLOBAL### return $item; diff --git a/admin/compiler/joomla_3/JModelAdmin_site.php b/admin/compiler/joomla_3/JModelAdmin_site.php index b0a06753d..9c47bab9d 100644 --- a/admin/compiler/joomla_3/JModelAdmin_site.php +++ b/admin/compiler/joomla_3/JModelAdmin_site.php @@ -92,12 +92,6 @@ class ###Component###Model###View### extends JModelAdmin $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); }###METHOD_GET_ITEM### - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_###component###.###view###'); - } }###LINKEDVIEWGLOBAL### return $item; diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 5bcc423ec..43ddf0f18 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -4578,6 +4578,12 @@ class Fields extends Structure $nameListCode, $name, $view, $field, $typeName, $multiple, $custom = false, $options = false ) { + // check if this is a tag field + if ($typeName === 'tag') + { + // set tags for this view but don't load to DB + $this->tagsBuilder[$nameSingleCode] = $nameSingleCode; + } // dbSwitch $dbSwitch = true; if (isset($field['list']) && $field['list'] == 2) @@ -4585,11 +4591,6 @@ class Fields extends Structure // do not add this field to the database $dbSwitch = false; } - elseif ($typeName === 'tag') - { - // set tags for this view but don't load to DB - $this->tagsBuilder[$nameSingleCode] = $nameSingleCode; - } elseif (isset($field['settings']->datatype)) { // insure default not none if number type diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 55bac6b91..d9229b9a3 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -7299,6 +7299,8 @@ class Interpretation extends Fields // get the component name $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; + $component = $this->fileContentStatic[$this->hhh . 'component' + . $this->hhh]; // go from base64 to string if (isset($this->base64Builder[$view]) && ComponentbuilderHelper::checkArray($this->base64Builder[$view])) @@ -7453,7 +7455,21 @@ class Interpretation extends Fields $script .= PHP_EOL . $this->_t(3) . "}"; } } - + // add the tag get options + if (isset($this->tagsBuilder[$view])) + { + $script .= PHP_EOL . PHP_EOL . $this->_t(3) + . "if (!empty(\$item->id))"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Get Tag IDs."; + $script .= PHP_EOL . $this->_t(4) . "\$item->tags" + . " = new JHelperTags;"; + $script .= PHP_EOL . $this->_t(4) + . "\$item->tags->getTagIds(\$item->id, 'com_$component.$view');"; + $script .= PHP_EOL . $this->_t(3) . "}"; + } // add custom php to getitem method $script .= $this->getCustomScriptBuilder( 'php_getitem', $view, PHP_EOL . PHP_EOL @@ -21705,6 +21721,41 @@ class Interpretation extends Fields $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}" . PHP_EOL; } + // add the tags if needed + if (isset($this->tagsBuilder[$nameSingleCode])) + { + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" + . $this->setLine( + __LINE__ + ) . " Add the tags"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "\$item->tags = new JHelperTags;"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "\$item->tags->getTagIds("; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "\$item->id, 'com_" + . $this->fileContentStatic[$this->hhh . 'component' + . $this->hhh] . ".$nameSingleCode'"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . ");"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "if (\$item->tags->tags)"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "\$item->tags = implode(', ',"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "\$item->tags->getTagNames("; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) + . "explode(',', \$item->tags->tags)"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . ")"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . ");"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "else"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "\$item->tags = '';"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; + } // get the correct array if ($export || $all) { diff --git a/admin/models/admin_custom_tabs.php b/admin/models/admin_custom_tabs.php index a2dc3290d..60b6ef82f 100644 --- a/admin/models/admin_custom_tabs.php +++ b/admin/models/admin_custom_tabs.php @@ -106,12 +106,6 @@ class ComponentbuilderModelAdmin_custom_tabs extends JModelAdmin $tabs->loadString($item->tabs); $item->tabs = $tabs->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.admin_custom_tabs'); - } } return $item; diff --git a/admin/models/admin_fields.php b/admin/models/admin_fields.php index 9eb9bf0a8..03e9b9640 100644 --- a/admin/models/admin_fields.php +++ b/admin/models/admin_fields.php @@ -127,12 +127,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin $fieldsUpdate->addfields = json_encode($bucket); $this->_db->updateObject('#__componentbuilder_admin_fields', $fieldsUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields'); - } } return $item; diff --git a/admin/models/admin_fields_conditions.php b/admin/models/admin_fields_conditions.php index 686e5dc8c..4fd7f4596 100644 --- a/admin/models/admin_fields_conditions.php +++ b/admin/models/admin_fields_conditions.php @@ -127,12 +127,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin $conditionsUpdate->addconditions = json_encode($bucket); $this->_db->updateObject('#__componentbuilder_admin_fields_conditions', $conditionsUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields_conditions'); - } } return $item; diff --git a/admin/models/admin_fields_relations.php b/admin/models/admin_fields_relations.php index 1f155d9a1..39c0baa35 100644 --- a/admin/models/admin_fields_relations.php +++ b/admin/models/admin_fields_relations.php @@ -189,12 +189,6 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields_relations'); - } } return $item; diff --git a/admin/models/admin_view.php b/admin/models/admin_view.php index d2a640855..b97ef41a6 100644 --- a/admin/models/admin_view.php +++ b/admin/models/admin_view.php @@ -665,12 +665,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->mysql_table_collate = 'utf8_general_ci'; } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.admin_view'); - } } return $item; diff --git a/admin/models/class_extends.php b/admin/models/class_extends.php index 03216d301..324904834 100644 --- a/admin/models/class_extends.php +++ b/admin/models/class_extends.php @@ -196,12 +196,6 @@ class ComponentbuilderModelClass_extends extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.class_extends'); - } } return $item; diff --git a/admin/models/class_method.php b/admin/models/class_method.php index bb7e9bd71..963c9ba29 100644 --- a/admin/models/class_method.php +++ b/admin/models/class_method.php @@ -205,12 +205,6 @@ class ComponentbuilderModelClass_method extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.class_method'); - } } return $item; diff --git a/admin/models/class_property.php b/admin/models/class_property.php index 0f25141ec..eebd9c231 100644 --- a/admin/models/class_property.php +++ b/admin/models/class_property.php @@ -196,12 +196,6 @@ class ComponentbuilderModelClass_property extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.class_property'); - } } return $item; diff --git a/admin/models/component_admin_views.php b/admin/models/component_admin_views.php index b83118693..29d9f4811 100644 --- a/admin/models/component_admin_views.php +++ b/admin/models/component_admin_views.php @@ -138,12 +138,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_admin_views', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_admin_views'); - } } return $item; diff --git a/admin/models/component_config.php b/admin/models/component_config.php index 7a0540f2d..2199a945d 100644 --- a/admin/models/component_config.php +++ b/admin/models/component_config.php @@ -137,12 +137,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_config', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_config'); - } } return $item; diff --git a/admin/models/component_custom_admin_menus.php b/admin/models/component_custom_admin_menus.php index 7e9171664..75a3031c8 100644 --- a/admin/models/component_custom_admin_menus.php +++ b/admin/models/component_custom_admin_menus.php @@ -137,12 +137,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_custom_admin_menus', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_custom_admin_menus'); - } } return $item; diff --git a/admin/models/component_custom_admin_views.php b/admin/models/component_custom_admin_views.php index 0f438a0ca..68602a308 100644 --- a/admin/models/component_custom_admin_views.php +++ b/admin/models/component_custom_admin_views.php @@ -138,12 +138,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_custom_admin_views', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_custom_admin_views'); - } } return $item; diff --git a/admin/models/component_dashboard.php b/admin/models/component_dashboard.php index bc38469ab..a81f696e3 100644 --- a/admin/models/component_dashboard.php +++ b/admin/models/component_dashboard.php @@ -226,12 +226,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_dashboard', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_dashboard'); - } } return $item; diff --git a/admin/models/component_files_folders.php b/admin/models/component_files_folders.php index 85645e4e5..96bce3205 100644 --- a/admin/models/component_files_folders.php +++ b/admin/models/component_files_folders.php @@ -174,12 +174,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_files_folders', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_files_folders'); - } } return $item; diff --git a/admin/models/component_modules.php b/admin/models/component_modules.php index 4e5917003..ce8b06a2c 100644 --- a/admin/models/component_modules.php +++ b/admin/models/component_modules.php @@ -107,12 +107,6 @@ class ComponentbuilderModelComponent_modules extends JModelAdmin $addjoomla_modules->loadString($item->addjoomla_modules); $item->addjoomla_modules = $addjoomla_modules->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_modules'); - } } return $item; diff --git a/admin/models/component_mysql_tweaks.php b/admin/models/component_mysql_tweaks.php index 257a96331..329f8b9aa 100644 --- a/admin/models/component_mysql_tweaks.php +++ b/admin/models/component_mysql_tweaks.php @@ -137,12 +137,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_mysql_tweaks', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_mysql_tweaks'); - } } return $item; diff --git a/admin/models/component_placeholders.php b/admin/models/component_placeholders.php index bf9c9ec03..a3a397c0c 100644 --- a/admin/models/component_placeholders.php +++ b/admin/models/component_placeholders.php @@ -106,12 +106,6 @@ class ComponentbuilderModelComponent_placeholders extends JModelAdmin $addplaceholders->loadString($item->addplaceholders); $item->addplaceholders = $addplaceholders->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_placeholders'); - } } return $item; diff --git a/admin/models/component_plugins.php b/admin/models/component_plugins.php index 00430c310..9d9987662 100644 --- a/admin/models/component_plugins.php +++ b/admin/models/component_plugins.php @@ -107,12 +107,6 @@ class ComponentbuilderModelComponent_plugins extends JModelAdmin $addjoomla_plugins->loadString($item->addjoomla_plugins); $item->addjoomla_plugins = $addjoomla_plugins->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_plugins'); - } } return $item; diff --git a/admin/models/component_site_views.php b/admin/models/component_site_views.php index ebec0c7de..efbf85c1d 100644 --- a/admin/models/component_site_views.php +++ b/admin/models/component_site_views.php @@ -138,12 +138,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_site_views', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_site_views'); - } } return $item; diff --git a/admin/models/component_updates.php b/admin/models/component_updates.php index 6d0af5578..202f4c90c 100644 --- a/admin/models/component_updates.php +++ b/admin/models/component_updates.php @@ -137,12 +137,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_component_updates', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.component_updates'); - } } return $item; diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php index 170e83530..2e605f43c 100644 --- a/admin/models/custom_admin_view.php +++ b/admin/models/custom_admin_view.php @@ -371,12 +371,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin // be sure to update the table if we found repeatable fields that are still not converted $this->_db->updateObject('#__componentbuilder_custom_admin_view', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.custom_admin_view'); - } } return $item; diff --git a/admin/models/custom_code.php b/admin/models/custom_code.php index ad77de21b..152809a15 100644 --- a/admin/models/custom_code.php +++ b/admin/models/custom_code.php @@ -205,12 +205,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.custom_code'); - } } return $item; diff --git a/admin/models/dynamic_get.php b/admin/models/dynamic_get.php index 67c3a90b1..ac3f8aab3 100644 --- a/admin/models/dynamic_get.php +++ b/admin/models/dynamic_get.php @@ -385,12 +385,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_dynamic_get', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.dynamic_get'); - } } return $item; diff --git a/admin/models/field.php b/admin/models/field.php index c2a8a2226..9edc2a199 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -284,12 +284,6 @@ class ComponentbuilderModelField extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.field'); - } } return $item; diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index 025e6440c..7b37b917d 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -232,12 +232,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $objectUpdate->properties = json_encode($bucket); $this->db->updateObject('#__componentbuilder_fieldtype', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.fieldtype'); - } } $this->fieldtypevvvv = $item->id; diff --git a/admin/models/help_document.php b/admin/models/help_document.php index 23e4eee7c..c7545e42c 100644 --- a/admin/models/help_document.php +++ b/admin/models/help_document.php @@ -120,12 +120,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin // JSON Decode groups. $item->groups = json_decode($item->groups,true); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.help_document'); - } } return $item; diff --git a/admin/models/joomla_component.php b/admin/models/joomla_component.php index ab68e104a..af8e3ba75 100644 --- a/admin/models/joomla_component.php +++ b/admin/models/joomla_component.php @@ -548,12 +548,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_joomla_component', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_component'); - } } return $item; diff --git a/admin/models/joomla_module.php b/admin/models/joomla_module.php index 965c88c69..d7f46fe1d 100644 --- a/admin/models/joomla_module.php +++ b/admin/models/joomla_module.php @@ -377,12 +377,6 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_module'); - } } return $item; diff --git a/admin/models/joomla_module_files_folders_urls.php b/admin/models/joomla_module_files_folders_urls.php index b51d382b4..75983b83e 100644 --- a/admin/models/joomla_module_files_folders_urls.php +++ b/admin/models/joomla_module_files_folders_urls.php @@ -152,12 +152,6 @@ class ComponentbuilderModelJoomla_module_files_folders_urls extends JModelAdmin $addurls->loadString($item->addurls); $item->addurls = $addurls->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_module_files_folders_urls'); - } } return $item; diff --git a/admin/models/joomla_module_updates.php b/admin/models/joomla_module_updates.php index dfc218c85..2162adc47 100644 --- a/admin/models/joomla_module_updates.php +++ b/admin/models/joomla_module_updates.php @@ -106,12 +106,6 @@ class ComponentbuilderModelJoomla_module_updates extends JModelAdmin $version_update->loadString($item->version_update); $item->version_update = $version_update->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_module_updates'); - } } return $item; diff --git a/admin/models/joomla_plugin.php b/admin/models/joomla_plugin.php index c1c17c29d..baca3260e 100644 --- a/admin/models/joomla_plugin.php +++ b/admin/models/joomla_plugin.php @@ -342,12 +342,6 @@ class ComponentbuilderModelJoomla_plugin extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin'); - } } return $item; diff --git a/admin/models/joomla_plugin_files_folders_urls.php b/admin/models/joomla_plugin_files_folders_urls.php index 1b24326d4..ea3dec5cb 100644 --- a/admin/models/joomla_plugin_files_folders_urls.php +++ b/admin/models/joomla_plugin_files_folders_urls.php @@ -152,12 +152,6 @@ class ComponentbuilderModelJoomla_plugin_files_folders_urls extends JModelAdmin $addurls->loadString($item->addurls); $item->addurls = $addurls->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin_files_folders_urls'); - } } return $item; diff --git a/admin/models/joomla_plugin_group.php b/admin/models/joomla_plugin_group.php index 5d1634db8..95fc01095 100644 --- a/admin/models/joomla_plugin_group.php +++ b/admin/models/joomla_plugin_group.php @@ -98,12 +98,6 @@ class ComponentbuilderModelJoomla_plugin_group extends JModelAdmin $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin_group'); - } } return $item; diff --git a/admin/models/joomla_plugin_updates.php b/admin/models/joomla_plugin_updates.php index 1d34194d3..77d3b587d 100644 --- a/admin/models/joomla_plugin_updates.php +++ b/admin/models/joomla_plugin_updates.php @@ -106,12 +106,6 @@ class ComponentbuilderModelJoomla_plugin_updates extends JModelAdmin $version_update->loadString($item->version_update); $item->version_update = $version_update->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin_updates'); - } } return $item; diff --git a/admin/models/language.php b/admin/models/language.php index 407ee5a51..892660ded 100644 --- a/admin/models/language.php +++ b/admin/models/language.php @@ -98,12 +98,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.language'); - } } return $item; diff --git a/admin/models/language_translation.php b/admin/models/language_translation.php index c068b27ae..b473354fe 100644 --- a/admin/models/language_translation.php +++ b/admin/models/language_translation.php @@ -195,12 +195,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.language_translation'); - } } return $item; diff --git a/admin/models/layout.php b/admin/models/layout.php index 7f815ae13..2ae8c5f83 100644 --- a/admin/models/layout.php +++ b/admin/models/layout.php @@ -223,12 +223,6 @@ class ComponentbuilderModelLayout extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.layout'); - } } return $item; diff --git a/admin/models/library.php b/admin/models/library.php index 503114920..3613effa1 100644 --- a/admin/models/library.php +++ b/admin/models/library.php @@ -240,12 +240,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.library'); - } } return $item; diff --git a/admin/models/library_config.php b/admin/models/library_config.php index 7a59f29a4..15983504b 100644 --- a/admin/models/library_config.php +++ b/admin/models/library_config.php @@ -106,12 +106,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin $addconfig->loadString($item->addconfig); $item->addconfig = $addconfig->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.library_config'); - } } return $item; diff --git a/admin/models/library_files_folders_urls.php b/admin/models/library_files_folders_urls.php index e162b23f3..61c00b9a0 100644 --- a/admin/models/library_files_folders_urls.php +++ b/admin/models/library_files_folders_urls.php @@ -152,12 +152,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin $addurls->loadString($item->addurls); $item->addurls = $addurls->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.library_files_folders_urls'); - } } return $item; diff --git a/admin/models/placeholder.php b/admin/models/placeholder.php index a647a004f..2a62e6629 100644 --- a/admin/models/placeholder.php +++ b/admin/models/placeholder.php @@ -189,12 +189,6 @@ class ComponentbuilderModelPlaceholder extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.placeholder'); - } } return $item; diff --git a/admin/models/server.php b/admin/models/server.php index 5c85cd5dd..a9a940f0a 100644 --- a/admin/models/server.php +++ b/admin/models/server.php @@ -174,12 +174,6 @@ class ComponentbuilderModelServer extends JModelAdmin // basic decrypt data username. $item->username = rtrim($basic->decryptString($item->username), "\0"); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.server'); - } } $this->sales_serverupdate_servervvvw = $item->id; diff --git a/admin/models/site_view.php b/admin/models/site_view.php index 62abfdcc7..d5539ec61 100644 --- a/admin/models/site_view.php +++ b/admin/models/site_view.php @@ -392,12 +392,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin { $this->_db->updateObject('#__componentbuilder_site_view', $objectUpdate, 'id'); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.site_view'); - } } return $item; diff --git a/admin/models/snippet.php b/admin/models/snippet.php index b3b150d35..3b6b48a8a 100644 --- a/admin/models/snippet.php +++ b/admin/models/snippet.php @@ -125,12 +125,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin // base64 Decode snippet. $item->snippet = base64_decode($item->snippet); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.snippet'); - } } return $item; diff --git a/admin/models/snippet_type.php b/admin/models/snippet_type.php index 6894c6468..bb07af8f1 100644 --- a/admin/models/snippet_type.php +++ b/admin/models/snippet_type.php @@ -98,12 +98,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.snippet_type'); - } } return $item; diff --git a/admin/models/template.php b/admin/models/template.php index 98ba44c22..93cfffe05 100644 --- a/admin/models/template.php +++ b/admin/models/template.php @@ -223,12 +223,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.template'); - } } return $item; diff --git a/admin/models/validation_rule.php b/admin/models/validation_rule.php index 89d4b1c8d..f9d855209 100644 --- a/admin/models/validation_rule.php +++ b/admin/models/validation_rule.php @@ -192,12 +192,6 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid); } } - - if (!empty($item->id)) - { - $item->tags = new JHelperTags; - $item->tags->getTagIds($item->id, 'com_componentbuilder.validation_rule'); - } } return $item; diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index bc3fad8ca..66eadd566 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -2141,7 +2141,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `description`, `name`, `prope (4, 'The checkboxes form field type provides a set of checkboxes. Note: unlike most standard form field types, such as textfield or checkbox, this field is not an \"out of the box\" solution. It will create checkboxes for you, and submit their values in form of ', 'Checkboxes', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkboxes\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkboxs\"},\"properties1\":{\"name\":\"name\",\"example\":\"toppings\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select Toppings\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"option\",\"example\":\"anch|Anchovies,chor|Chorizo,on|Onions,mush|Mushrooms\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties5\":{\"name\":\"description\",\"example\":\"Select the topping of your choice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides unlimited checkboxes that can be used for multi-select.', '', 1, 4, '', '', 'ac10859b-58da-4584-9682-36a6c2c8d04d'), (5, 'Provides a color picker. Enter the color as #ff00ff or pick it from the palet.', 'Color', '{\"properties0\":{\"name\":\"type\",\"example\":\"color\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be color.\"},\"properties1\":{\"name\":\"name\",\"example\":\"backgroundcolor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"default\",\"example\":\"#FFFFFF\",\"adjustable\":\"1\",\"description\":\"(optional) provides a color when not set.\"},\"properties3\":{\"name\":\"label\",\"example\":\"Background\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Select the background color here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a color picker when clicking the input box.', '', 1, 5, '', '', '7f60f198-53e7-4fe9-813f-d1b6c553680e'), (6, 'The list form field type provides a drop down list or a list box of other current component table entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Custom', '{\"properties0\":{\"name\":\"type\",\"example\":\"subjects\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type. You can also not use the \\\"_\\\" (underscore) or \\\"-\\\" (hyphen) in the type name, and no spaces.\"},\"properties1\":{\"name\":\"name\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a Subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties14\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties15\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"properties16\":{\"name\":\"table\",\"example\":\"#__###component###_subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. The ###TABLE### placeholder holds the table in the php.\"},\"properties17\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties18\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties19\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties20\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to. The ###TEXT### placeholder holds the value_field in the php.\"},\"properties21\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key. The ###ID### placeholder holds the key_field in the php.\"},\"properties22\":{\"name\":\"prime_php\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"This field makes sure that the PHP used here is used to build the field type, and other are custom fields with the same field type are ignored. So to avoid that they over write the PHP added here. You should only have one prime per\\/type. To disable remove the field or set to 0\"},\"properties23\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ Get the user object.\\r\\n\\t\\t$user = JFactory::getUser();\\r\\n\\t\\t\\/\\/ Get the databse object.\\r\\n\\t\\t$db = JFactory::getDBO();\\r\\n\\t\\t$query = $db->getQuery(true);\\r\\n\\t\\t$query->select($db->quoteName(array(\'a.###ID###\',\'a.###TEXT###\'),array(\'###ID###\',\'###CODE_TEXT###\')));\\r\\n\\t\\t$query->from($db->quoteName(\'###TABLE###\', \'a\'));\\r\\n\\t\\t$query->where($db->quoteName(\'a.published\') . \' = 1\');\\r\\n\\t\\t$query->order(\'a.###TEXT### ASC\');\\r\\n\\t\\t\\/\\/ Implement View Level Access (if set in table)\\r\\n\\t\\tif (!$user->authorise(\'core.options\', \'[[[com_component]]]\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$columns = $db->getTableColumns(\'###TABLE###\');\\r\\n\\t\\t\\tif(isset($columns[\'access\']))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$groups = implode(\',\', $user->getAuthorisedViewLevels());\\r\\n\\t\\t\\t\\t$query->where(\'a.access IN (\' . $groups . \')\');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t$db->setQuery((string)$query);\\r\\n\\t\\t$items = $db->loadObjectList();\\r\\n\\t\\t$options = array();\\r\\n\\t\\tif ($items)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($this->multiple === false)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$options[] = JHtml::_(\'select.option\', \'\', JText::_(\'Select an option\'));\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tforeach($items as $item)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$options[] = JHtml::_(\'select.option\', $item->###ID###, $item->###CODE_TEXT###);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\treturn $options;\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 28, '', '', 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a'), -(7, 'The a list of users that can be targeting one or more groups and excluded users that already belongs to an item in a view.', 'CustomUser', '{\"properties0\":{\"name\":\"type\",\"example\":\"staffusers\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties15\":{\"name\":\"view\",\"example\":\"###view###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ set the groups array\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties20\":{\"name\":\"type_php_2\",\"example\":\"$groups = JComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties21\":{\"name\":\"type_php_3\",\"example\":\"return $groups;\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties22\":{\"name\":\"type_phpx_1\",\"example\":\"\\/\\/ To ensure that there is only one record per user\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties23\":{\"name\":\"type_phpx_2\",\"example\":\"\\/\\/ Get a db connection.\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties24\":{\"name\":\"type_phpx_3\",\"example\":\"$db = JFactory::getDbo();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties25\":{\"name\":\"type_phpx_4\",\"example\":\"\\/\\/ Create a new query object.\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties26\":{\"name\":\"type_phpx_5\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties27\":{\"name\":\"type_phpx_6\",\"example\":\"\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties28\":{\"name\":\"type_phpx_7\",\"example\":\"$query->select($db->quoteName(\'###CODE###\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties29\":{\"name\":\"type_phpx_8\",\"example\":\"$query->from($db->quoteName(\'#__###component###_###view###\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties30\":{\"name\":\"type_phpx_9\",\"example\":\"$db->setQuery($query);\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties31\":{\"name\":\"type_phpx_10\",\"example\":\"$db->execute();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties32\":{\"name\":\"type_phpx_11\",\"example\":\"$found = $db->getNumRows();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties33\":{\"name\":\"type_phpx_12\",\"example\":\"if ($found)\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties34\":{\"name\":\"type_phpx_13\",\"example\":\"{\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties35\":{\"name\":\"type_phpx_14\",\"example\":\"\\\\t\\/\\/ return all users already used\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties36\":{\"name\":\"type_phpx_15\",\"example\":\"\\\\treturn array_unique($db->loadColumn());\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties37\":{\"name\":\"type_phpx_16\",\"example\":\"}\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties38\":{\"name\":\"type_phpx_17\",\"example\":\"return null;\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"}}', 'Provides list of users.', '', 1, 5, '', '', 'a4a39f70-070f-459c-be4b-0ac103a29b9a'), +(7, 'The a list of users that can be targeting one or more groups and excluded users that already belongs to an item in a view.', 'CustomUser', '{\"properties0\":{\"name\":\"type\",\"example\":\"staffusers\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties15\":{\"name\":\"view\",\"example\":\"###view###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\t\\t\\/\\/ set the groups array\\r\\n\\t\\treturn JComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties22\":{\"name\":\"type_phpx_1\",\"example\":\"\\t\\t\\/\\/ To ensure that there is only one record per user\\r\\n\\t\\t\\/\\/ Get a db connection.\\r\\n\\t\\t$db = JFactory::getDbo();\\r\\n\\t\\t\\/\\/ Create a new query object.\\r\\n\\t\\t$query = $db->getQuery(true);\\r\\n\\t\\t\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\\r\\n\\t\\t$query->select($db->quoteName(\'###CODE###\'));\\r\\n\\t\\t$query->from($db->quoteName(\'#__###component###_###view###\'));\\r\\n\\t\\t$db->setQuery($query);\\r\\n\\t\\t$db->execute();\\r\\n\\t\\t$found = $db->getNumRows();\\r\\n\\t\\tif ($found)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ return all users already used\\r\\n\\t\\t\\treturn array_unique($db->loadColumn());\\r\\n\\t\\t}\\r\\n\\t\\treturn null;\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"}}', 'Provides list of users.', '', 1, 6, '', '', 'a4a39f70-070f-459c-be4b-0ac103a29b9a'), (8, 'The Editor field type provides a WYSIWYG editor.', 'Editor', '{\"properties0\":{\"name\":\"type\",\"example\":\"editor\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editor.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextblock\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Test Field\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties7\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties8\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties9\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties10\":{\"name\":\"buttons\",\"example\":\"no\",\"adjustable\":\"1\",\"description\":\"(optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.\"},\"properties11\":{\"name\":\"syntax\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) can be used to set the code syntax matching for this field.\"},\"properties12\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties13\":{\"name\":\"editor\",\"example\":\"codemirror|none\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties14\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties15\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties16\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides an editor area field.', '', 1, 11, '', '', '51f288d2-6eaa-42bc-a182-a6f69b3032b8'), (9, 'The hidden form field type provides a hidden field for saving a field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the params.ini file). If the parameter has a saved value this is entered i', 'Hidden', '{\"properties0\":{\"name\":\"type\",\"example\":\"hidden\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be hidden.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mysecretvariable\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the data which needs to be collected.\"},\"properties5\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties4\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"}}', 'provides a hidden field for saving a form field whose value cannot be altered directly by a user.', '', 1, 2, '', '', '82f1b5ca-bb9b-44d7-9a7a-9a03fb2a31dd'), (10, 'The integer form field type provides a select box with a range of integer values. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Integer', '{\"properties0\":{\"name\":\"type\",\"example\":\"integer\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be integer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties9\":{\"name\":\"first\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties10\":{\"name\":\"last\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties11\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of integers between a minimum and maximum.', '', 1, 6, '', '', 'fdbb50ea-35d2-45b2-a0bc-076fdf1544b8'), diff --git a/componentbuilder.xml b/componentbuilder.xml index 67fa010cb..8b9d45963 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 17th May, 2021 + 19th May, 2021 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com