From 5db5ac7bbbe551366a785b7f8b2f4825718f114f Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 21 Nov 2020 08:01:26 +0200 Subject: [PATCH] Refactored the setFilterFields and setStoredId in the compiler as still part of the new filter option improvement. gh-378 --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/compiler/e_Interpretation.php | 343 +++++++++++--------- admin/models/admin_views.php | 16 +- admin/models/class_extendings.php | 8 +- admin/models/class_methods.php | 8 +- admin/models/class_properties.php | 8 +- admin/models/custom_admin_views.php | 16 +- admin/models/custom_codes.php | 10 +- admin/models/dynamic_gets.php | 8 +- admin/models/fields.php | 10 +- admin/models/fieldtypes.php | 12 +- admin/models/help_documents.php | 10 +- admin/models/joomla_components.php | 12 +- admin/models/joomla_modules.php | 8 +- admin/models/joomla_plugin_groups.php | 8 +- admin/models/joomla_plugins.php | 10 +- admin/models/layouts.php | 12 +- admin/models/libraries.php | 12 +- admin/models/site_views.php | 16 +- admin/models/snippets.php | 12 +- admin/models/templates.php | 12 +- componentbuilder.xml | 2 +- 23 files changed, 291 insertions(+), 266 deletions(-) diff --git a/README.md b/README.md index 678a1a583..fba3b9200 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ 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*: 20th November, 2020 ++ *Last Build*: 21st 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 diff --git a/admin/README.txt b/admin/README.txt index 678a1a583..fba3b9200 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,7 +144,7 @@ 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*: 20th November, 2020 ++ *Last Build*: 21st 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 diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 7ffc85edc..06dcfdfc8 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -19627,16 +19627,25 @@ class Interpretation extends Fields return $access; } - public function setFilterFields(&$view) + /** + * set the filter fields + * + * @param string $name_list_code The list view name + * + * @return string The code for the filter fields array + * + */ + public function setFilterFields(&$name_list_code) { // keep track of all fields already added - $donelist = array('id', 'search', 'published', 'access', 'created_by', - 'modified_by'); + $donelist = array('id' => true, 'search' => true, + 'published' => true, 'access' => true, + 'created_by' => true, 'modified_by' => true); // default filter fields $fields = "'a.id','id'"; $fields .= "," . PHP_EOL . $this->_t(4) . "'a.published','published'"; - if (isset($this->accessBuilder[$view]) - && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) + if (isset($this->accessBuilder[$name_list_code]) + && ComponentbuilderHelper::checkString($this->accessBuilder[$name_list_code])) { $fields .= "," . PHP_EOL . $this->_t(4) . "'a.access','access'"; } @@ -19646,80 +19655,28 @@ class Interpretation extends Fields . "'a.modified_by','modified_by'"; // add the rest of the set filters - if (isset($this->sortBuilder[$view]) - && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) + if (isset($this->filterBuilder[$name_list_code]) + && ComponentbuilderHelper::checkArray($this->filterBuilder[$name_list_code])) { - foreach ($this->sortBuilder[$view] as $filter) + foreach ($this->filterBuilder[$name_list_code] as $filter) { - if (!in_array($filter['code'], $donelist)) + if (!isset($donelist[$filter['code']])) { - if ($filter['type'] === 'category') - { - $fields .= "," . PHP_EOL . $this->_t(4) - . "'c.title','category_title'"; - $fields .= "," . PHP_EOL . $this->_t(4) - . "'c.id', 'category_id'"; - if ($filter['code'] != 'category') - { - $fields .= "," . PHP_EOL . $this->_t(4) . "'a." - . $filter['code'] . "', '" . $filter['code'] - . "'"; - } - } - else - { - // check if custom field is set - if (ComponentbuilderHelper::checkArray( - $filter['custom'] - )) - { - $fields .= "," . PHP_EOL . $this->_t(4) . "'" - . $filter['custom']['db'] . "." - . $filter['custom']['text'] . "'"; - } - else - { - $fields .= "," . PHP_EOL . $this->_t(4) . "'a." - . $filter['code'] . "','" . $filter['code'] - . "'"; - } - } - $donelist[] = $filter['code']; + $fields .= $this->getFilterFieldCode($filter); + $donelist[$filter['code']] = true; } } } // add the rest of the set filters - if (isset($this->filterBuilder[$view]) - && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) + if (isset($this->sortBuilder[$name_list_code]) + && ComponentbuilderHelper::checkArray($this->sortBuilder[$name_list_code])) { - foreach ($this->filterBuilder[$view] as $filter) + foreach ($this->sortBuilder[$name_list_code] as $filter) { - if (!in_array($filter['code'], $donelist)) + if (!isset($donelist[$filter['code']])) { - if ($filter['type'] === 'category') - { - $fields .= "," . PHP_EOL . $this->_t(4) - . "'c.title','category_title'"; - $fields .= "," . PHP_EOL . $this->_t(4) - . "'c.id', 'category_id'"; - if ($filter['code'] != 'category') - { - $fields .= "," . PHP_EOL . $this->_t(4) . "'a." - . $filter['code'] . "', '" . $filter['code'] - . "'"; - } - } - else - { - // check if custom field is set - /* if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $fields .= ",".PHP_EOL.$this->_t(4) . "'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; - } */ - $fields .= "," . PHP_EOL . $this->_t(4) . "'a." - . $filter['code'] . "','" . $filter['code'] . "'"; - } - $donelist[] = $filter['code']; + $fields .= $this->getFilterFieldCode($filter); + $donelist[$filter['code']] = true; } } } @@ -19727,11 +19684,71 @@ class Interpretation extends Fields return $fields; } - public function setStoredId(&$view) + /** + * Add the code of the filter field array + * + * @param array $filter The field/filter array + * + * @return string The code for the filter array + * + */ + protected function getFilterFieldCode(&$filter) + { + // add the category stuff (may still remove these) TODO + if ($filter['type'] === 'category') + { + $field = "," . PHP_EOL . $this->_t(4) + . "'c.title','category_title'"; + $field .= "," . PHP_EOL . $this->_t(4) + . "'c.id', 'category_id'"; + if ($filter['code'] != 'category') + { + $field .= "," . PHP_EOL . $this->_t(4) . "'a." + . $filter['code'] . "','" . $filter['code'] + . "'"; + } + } + else + { + // check if custom field is set + if (ComponentbuilderHelper::checkArray( + $filter['custom']) + && isset($filter['custom']['db']) + && ComponentbuilderHelper::checkString( + $filter['custom']['db']) + && isset($filter['custom']['text']) + && ComponentbuilderHelper::checkString( + $filter['custom']['text'])) + { + $field = "," . PHP_EOL . $this->_t(4) . "'" + . $filter['custom']['db'] . "." + . $filter['custom']['text'] . "','" . $filter['code'] + . "'"; + } + else + { + $field = "," . PHP_EOL . $this->_t(4) . "'a." + . $filter['code'] . "','" . $filter['code'] + . "'"; + } + } + return $field; + } + + /** + * set the sotred ids + * + * @param string $name_list_code The list view name + * + * @return string The code for the populate state + * + */ + public function setStoredId(&$name_list_code) { // keep track of all fields already added - $donelist = array('id', 'search', 'published', 'access', 'created_by', - 'modified_by'); + $donelist = array('id' => true, 'search' => true, + 'published' => true, 'access' => true, + 'created_by' => true, 'modified_by' => true); // set the defaults first $stored = "//" . $this->setLine(__LINE__) . " Compile the store id."; $stored .= PHP_EOL . $this->_t(2) @@ -19740,8 +19757,8 @@ class Interpretation extends Fields . "\$id .= ':' . \$this->getState('filter.search');"; $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.published');"; - if (isset($this->accessBuilder[$view]) - && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) + if (isset($this->accessBuilder[$name_list_code]) + && ComponentbuilderHelper::checkString($this->accessBuilder[$name_list_code])) { $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.access');"; @@ -19753,74 +19770,28 @@ class Interpretation extends Fields $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.modified_by');"; // add the rest of the set filters - if (isset($this->sortBuilder[$view]) - && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) + if (isset($this->filterBuilder[$name_list_code]) + && ComponentbuilderHelper::checkArray($this->filterBuilder[$name_list_code])) { - foreach ($this->sortBuilder[$view] as $filter) + foreach ($this->filterBuilder[$name_list_code] as $filter) { - if (!in_array($filter['code'], $donelist)) + if (!isset($donelist[$filter['code']])) { - if ($filter['type'] === 'category') - { - $stored .= PHP_EOL . $this->_t(2) - . "\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL . $this->_t(2) - . "\$id .= ':' . \$this->getState('filter.category_id');"; - if ($filter['code'] != 'category') - { - $stored .= PHP_EOL . $this->_t(2) - . "\$id .= ':' . \$this->getState('filter." - . $filter['code'] . "');"; - } - } - else - { - // check if custom field is set - /* if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $stored .= PHP_EOL.$this->_t(2) . "\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; - } */ - $stored .= PHP_EOL . $this->_t(2) - . "\$id .= ':' . \$this->getState('filter." - . $filter['code'] . "');"; - } - $donelist[] = $filter['code']; + $stored .= $this->getStoredIdCode($filter); + $donelist[$filter['code']] = true; } } } // add the rest of the set filters - if (isset($this->filterBuilder[$view]) - && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) + if (isset($this->sortBuilder[$name_list_code]) + && ComponentbuilderHelper::checkArray($this->sortBuilder[$name_list_code])) { - foreach ($this->filterBuilder[$view] as $filter) + foreach ($this->sortBuilder[$name_list_code] as $filter) { - if (!in_array($filter['code'], $donelist)) + if (!isset($donelist[$filter['code']])) { - if ($filter['type'] === 'category') - { - $stored .= PHP_EOL . $this->_t(2) - . "\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL . $this->_t(2) - . "\$id .= ':' . \$this->getState('filter.category_id');"; - if ($filter['code'] != 'category') - { - $stored .= PHP_EOL . $this->_t(2) - . "\$id .= ':' . \$this->getState('filter." - . $filter['code'] . "');"; - } - } - else - { - // check if custom field is set - /* if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; - } */ - $stored .= PHP_EOL . $this->_t(2) - . "\$id .= ':' . \$this->getState('filter." - . $filter['code'] . "');"; - } - $donelist[] = $filter['code']; + $stored .= $this->getStoredIdCode($filter); + $donelist[$filter['code']] = true; } } } @@ -19828,6 +19799,39 @@ class Interpretation extends Fields return $stored; } + /** + * Add the code of the stored ids + * + * @param array $filter The field/filter array + * + * @return string The code for the stored IDs + * + */ + protected function getStoredIdCode(&$filter) + { + if ($filter['type'] === 'category') + { + $stored = PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.category');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.category_id');"; + if ($filter['code'] != 'category') + { + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter." + . $filter['code'] . "');"; + } + } + else + { + $stored = PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter." + . $filter['code'] . "');"; + } + + return $stored; + } + public function setAddToolBar(&$view) { // set view name @@ -20167,7 +20171,7 @@ class Interpretation extends Fields $state = ''; // keep track of all fields already added $donelist = array(); - // add the default populate states + // add the default populate states (this must be added first) $state .= $this->setDefaultPopulateState($name_single_code); // we must add the formSubmited code if new above filters is used $new_filter = false; @@ -20186,10 +20190,10 @@ class Interpretation extends Fields { foreach ($this->filterBuilder[$name_list_code] as $filter) { - if (!in_array($filter['code'], $donelist)) + if (!isset($donelist[$filter['code']])) { - $state .= $this->getPopulateStateFilterCode($filter['code'], $new_filter); - $donelist[] = $filter['code']; + $state .= $this->getPopulateStateFilterCode($filter, $new_filter); + $donelist[$filter['code']] = true; } } } @@ -20199,10 +20203,10 @@ class Interpretation extends Fields { foreach ($this->sortBuilder[$name_list_code] as $filter) { - if (!in_array($filter['code'], $donelist)) + if (!isset($donelist[$filter['code']])) { - $state .= $this->getPopulateStateFilterCode($filter['code'], $new_filter); - $donelist[] = $filter['code']; + $state .= $this->getPopulateStateFilterCode($filter, $new_filter); + $donelist[$filter['code']] = true; } } } @@ -20213,18 +20217,31 @@ class Interpretation extends Fields /** * Add the code of the filter in the populate state * - * @param string $key The field key (code) + * @param array $filter The field/filter array * @param bool $new_filter The switch to use the new filter * @param string $extra The defaults/extra options of the filter * * @return string The code for the populate state * */ - protected function getPopulateStateFilterCode($key, $new_filter, $extra = '') + protected function getPopulateStateFilterCode(&$filter, $new_filter, $extra = '') { - $state = PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $key + // add category stuff (may still remove these) TODO + if ($filter['type'] === 'category') + { + $state .= PHP_EOL . PHP_EOL . $this->_t(2) + . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter.category', \$category);"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) + . "\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter.category_id', \$categoryId);"; + } + // always add the default filter + $state = PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." - . $key . "', 'filter_" . $key + . $filter['code'] . "', 'filter_" . $filter['code'] . "'" . $extra . ");"; if ($new_filter) { @@ -20232,19 +20249,19 @@ class Interpretation extends Fields $state .= PHP_EOL . $this->_t(2) . "if (\$formSubmited)"; $state .= PHP_EOL . $this->_t(2) . "{"; - $state .= PHP_EOL . $this->_t(3) . "\$" . $key - . " = \$app->input->post->get('" . $key . "');"; + $state .= PHP_EOL . $this->_t(3) . "\$" . $filter['code'] + . " = \$app->input->post->get('" . $filter['code'] . "');"; $state .= PHP_EOL . $this->_t(3) - . "\$this->setState('filter." . $key - . "', \$" . $key . ");"; + . "\$this->setState('filter." . $filter['code'] + . "', \$" . $filter['code'] . ");"; $state .= PHP_EOL . $this->_t(2) . "}"; } else { // the old filter option $state .= PHP_EOL . $this->_t(2) - . "\$this->setState('filter." . $key - . "', \$" . $key . ");"; + . "\$this->setState('filter." . $filter['code'] + . "', \$" . $filter['code'] . ");"; } return $state; } @@ -20260,31 +20277,39 @@ class Interpretation extends Fields protected function setDefaultPopulateState(&$name_single_code) { $state = ''; - // if access is not set + // start filter + $filter = array('type' => 'text'); + // if access is not set add its default filter here if (!isset($this->fieldsNames[$name_single_code]['access'])) { - $state .= $this->getPopulateStateFilterCode('access', false, ", 0, 'int'"); + $filter['code'] = "access"; + $state .= $this->getPopulateStateFilterCode($filter, false, ", 0, 'int'"); } - // if published is not set + // if published is not set add its default filter here if (!isset($this->fieldsNames[$name_single_code]['published'])) { - $state .= $this->getPopulateStateFilterCode('published', false, ", ''"); + $filter['code'] = "published"; + $state .= $this->getPopulateStateFilterCode($filter, false, ", ''"); } - // if created_by is not set + // if created_by is not set add its default filter here if (!isset($this->fieldsNames[$name_single_code]['created_by'])) { - $state .= $this->getPopulateStateFilterCode('created_by', false, ", ''"); + $filter['code'] = "created_by"; + $state .= $this->getPopulateStateFilterCode($filter, false, ", ''"); } - // if created is not set + // if created is not set add its default filter here if (!isset($this->fieldsNames[$name_single_code]['created'])) { - $state .= $this->getPopulateStateFilterCode('created', false); + $filter['code'] = "created"; + $state .= $this->getPopulateStateFilterCode($filter, false); } // the sorting defaults are always added - $state .= $this->getPopulateStateFilterCode('sorting', false, ", 0, 'int'"); + $filter['code'] = "sorting"; + $state .= $this->getPopulateStateFilterCode($filter, false, ", 0, 'int'"); // the search defaults are always added - $state .= $this->getPopulateStateFilterCode('search', false); + $filter['code'] = "search"; + $state .= $this->getPopulateStateFilterCode($filter, false); return $state; } diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index 3e11803da..469805100 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -29,14 +29,14 @@ class ComponentbuilderModelAdmin_views extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.system_name','system_name', - 'a.name_single','name_single', - 'a.short_description','short_description', 'a.add_fadein','add_fadein', 'a.type','type', 'a.add_custom_button','add_custom_button', 'a.add_php_ajax','add_php_ajax', - 'a.add_custom_import','add_custom_import' + 'a.add_custom_import','add_custom_import', + 'a.system_name','system_name', + 'a.name_single','name_single', + 'a.short_description','short_description' ); } @@ -621,14 +621,14 @@ class ComponentbuilderModelAdmin_views extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.system_name'); - $id .= ':' . $this->getState('filter.name_single'); - $id .= ':' . $this->getState('filter.short_description'); $id .= ':' . $this->getState('filter.add_fadein'); $id .= ':' . $this->getState('filter.type'); $id .= ':' . $this->getState('filter.add_custom_button'); $id .= ':' . $this->getState('filter.add_php_ajax'); - $id .= ':' . $this->getState('filter.add_custom_import'); + $id .= ':' . $this->getState('filter.add_custom_import'); + $id .= ':' . $this->getState('filter.system_name'); + $id .= ':' . $this->getState('filter.name_single'); + $id .= ':' . $this->getState('filter.short_description'); return parent::getStoreId($id); } diff --git a/admin/models/class_extendings.php b/admin/models/class_extendings.php index ea21dca43..d8b01e73e 100644 --- a/admin/models/class_extendings.php +++ b/admin/models/class_extendings.php @@ -29,8 +29,8 @@ class ComponentbuilderModelClass_extendings extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', - 'a.extension_type','extension_type' + 'a.extension_type','extension_type', + 'a.name','name' ); } @@ -251,8 +251,8 @@ class ComponentbuilderModelClass_extendings extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); - $id .= ':' . $this->getState('filter.extension_type'); + $id .= ':' . $this->getState('filter.extension_type'); + $id .= ':' . $this->getState('filter.name'); return parent::getStoreId($id); } diff --git a/admin/models/class_methods.php b/admin/models/class_methods.php index 8306d3b69..3a97cbfbd 100644 --- a/admin/models/class_methods.php +++ b/admin/models/class_methods.php @@ -29,9 +29,9 @@ class ComponentbuilderModelClass_methods extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', 'a.visibility','visibility', - 'a.extension_type','extension_type' + 'a.extension_type','extension_type', + 'a.name','name' ); } @@ -408,9 +408,9 @@ class ComponentbuilderModelClass_methods extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.visibility'); - $id .= ':' . $this->getState('filter.extension_type'); + $id .= ':' . $this->getState('filter.extension_type'); + $id .= ':' . $this->getState('filter.name'); return parent::getStoreId($id); } diff --git a/admin/models/class_properties.php b/admin/models/class_properties.php index 394a6aaf0..02d1ca5c0 100644 --- a/admin/models/class_properties.php +++ b/admin/models/class_properties.php @@ -29,9 +29,9 @@ class ComponentbuilderModelClass_properties extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', 'a.visibility','visibility', - 'a.extension_type','extension_type' + 'a.extension_type','extension_type', + 'a.name','name' ); } @@ -406,9 +406,9 @@ class ComponentbuilderModelClass_properties extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.visibility'); - $id .= ':' . $this->getState('filter.extension_type'); + $id .= ':' . $this->getState('filter.extension_type'); + $id .= ':' . $this->getState('filter.name'); return parent::getStoreId($id); } diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php index db3727088..5271a8931 100644 --- a/admin/models/custom_admin_views.php +++ b/admin/models/custom_admin_views.php @@ -29,12 +29,12 @@ class ComponentbuilderModelCustom_admin_views extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', + 'g.name','main_get', + 'a.add_php_ajax','add_php_ajax', + 'a.add_custom_button','add_custom_button', 'a.system_name','system_name', 'a.name','name', - 'a.description','description', - 'g.name', - 'a.add_php_ajax','add_php_ajax', - 'a.add_custom_button','add_custom_button' + 'a.description','description' ); } @@ -440,12 +440,12 @@ class ComponentbuilderModelCustom_admin_views extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.system_name'); - $id .= ':' . $this->getState('filter.name'); - $id .= ':' . $this->getState('filter.description'); $id .= ':' . $this->getState('filter.main_get'); $id .= ':' . $this->getState('filter.add_php_ajax'); - $id .= ':' . $this->getState('filter.add_custom_button'); + $id .= ':' . $this->getState('filter.add_custom_button'); + $id .= ':' . $this->getState('filter.system_name'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.description'); return parent::getStoreId($id); } diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php index 3aeb40814..126aba124 100644 --- a/admin/models/custom_codes.php +++ b/admin/models/custom_codes.php @@ -29,11 +29,11 @@ class ComponentbuilderModelCustom_codes extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'g.system_name', - 'a.path','path', + 'g.system_name','component', 'a.target','target', 'a.type','type', - 'a.comment_type','comment_type' + 'a.comment_type','comment_type', + 'a.path','path' ); } @@ -469,10 +469,10 @@ class ComponentbuilderModelCustom_codes extends JModelList $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); $id .= ':' . $this->getState('filter.component'); - $id .= ':' . $this->getState('filter.path'); $id .= ':' . $this->getState('filter.target'); $id .= ':' . $this->getState('filter.type'); - $id .= ':' . $this->getState('filter.comment_type'); + $id .= ':' . $this->getState('filter.comment_type'); + $id .= ':' . $this->getState('filter.path'); return parent::getStoreId($id); } diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index 436037c1a..abfc22c8e 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -29,9 +29,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', 'a.main_source','main_source', - 'a.gettype','gettype' + 'a.gettype','gettype', + 'a.name','name' ); } @@ -415,9 +415,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.main_source'); - $id .= ':' . $this->getState('filter.gettype'); + $id .= ':' . $this->getState('filter.gettype'); + $id .= ':' . $this->getState('filter.name'); return parent::getStoreId($id); } diff --git a/admin/models/fields.php b/admin/models/fields.php index 4cbdc0638..454012dd9 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -29,15 +29,15 @@ class ComponentbuilderModelFields extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', - 'g.name', + 'g.name','fieldtype', 'a.datatype','datatype', 'a.indexes','indexes', 'a.null_switch','null_switch', 'a.store','store', 'c.title','category_title', 'c.id', 'category_id', - 'a.catid', 'catid' + 'a.catid','catid', + 'a.name','name' ); } @@ -525,7 +525,6 @@ class ComponentbuilderModelFields extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.fieldtype'); $id .= ':' . $this->getState('filter.datatype'); $id .= ':' . $this->getState('filter.indexes'); @@ -533,7 +532,8 @@ class ComponentbuilderModelFields extends JModelList $id .= ':' . $this->getState('filter.store'); $id .= ':' . $this->getState('filter.category'); $id .= ':' . $this->getState('filter.category_id'); - $id .= ':' . $this->getState('filter.catid'); + $id .= ':' . $this->getState('filter.catid'); + $id .= ':' . $this->getState('filter.name'); return parent::getStoreId($id); } diff --git a/admin/models/fieldtypes.php b/admin/models/fieldtypes.php index eb847c89b..ee557f9e7 100644 --- a/admin/models/fieldtypes.php +++ b/admin/models/fieldtypes.php @@ -29,11 +29,11 @@ class ComponentbuilderModelFieldtypes extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', - 'a.short_description','short_description', 'c.title','category_title', 'c.id', 'category_id', - 'a.catid', 'catid' + 'a.catid','catid', + 'a.name','name', + 'a.short_description','short_description' ); } @@ -362,11 +362,11 @@ class ComponentbuilderModelFieldtypes extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); - $id .= ':' . $this->getState('filter.short_description'); $id .= ':' . $this->getState('filter.category'); $id .= ':' . $this->getState('filter.category_id'); - $id .= ':' . $this->getState('filter.catid'); + $id .= ':' . $this->getState('filter.catid'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.short_description'); return parent::getStoreId($id); } diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index e90c6fbf9..03f222f94 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -29,11 +29,11 @@ class ComponentbuilderModelHelp_documents extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.title','title', 'a.type','type', 'a.location','location', - 'g.', - 'h.' + 'a.admin_view','admin_view', + 'a.site_view','site_view', + 'a.title','title' ); } @@ -405,11 +405,11 @@ class ComponentbuilderModelHelp_documents extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.title'); $id .= ':' . $this->getState('filter.type'); $id .= ':' . $this->getState('filter.location'); $id .= ':' . $this->getState('filter.admin_view'); - $id .= ':' . $this->getState('filter.site_view'); + $id .= ':' . $this->getState('filter.site_view'); + $id .= ':' . $this->getState('filter.title'); return parent::getStoreId($id); } diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 1f0593299..47d22d640 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -29,11 +29,11 @@ class ComponentbuilderModelJoomla_components extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', + 'a.companyname','companyname', + 'a.author','author', 'a.system_name','system_name', 'a.name_code','name_code', - 'a.short_description','short_description', - 'a.companyname','companyname', - 'a.author','author' + 'a.short_description','short_description' ); } @@ -2454,11 +2454,11 @@ class ComponentbuilderModelJoomla_components extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.companyname'); + $id .= ':' . $this->getState('filter.author'); $id .= ':' . $this->getState('filter.system_name'); $id .= ':' . $this->getState('filter.name_code'); - $id .= ':' . $this->getState('filter.short_description'); - $id .= ':' . $this->getState('filter.companyname'); - $id .= ':' . $this->getState('filter.author'); + $id .= ':' . $this->getState('filter.short_description'); return parent::getStoreId($id); } diff --git a/admin/models/joomla_modules.php b/admin/models/joomla_modules.php index 4a6c9529d..282871b8d 100644 --- a/admin/models/joomla_modules.php +++ b/admin/models/joomla_modules.php @@ -29,9 +29,9 @@ class ComponentbuilderModelJoomla_modules extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', + 'a.target','target', 'a.system_name','system_name', - 'a.description','description', - 'a.target','target' + 'a.description','description' ); } @@ -253,9 +253,9 @@ class ComponentbuilderModelJoomla_modules extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.target'); $id .= ':' . $this->getState('filter.system_name'); - $id .= ':' . $this->getState('filter.description'); - $id .= ':' . $this->getState('filter.target'); + $id .= ':' . $this->getState('filter.description'); return parent::getStoreId($id); } diff --git a/admin/models/joomla_plugin_groups.php b/admin/models/joomla_plugin_groups.php index dae01ce8f..c9153e67e 100644 --- a/admin/models/joomla_plugin_groups.php +++ b/admin/models/joomla_plugin_groups.php @@ -29,8 +29,8 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', - 'g.name' + 'g.name','class_extends', + 'a.name','name' ); } @@ -198,8 +198,8 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); - $id .= ':' . $this->getState('filter.class_extends'); + $id .= ':' . $this->getState('filter.class_extends'); + $id .= ':' . $this->getState('filter.name'); return parent::getStoreId($id); } diff --git a/admin/models/joomla_plugins.php b/admin/models/joomla_plugins.php index dfe46c549..517a66daf 100644 --- a/admin/models/joomla_plugins.php +++ b/admin/models/joomla_plugins.php @@ -29,9 +29,9 @@ class ComponentbuilderModelJoomla_plugins extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.system_name','system_name', - 'g.name', - 'h.name' + 'g.name','class_extends', + 'h.name','joomla_plugin_group', + 'a.system_name','system_name' ); } @@ -402,9 +402,9 @@ class ComponentbuilderModelJoomla_plugins extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.system_name'); $id .= ':' . $this->getState('filter.class_extends'); - $id .= ':' . $this->getState('filter.joomla_plugin_group'); + $id .= ':' . $this->getState('filter.joomla_plugin_group'); + $id .= ':' . $this->getState('filter.system_name'); return parent::getStoreId($id); } diff --git a/admin/models/layouts.php b/admin/models/layouts.php index 8479a3858..6cd7c05cb 100644 --- a/admin/models/layouts.php +++ b/admin/models/layouts.php @@ -29,10 +29,10 @@ class ComponentbuilderModelLayouts extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', + 'g.name','dynamic_get', + 'a.add_php_view','add_php_view', 'a.name','name', - 'a.description','description', - 'g.name', - 'a.add_php_view','add_php_view' + 'a.description','description' ); } @@ -392,10 +392,10 @@ class ComponentbuilderModelLayouts extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); - $id .= ':' . $this->getState('filter.description'); $id .= ':' . $this->getState('filter.dynamic_get'); - $id .= ':' . $this->getState('filter.add_php_view'); + $id .= ':' . $this->getState('filter.add_php_view'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.description'); return parent::getStoreId($id); } diff --git a/admin/models/libraries.php b/admin/models/libraries.php index 9a7f28732..9f1891655 100644 --- a/admin/models/libraries.php +++ b/admin/models/libraries.php @@ -29,11 +29,11 @@ class ComponentbuilderModelLibraries extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', 'a.target','target', + 'a.how','how', 'a.type','type', - 'a.description','description', - 'a.how','how' + 'a.name','name', + 'a.description','description' ); } @@ -308,11 +308,11 @@ class ComponentbuilderModelLibraries extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.target'); + $id .= ':' . $this->getState('filter.how'); $id .= ':' . $this->getState('filter.type'); - $id .= ':' . $this->getState('filter.description'); - $id .= ':' . $this->getState('filter.how'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.description'); return parent::getStoreId($id); } diff --git a/admin/models/site_views.php b/admin/models/site_views.php index c1c3acd01..69f52a51d 100644 --- a/admin/models/site_views.php +++ b/admin/models/site_views.php @@ -29,13 +29,13 @@ class ComponentbuilderModelSite_views extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', + 'g.name','main_get', + 'a.add_php_ajax','add_php_ajax', + 'a.add_custom_button','add_custom_button', 'a.system_name','system_name', 'a.name','name', 'a.description','description', - 'g.name', - 'a.context','context', - 'a.add_php_ajax','add_php_ajax', - 'a.add_custom_button','add_custom_button' + 'a.context','context' ); } @@ -444,13 +444,13 @@ class ComponentbuilderModelSite_views extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.main_get'); + $id .= ':' . $this->getState('filter.add_php_ajax'); + $id .= ':' . $this->getState('filter.add_custom_button'); $id .= ':' . $this->getState('filter.system_name'); $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.description'); - $id .= ':' . $this->getState('filter.main_get'); - $id .= ':' . $this->getState('filter.context'); - $id .= ':' . $this->getState('filter.add_php_ajax'); - $id .= ':' . $this->getState('filter.add_custom_button'); + $id .= ':' . $this->getState('filter.context'); return parent::getStoreId($id); } diff --git a/admin/models/snippets.php b/admin/models/snippets.php index 383d644bc..ff66ebae1 100644 --- a/admin/models/snippets.php +++ b/admin/models/snippets.php @@ -29,11 +29,11 @@ class ComponentbuilderModelSnippets extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', + 'g.name','type', + 'h.name','library', 'a.name','name', 'a.url','url', - 'g.name', - 'a.heading','heading', - 'h.name' + 'a.heading','heading' ); } @@ -478,11 +478,11 @@ class ComponentbuilderModelSnippets extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.type'); + $id .= ':' . $this->getState('filter.library'); $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.url'); - $id .= ':' . $this->getState('filter.type'); - $id .= ':' . $this->getState('filter.heading'); - $id .= ':' . $this->getState('filter.library'); + $id .= ':' . $this->getState('filter.heading'); return parent::getStoreId($id); } diff --git a/admin/models/templates.php b/admin/models/templates.php index 401ad591b..3bfc36da6 100644 --- a/admin/models/templates.php +++ b/admin/models/templates.php @@ -29,10 +29,10 @@ class ComponentbuilderModelTemplates extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', + 'g.name','dynamic_get', + 'a.add_php_view','add_php_view', 'a.name','name', - 'a.description','description', - 'g.name', - 'a.add_php_view','add_php_view' + 'a.description','description' ); } @@ -392,10 +392,10 @@ class ComponentbuilderModelTemplates extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); - $id .= ':' . $this->getState('filter.description'); $id .= ':' . $this->getState('filter.dynamic_get'); - $id .= ':' . $this->getState('filter.add_php_view'); + $id .= ':' . $this->getState('filter.add_php_view'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.description'); return parent::getStoreId($id); } diff --git a/componentbuilder.xml b/componentbuilder.xml index fc1645d66..bc8ff8604 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 20th November, 2020 + 21st November, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com