From 3a2b8497e3309307cd50f9c5f23bad091bb6a9d5 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 22 May 2020 02:32:58 +0200 Subject: [PATCH] Changed main views in JCB to sort id descending. --- README.md | 4 +- admin/README.txt | 4 +- admin/compiler/joomla_3/JViewLegacy_list.php | 4 +- admin/helpers/compiler/e_Interpretation.php | 48 +++++++++++++++++++ admin/helpers/compiler/f_Infusion.php | 5 ++ admin/models/admin_views.php | 4 +- admin/models/class_methods.php | 4 +- admin/models/class_properties.php | 4 +- admin/models/custom_admin_views.php | 4 +- admin/models/custom_codes.php | 4 +- admin/models/dynamic_gets.php | 4 +- admin/models/fields.php | 4 +- admin/models/joomla_components.php | 4 +- admin/models/joomla_modules.php | 2 +- admin/models/joomla_plugins.php | 2 +- admin/models/layouts.php | 4 +- admin/models/libraries.php | 2 +- admin/models/placeholders.php | 4 +- admin/models/site_views.php | 4 +- admin/models/snippets.php | 4 +- admin/models/templates.php | 4 +- admin/models/validation_rules.php | 4 +- admin/views/admin_views/view.html.php | 7 +-- admin/views/admins_custom_tabs/view.html.php | 7 +-- admin/views/admins_fields/view.html.php | 7 +-- .../admins_fields_conditions/view.html.php | 7 +-- .../admins_fields_relations/view.html.php | 7 +-- admin/views/class_extendings/view.html.php | 7 +-- admin/views/class_methods/view.html.php | 7 +-- admin/views/class_properties/view.html.php | 7 +-- .../components_admin_views/view.html.php | 7 +-- admin/views/components_config/view.html.php | 7 +-- .../view.html.php | 7 +-- .../view.html.php | 7 +-- .../views/components_dashboard/view.html.php | 7 +-- .../components_files_folders/view.html.php | 7 +-- admin/views/components_modules/view.html.php | 7 +-- .../components_mysql_tweaks/view.html.php | 7 +-- .../components_placeholders/view.html.php | 7 +-- admin/views/components_plugins/view.html.php | 7 +-- .../views/components_site_views/view.html.php | 7 +-- admin/views/components_updates/view.html.php | 7 +-- admin/views/custom_admin_views/view.html.php | 7 +-- admin/views/custom_codes/view.html.php | 7 +-- admin/views/dynamic_gets/view.html.php | 7 +-- admin/views/fields/view.html.php | 7 +-- admin/views/fieldtypes/view.html.php | 7 +-- admin/views/help_documents/view.html.php | 7 +-- admin/views/joomla_components/view.html.php | 7 +-- admin/views/joomla_modules/view.html.php | 7 +-- .../view.html.php | 7 +-- .../joomla_modules_updates/view.html.php | 7 +-- .../views/joomla_plugin_groups/view.html.php | 7 +-- admin/views/joomla_plugins/view.html.php | 7 +-- .../view.html.php | 7 +-- .../joomla_plugins_updates/view.html.php | 7 +-- .../views/language_translations/view.html.php | 7 +-- admin/views/languages/view.html.php | 7 +-- admin/views/layouts/view.html.php | 7 +-- admin/views/libraries/view.html.php | 7 +-- admin/views/libraries_config/view.html.php | 7 +-- .../view.html.php | 7 +-- admin/views/placeholders/view.html.php | 7 +-- admin/views/servers/view.html.php | 7 +-- admin/views/site_views/view.html.php | 7 +-- admin/views/snippet_types/view.html.php | 7 +-- admin/views/snippets/view.html.php | 7 +-- admin/views/templates/view.html.php | 7 +-- admin/views/validation_rules/view.html.php | 7 +-- componentbuilder.xml | 2 +- 70 files changed, 278 insertions(+), 180 deletions(-) diff --git a/README.md b/README.md index f609a17bf..5d53944d4 100644 --- a/README.md +++ b/README.md @@ -144,11 +144,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 21st May, 2020 ++ *Last Build*: 22nd May, 2020 + *Version*: 2.11.1 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **281703** ++ *Line count*: **281750** + *Field count*: **1522** + *File count*: **1783** + *Folder count*: **295** diff --git a/admin/README.txt b/admin/README.txt index f609a17bf..5d53944d4 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,11 +144,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 21st May, 2020 ++ *Last Build*: 22nd May, 2020 + *Version*: 2.11.1 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **281703** ++ *Line count*: **281750** + *Field count*: **1522** + *File count*: **1783** + *Folder count*: **295** diff --git a/admin/compiler/joomla_3/JViewLegacy_list.php b/admin/compiler/joomla_3/JViewLegacy_list.php index 3935b832c..e05449944 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list.php +++ b/admin/compiler/joomla_3/JViewLegacy_list.php @@ -38,9 +38,7 @@ class ###Component###View###Views### extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser();###ADMIN_DIPLAY_METHOD### $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 8d757a361..ed62e178b 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -4920,6 +4920,52 @@ class Interpretation extends Fields return $script . $getItem; } + public function setAdminViewDisplayMethod($viewName_list) + { + $script = ''; + if (isset($this->viewsDefaultOrdering[$viewName_list]) + && $this->viewsDefaultOrdering[$viewName_list]['add_admin_ordering'] + == 1) + { + // the first is from the state + $order_first = true; + foreach ( + $this->viewsDefaultOrdering[$viewName_list]['admin_ordering_fields'] + as $order_field + ) + { + if ($order_first && ($order_field_name = $this->getFieldDatabaseName( + $viewName_list, $order_field['field'] + )) !== false) + { + // just the first field is based on state + $order_first = false; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Add the list ordering clause."; + $script .= PHP_EOL . $this->_t(2) + . "\$this->listOrder = \$this->escape(\$this->state->get('list.ordering', '" + . $order_field_name . "'));"; + $script .= PHP_EOL . $this->_t(2) + . "\$this->listDirn = \$this->escape(\$this->state->get('list.direction', '" + . $order_field['direction'] . "'));"; + } + } + } + // if no ordering is added we must add default + if (!ComponentbuilderHelper::checkString($script)) + { + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Add the list ordering clause."; + $script .= PHP_EOL . $this->_t(2) + . "\$this->listOrder = \$this->escape(\$this->state->get('list.ordering', 'a.id'));"; + $script .= PHP_EOL . $this->_t(2) + . "\$this->listDirn = \$this->escape(\$this->state->get('list.direction', 'asc'));"; + } + return $script; + } + public function setCustomViewDisplayMethod(&$view) { $method = ''; @@ -14809,6 +14855,8 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL; } + // setup values for the view ordering + // add dynamic ordering (Admin view) if (isset($this->viewsDefaultOrdering[$viewName_list]) && $this->viewsDefaultOrdering[$viewName_list]['add_admin_ordering'] diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 2a8e1f10b..6e2e3ca9d 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -858,6 +858,11 @@ class Infusion extends Interpretation 'css_views', $viewName_single, '', null, true ); + // ADMIN_DIPLAY_METHOD <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'ADMIN_DIPLAY_METHOD' . $this->hhh] + = $this->setAdminViewDisplayMethod($viewName_list); + // VIEWS_FOOTER_SCRIPT <<>> $scriptNote = PHP_EOL . '//' . $this->setLine(__LINE__) . ' ' . $viewName_list . ' footer script'; diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index fbcea1e85..35eecdbe0 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -322,7 +322,7 @@ class ComponentbuilderModelAdmin_views extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -369,7 +369,7 @@ class ComponentbuilderModelAdmin_views extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/class_methods.php b/admin/models/class_methods.php index 27c645746..0d9d4c9da 100644 --- a/admin/models/class_methods.php +++ b/admin/models/class_methods.php @@ -249,7 +249,7 @@ class ComponentbuilderModelClass_methods extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -296,7 +296,7 @@ class ComponentbuilderModelClass_methods extends JModelList } // Order the results by ordering - $query->order('a.ordering ASC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/class_properties.php b/admin/models/class_properties.php index 9ad5aeb80..9e9befe8a 100644 --- a/admin/models/class_properties.php +++ b/admin/models/class_properties.php @@ -249,7 +249,7 @@ class ComponentbuilderModelClass_properties extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -296,7 +296,7 @@ class ComponentbuilderModelClass_properties extends JModelList } // Order the results by ordering - $query->order('a.ordering ASC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php index ffe5996bd..ede100835 100644 --- a/admin/models/custom_admin_views.php +++ b/admin/models/custom_admin_views.php @@ -263,7 +263,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -310,7 +310,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php index abff27a4c..d9745bf2d 100644 --- a/admin/models/custom_codes.php +++ b/admin/models/custom_codes.php @@ -296,7 +296,7 @@ class ComponentbuilderModelCustom_codes extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -343,7 +343,7 @@ class ComponentbuilderModelCustom_codes extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index 178559d1f..91356cf03 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -246,7 +246,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -293,7 +293,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/fields.php b/admin/models/fields.php index 67ef89191..8eb0104d8 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -362,7 +362,7 @@ class ComponentbuilderModelFields extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -409,7 +409,7 @@ class ComponentbuilderModelFields extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index a0f861f07..6f2a6d7ce 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -2232,7 +2232,7 @@ class ComponentbuilderModelJoomla_components extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -2279,7 +2279,7 @@ class ComponentbuilderModelJoomla_components extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/joomla_modules.php b/admin/models/joomla_modules.php index cc77909a1..b9aea2804 100644 --- a/admin/models/joomla_modules.php +++ b/admin/models/joomla_modules.php @@ -222,7 +222,7 @@ class ComponentbuilderModelJoomla_modules extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); diff --git a/admin/models/joomla_plugins.php b/admin/models/joomla_plugins.php index f4f0bc6a7..c121ad332 100644 --- a/admin/models/joomla_plugins.php +++ b/admin/models/joomla_plugins.php @@ -371,7 +371,7 @@ class ComponentbuilderModelJoomla_plugins extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); diff --git a/admin/models/layouts.php b/admin/models/layouts.php index dbc8216ef..0c5bd8fe8 100644 --- a/admin/models/layouts.php +++ b/admin/models/layouts.php @@ -235,7 +235,7 @@ class ComponentbuilderModelLayouts extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -282,7 +282,7 @@ class ComponentbuilderModelLayouts extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/libraries.php b/admin/models/libraries.php index 68f17d7ce..4ed002386 100644 --- a/admin/models/libraries.php +++ b/admin/models/libraries.php @@ -277,7 +277,7 @@ class ComponentbuilderModelLibraries extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); diff --git a/admin/models/placeholders.php b/admin/models/placeholders.php index fea3b1493..6d191f790 100644 --- a/admin/models/placeholders.php +++ b/admin/models/placeholders.php @@ -181,7 +181,7 @@ class ComponentbuilderModelPlaceholders extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -228,7 +228,7 @@ class ComponentbuilderModelPlaceholders extends JModelList } // Order the results by ordering - $query->order('a.ordering ASC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/site_views.php b/admin/models/site_views.php index dfc9a6f60..69207716f 100644 --- a/admin/models/site_views.php +++ b/admin/models/site_views.php @@ -267,7 +267,7 @@ class ComponentbuilderModelSite_views extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -314,7 +314,7 @@ class ComponentbuilderModelSite_views extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/snippets.php b/admin/models/snippets.php index 9222b1134..5fa27a5aa 100644 --- a/admin/models/snippets.php +++ b/admin/models/snippets.php @@ -323,7 +323,7 @@ class ComponentbuilderModelSnippets extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -370,7 +370,7 @@ class ComponentbuilderModelSnippets extends JModelList } // Order the results by ordering - $query->order('a.ordering ASC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/templates.php b/admin/models/templates.php index 27ff093e0..ac562b4f4 100644 --- a/admin/models/templates.php +++ b/admin/models/templates.php @@ -235,7 +235,7 @@ class ComponentbuilderModelTemplates extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -282,7 +282,7 @@ class ComponentbuilderModelTemplates extends JModelList } // Order the results by ordering - $query->order('a.id DESC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/models/validation_rules.php b/admin/models/validation_rules.php index 17bbfe287..b1dbca638 100644 --- a/admin/models/validation_rules.php +++ b/admin/models/validation_rules.php @@ -179,7 +179,7 @@ class ComponentbuilderModelValidation_rules extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -226,7 +226,7 @@ class ComponentbuilderModelValidation_rules extends JModelList } // Order the results by ordering - $query->order('a.ordering ASC'); + $query->order('a.id desc'); // Load the items $db->setQuery($query); diff --git a/admin/views/admin_views/view.html.php b/admin/views/admin_views/view.html.php index 98b3991a5..aa6cbd4fb 100644 --- a/admin/views/admin_views/view.html.php +++ b/admin/views/admin_views/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/admins_custom_tabs/view.html.php b/admin/views/admins_custom_tabs/view.html.php index 708346c78..826f01f50 100644 --- a/admin/views/admins_custom_tabs/view.html.php +++ b/admin/views/admins_custom_tabs/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewAdmins_custom_tabs extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/admins_fields/view.html.php b/admin/views/admins_fields/view.html.php index 91706f7be..602d3b89d 100644 --- a/admin/views/admins_fields/view.html.php +++ b/admin/views/admins_fields/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/admins_fields_conditions/view.html.php b/admin/views/admins_fields_conditions/view.html.php index d166ad212..76e25b0c3 100644 --- a/admin/views/admins_fields_conditions/view.html.php +++ b/admin/views/admins_fields_conditions/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/admins_fields_relations/view.html.php b/admin/views/admins_fields_relations/view.html.php index 5f35af011..836528945 100644 --- a/admin/views/admins_fields_relations/view.html.php +++ b/admin/views/admins_fields_relations/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewAdmins_fields_relations extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/class_extendings/view.html.php b/admin/views/class_extendings/view.html.php index e9853096c..280e3a8a4 100644 --- a/admin/views/class_extendings/view.html.php +++ b/admin/views/class_extendings/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewClass_extendings extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/class_methods/view.html.php b/admin/views/class_methods/view.html.php index 96ff4a12c..4c8fd1d21 100644 --- a/admin/views/class_methods/view.html.php +++ b/admin/views/class_methods/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewClass_methods extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/class_properties/view.html.php b/admin/views/class_properties/view.html.php index 7faa956be..23bbe8de1 100644 --- a/admin/views/class_properties/view.html.php +++ b/admin/views/class_properties/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewClass_properties extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_admin_views/view.html.php b/admin/views/components_admin_views/view.html.php index 6ba273c93..b2451a3b0 100644 --- a/admin/views/components_admin_views/view.html.php +++ b/admin/views/components_admin_views/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_config/view.html.php b/admin/views/components_config/view.html.php index 0966e738e..b3193256b 100644 --- a/admin/views/components_config/view.html.php +++ b/admin/views/components_config/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_config extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_custom_admin_menus/view.html.php b/admin/views/components_custom_admin_menus/view.html.php index 32af9aefb..7d3d238e6 100644 --- a/admin/views/components_custom_admin_menus/view.html.php +++ b/admin/views/components_custom_admin_menus/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_custom_admin_views/view.html.php b/admin/views/components_custom_admin_views/view.html.php index 08ba68ee0..005aed9c6 100644 --- a/admin/views/components_custom_admin_views/view.html.php +++ b/admin/views/components_custom_admin_views/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_dashboard/view.html.php b/admin/views/components_dashboard/view.html.php index 7c7af3922..b5b26ea2b 100644 --- a/admin/views/components_dashboard/view.html.php +++ b/admin/views/components_dashboard/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_files_folders/view.html.php b/admin/views/components_files_folders/view.html.php index 4b2224669..394673df3 100644 --- a/admin/views/components_files_folders/view.html.php +++ b/admin/views/components_files_folders/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_modules/view.html.php b/admin/views/components_modules/view.html.php index 615af532b..3fa8ec0e6 100644 --- a/admin/views/components_modules/view.html.php +++ b/admin/views/components_modules/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_modules extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_mysql_tweaks/view.html.php b/admin/views/components_mysql_tweaks/view.html.php index 932590ef1..811e24274 100644 --- a/admin/views/components_mysql_tweaks/view.html.php +++ b/admin/views/components_mysql_tweaks/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_placeholders/view.html.php b/admin/views/components_placeholders/view.html.php index dfeab8055..1209ca0fe 100644 --- a/admin/views/components_placeholders/view.html.php +++ b/admin/views/components_placeholders/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_placeholders extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_plugins/view.html.php b/admin/views/components_plugins/view.html.php index 26b8d5903..8e925e30b 100644 --- a/admin/views/components_plugins/view.html.php +++ b/admin/views/components_plugins/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_plugins extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_site_views/view.html.php b/admin/views/components_site_views/view.html.php index cf80cfcb0..91e959c01 100644 --- a/admin/views/components_site_views/view.html.php +++ b/admin/views/components_site_views/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/components_updates/view.html.php b/admin/views/components_updates/view.html.php index 4462c30b8..c6761f65a 100644 --- a/admin/views/components_updates/view.html.php +++ b/admin/views/components_updates/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/custom_admin_views/view.html.php b/admin/views/custom_admin_views/view.html.php index 36156be68..e040d422f 100644 --- a/admin/views/custom_admin_views/view.html.php +++ b/admin/views/custom_admin_views/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index 552e98085..18976f197 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/dynamic_gets/view.html.php b/admin/views/dynamic_gets/view.html.php index 078941359..32a81413e 100644 --- a/admin/views/dynamic_gets/view.html.php +++ b/admin/views/dynamic_gets/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/fields/view.html.php b/admin/views/fields/view.html.php index 23d5bb351..2beec06b4 100644 --- a/admin/views/fields/view.html.php +++ b/admin/views/fields/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewFields extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/fieldtypes/view.html.php b/admin/views/fieldtypes/view.html.php index 8e9b92677..075cdb23f 100644 --- a/admin/views/fieldtypes/view.html.php +++ b/admin/views/fieldtypes/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index 467b0d682..6ddfa8ba3 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php index 0cf4685f3..00036299d 100644 --- a/admin/views/joomla_components/view.html.php +++ b/admin/views/joomla_components/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/joomla_modules/view.html.php b/admin/views/joomla_modules/view.html.php index 7ece0f897..f4e5fc7ee 100644 --- a/admin/views/joomla_modules/view.html.php +++ b/admin/views/joomla_modules/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewJoomla_modules extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/joomla_modules_files_folders_urls/view.html.php b/admin/views/joomla_modules_files_folders_urls/view.html.php index 12e7ca417..387682196 100644 --- a/admin/views/joomla_modules_files_folders_urls/view.html.php +++ b/admin/views/joomla_modules_files_folders_urls/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewJoomla_modules_files_folders_urls extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/joomla_modules_updates/view.html.php b/admin/views/joomla_modules_updates/view.html.php index f9d4a397c..d5b90296e 100644 --- a/admin/views/joomla_modules_updates/view.html.php +++ b/admin/views/joomla_modules_updates/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewJoomla_modules_updates extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/joomla_plugin_groups/view.html.php b/admin/views/joomla_plugin_groups/view.html.php index a7a0f3363..378fdc96d 100644 --- a/admin/views/joomla_plugin_groups/view.html.php +++ b/admin/views/joomla_plugin_groups/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewJoomla_plugin_groups extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/joomla_plugins/view.html.php b/admin/views/joomla_plugins/view.html.php index 41b2f5172..1d98c0306 100644 --- a/admin/views/joomla_plugins/view.html.php +++ b/admin/views/joomla_plugins/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/joomla_plugins_files_folders_urls/view.html.php b/admin/views/joomla_plugins_files_folders_urls/view.html.php index 0b290303e..1bf5a9ff3 100644 --- a/admin/views/joomla_plugins_files_folders_urls/view.html.php +++ b/admin/views/joomla_plugins_files_folders_urls/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewJoomla_plugins_files_folders_urls extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/joomla_plugins_updates/view.html.php b/admin/views/joomla_plugins_updates/view.html.php index 3ef8b0799..5ed43dc26 100644 --- a/admin/views/joomla_plugins_updates/view.html.php +++ b/admin/views/joomla_plugins_updates/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewJoomla_plugins_updates extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/language_translations/view.html.php b/admin/views/language_translations/view.html.php index 2da83ae01..95b430c3f 100644 --- a/admin/views/language_translations/view.html.php +++ b/admin/views/language_translations/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewLanguage_translations extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/languages/view.html.php b/admin/views/languages/view.html.php index 9b5d2975f..71dd8b38d 100644 --- a/admin/views/languages/view.html.php +++ b/admin/views/languages/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewLanguages extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/layouts/view.html.php b/admin/views/layouts/view.html.php index 5dd02db03..6bd7ac34c 100644 --- a/admin/views/layouts/view.html.php +++ b/admin/views/layouts/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewLayouts extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/libraries/view.html.php b/admin/views/libraries/view.html.php index 4ba226444..7f906a1d4 100644 --- a/admin/views/libraries/view.html.php +++ b/admin/views/libraries/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewLibraries extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/libraries_config/view.html.php b/admin/views/libraries_config/view.html.php index cb0a34798..e6acdf78a 100644 --- a/admin/views/libraries_config/view.html.php +++ b/admin/views/libraries_config/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewLibraries_config extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/libraries_files_folders_urls/view.html.php b/admin/views/libraries_files_folders_urls/view.html.php index 449e59aba..37a901234 100644 --- a/admin/views/libraries_files_folders_urls/view.html.php +++ b/admin/views/libraries_files_folders_urls/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewLibraries_files_folders_urls extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/placeholders/view.html.php b/admin/views/placeholders/view.html.php index 56c0a74f6..e2eaa3655 100644 --- a/admin/views/placeholders/view.html.php +++ b/admin/views/placeholders/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewPlaceholders extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/servers/view.html.php b/admin/views/servers/view.html.php index e3e0275bf..2283ddf6c 100644 --- a/admin/views/servers/view.html.php +++ b/admin/views/servers/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewServers extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/site_views/view.html.php b/admin/views/site_views/view.html.php index 6b959f2b0..6d51fc227 100644 --- a/admin/views/site_views/view.html.php +++ b/admin/views/site_views/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewSite_views extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/snippet_types/view.html.php b/admin/views/snippet_types/view.html.php index 54cfe563a..9532233d7 100644 --- a/admin/views/snippet_types/view.html.php +++ b/admin/views/snippet_types/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewSnippet_types extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/snippets/view.html.php b/admin/views/snippets/view.html.php index 1a9f73527..e4b62e813 100644 --- a/admin/views/snippets/view.html.php +++ b/admin/views/snippets/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewSnippets extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/templates/view.html.php b/admin/views/templates/view.html.php index f0046359d..3c4de15bb 100644 --- a/admin/views/templates/view.html.php +++ b/admin/views/templates/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewTemplates extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/admin/views/validation_rules/view.html.php b/admin/views/validation_rules/view.html.php index 872d4216b..3005c815c 100644 --- a/admin/views/validation_rules/view.html.php +++ b/admin/views/validation_rules/view.html.php @@ -33,9 +33,10 @@ class ComponentbuilderViewValidation_rules extends JViewLegacy $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); - $this->listOrder = $this->escape($this->state->get('list.ordering')); - $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->user = JFactory::getUser(); + // Add the list ordering clause. + $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); + $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); diff --git a/componentbuilder.xml b/componentbuilder.xml index a59fc8a37..366966b47 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 21st May, 2020 + 22nd May, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com