From 3324576c95dc1512184141e5cc98576bfa60c66f Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Mon, 30 Nov 2020 17:30:10 +0200 Subject: [PATCH] Added the category code to the new filters area. gh-378 Update the direction default the descending. --- admin/helpers/compiler/c_Fields.php | 27 ++++++++++++++++++- admin/helpers/compiler/e_Interpretation.php | 3 +-- admin/models/admins_custom_tabs.php | 2 +- admin/models/admins_fields.php | 2 +- admin/models/admins_fields_conditions.php | 2 +- admin/models/admins_fields_relations.php | 2 +- admin/models/class_extendings.php | 2 +- admin/models/components_admin_views.php | 2 +- admin/models/components_config.php | 2 +- .../models/components_custom_admin_menus.php | 2 +- .../models/components_custom_admin_views.php | 2 +- admin/models/components_dashboard.php | 2 +- admin/models/components_files_folders.php | 2 +- admin/models/components_modules.php | 2 +- admin/models/components_mysql_tweaks.php | 2 +- admin/models/components_placeholders.php | 2 +- admin/models/components_plugins.php | 2 +- admin/models/components_site_views.php | 2 +- admin/models/components_updates.php | 2 +- admin/models/fieldtypes.php | 2 +- admin/models/help_documents.php | 2 +- .../joomla_modules_files_folders_urls.php | 2 +- admin/models/joomla_modules_updates.php | 2 +- admin/models/joomla_plugin_groups.php | 2 +- .../joomla_plugins_files_folders_urls.php | 2 +- admin/models/joomla_plugins_updates.php | 2 +- admin/models/language_translations.php | 2 +- admin/models/languages.php | 2 +- admin/models/libraries_config.php | 2 +- admin/models/libraries_files_folders_urls.php | 2 +- admin/models/servers.php | 2 +- admin/models/snippet_types.php | 2 +- 32 files changed, 57 insertions(+), 33 deletions(-) diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 5ea05552d..6964a6b3f 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -4984,7 +4984,7 @@ class Fields extends Structure && $typeName != 'subform')) { // add the language only for new filter option - $filter_name_asc_lang = ''; + $filter_name_asc_lang = ''; $filter_name_desc_lang = ''; if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 2) @@ -5617,6 +5617,31 @@ class Fields extends Structure . ''; $field_filter_sets[] = $this->_t(2) . ''; } + // add the category if found + if (isset($this->categoryBuilder[$nameListCode]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$nameListCode] + ) + && isset($this->categoryBuilder[$nameListCode]['extension'])) + { + $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="category"'; + $field_filter_sets[] = $this->_t(3) . 'name="category_id"'; + $field_filter_sets[] = $this->_t(3) + . 'label="JOPTION_FILTER_CATEGORY"'; + $field_filter_sets[] = $this->_t(3) + . 'description="JOPTION_FILTER_CATEGORY_DESC"'; + $field_filter_sets[] = $this->_t(3) . 'multiple="true"'; + $field_filter_sets[] = $this->_t(3) + . 'class="multipleCategories"'; + $field_filter_sets[] = $this->_t(3) . 'extension="' + . $this->categoryBuilder[$nameListCode]['extension'] . '"'; + $field_filter_sets[] = $this->_t(3) + . 'onchange="this.form.submit();"'; + // TODO NOT SURE IF THIS SHOULD BE STATIC + $field_filter_sets[] = $this->_t(3) . 'published="0,1,2"'; + $field_filter_sets[] = $this->_t(2) . '/>'; + } // add the access filter if this view has access // and if access manually is not set if (isset($this->accessBuilder[$nameSingleCode]) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index ce7bae67a..7883bd3aa 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -15404,7 +15404,6 @@ class Interpretation extends Fields $query .= PHP_EOL; } // setup values for the view ordering - // add dynamic ordering (Admin view) if (isset($this->viewsDefaultOrdering[$nameListCode]) && $this->viewsDefaultOrdering[$nameListCode]['add_admin_ordering'] @@ -15464,7 +15463,7 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(2) . "\$orderCol = \$this->state->get('list.ordering', 'a.id');"; $query .= PHP_EOL . $this->_t(2) - . "\$orderDirn = \$this->state->get('list.direction', 'asc');"; + . "\$orderDirn = \$this->state->get('list.direction', 'desc');"; $query .= PHP_EOL . $this->_t(2) . "if (\$orderCol != '')"; $query .= PHP_EOL . $this->_t(2) . "{"; $query .= PHP_EOL . $this->_t(3) diff --git a/admin/models/admins_custom_tabs.php b/admin/models/admins_custom_tabs.php index 93e1cd452..4fea3127f 100644 --- a/admin/models/admins_custom_tabs.php +++ b/admin/models/admins_custom_tabs.php @@ -167,7 +167,7 @@ class ComponentbuilderModelAdmins_custom_tabs 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/admins_fields.php b/admin/models/admins_fields.php index c432b4b68..7306824ba 100644 --- a/admin/models/admins_fields.php +++ b/admin/models/admins_fields.php @@ -167,7 +167,7 @@ class ComponentbuilderModelAdmins_fields 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/admins_fields_conditions.php b/admin/models/admins_fields_conditions.php index d487f847d..94251940a 100644 --- a/admin/models/admins_fields_conditions.php +++ b/admin/models/admins_fields_conditions.php @@ -167,7 +167,7 @@ class ComponentbuilderModelAdmins_fields_conditions 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/admins_fields_relations.php b/admin/models/admins_fields_relations.php index 55d449da6..20eaf152d 100644 --- a/admin/models/admins_fields_relations.php +++ b/admin/models/admins_fields_relations.php @@ -167,7 +167,7 @@ class ComponentbuilderModelAdmins_fields_relations 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/class_extendings.php b/admin/models/class_extendings.php index 0f2e47158..709f221bf 100644 --- a/admin/models/class_extendings.php +++ b/admin/models/class_extendings.php @@ -239,7 +239,7 @@ class ComponentbuilderModelClass_extendings 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/components_admin_views.php b/admin/models/components_admin_views.php index ef68fdab1..22b82a4fb 100644 --- a/admin/models/components_admin_views.php +++ b/admin/models/components_admin_views.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_admin_views 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/components_config.php b/admin/models/components_config.php index 4c1d8c8ef..f68e0a373 100644 --- a/admin/models/components_config.php +++ b/admin/models/components_config.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_config 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/components_custom_admin_menus.php b/admin/models/components_custom_admin_menus.php index 2a11dd798..5adfdee6a 100644 --- a/admin/models/components_custom_admin_menus.php +++ b/admin/models/components_custom_admin_menus.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_custom_admin_menus 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/components_custom_admin_views.php b/admin/models/components_custom_admin_views.php index cee273ff4..e4aa235d1 100644 --- a/admin/models/components_custom_admin_views.php +++ b/admin/models/components_custom_admin_views.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_custom_admin_views 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/components_dashboard.php b/admin/models/components_dashboard.php index 797d4bb15..743c43615 100644 --- a/admin/models/components_dashboard.php +++ b/admin/models/components_dashboard.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_dashboard 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/components_files_folders.php b/admin/models/components_files_folders.php index 010943ff9..bf14573a4 100644 --- a/admin/models/components_files_folders.php +++ b/admin/models/components_files_folders.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_files_folders 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/components_modules.php b/admin/models/components_modules.php index bc14dc6dd..49677f5fc 100644 --- a/admin/models/components_modules.php +++ b/admin/models/components_modules.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_modules 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/components_mysql_tweaks.php b/admin/models/components_mysql_tweaks.php index 84b451df3..e875192bf 100644 --- a/admin/models/components_mysql_tweaks.php +++ b/admin/models/components_mysql_tweaks.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_mysql_tweaks 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/components_placeholders.php b/admin/models/components_placeholders.php index 6d345ba65..bbaa25eec 100644 --- a/admin/models/components_placeholders.php +++ b/admin/models/components_placeholders.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_placeholders 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/components_plugins.php b/admin/models/components_plugins.php index 75f530e9b..bf34fe716 100644 --- a/admin/models/components_plugins.php +++ b/admin/models/components_plugins.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_plugins 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/components_site_views.php b/admin/models/components_site_views.php index b4c0d6f86..40afd2908 100644 --- a/admin/models/components_site_views.php +++ b/admin/models/components_site_views.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_site_views 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/components_updates.php b/admin/models/components_updates.php index 22af964b4..c80f61143 100644 --- a/admin/models/components_updates.php +++ b/admin/models/components_updates.php @@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_updates 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/fieldtypes.php b/admin/models/fieldtypes.php index 103079250..07a9056dc 100644 --- a/admin/models/fieldtypes.php +++ b/admin/models/fieldtypes.php @@ -222,7 +222,7 @@ class ComponentbuilderModelFieldtypes 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/help_documents.php b/admin/models/help_documents.php index 7a19a5d8c..caad44a81 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -313,7 +313,7 @@ class ComponentbuilderModelHelp_documents 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/joomla_modules_files_folders_urls.php b/admin/models/joomla_modules_files_folders_urls.php index de7354da7..be888b42d 100644 --- a/admin/models/joomla_modules_files_folders_urls.php +++ b/admin/models/joomla_modules_files_folders_urls.php @@ -167,7 +167,7 @@ class ComponentbuilderModelJoomla_modules_files_folders_urls 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/joomla_modules_updates.php b/admin/models/joomla_modules_updates.php index 036e022c0..59e554ab7 100644 --- a/admin/models/joomla_modules_updates.php +++ b/admin/models/joomla_modules_updates.php @@ -167,7 +167,7 @@ class ComponentbuilderModelJoomla_modules_updates 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/joomla_plugin_groups.php b/admin/models/joomla_plugin_groups.php index bba10de1b..352681349 100644 --- a/admin/models/joomla_plugin_groups.php +++ b/admin/models/joomla_plugin_groups.php @@ -186,7 +186,7 @@ class ComponentbuilderModelJoomla_plugin_groups 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/joomla_plugins_files_folders_urls.php b/admin/models/joomla_plugins_files_folders_urls.php index 5d5ce338b..f0b4b6588 100644 --- a/admin/models/joomla_plugins_files_folders_urls.php +++ b/admin/models/joomla_plugins_files_folders_urls.php @@ -167,7 +167,7 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls 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/joomla_plugins_updates.php b/admin/models/joomla_plugins_updates.php index 815a27d55..9932e633a 100644 --- a/admin/models/joomla_plugins_updates.php +++ b/admin/models/joomla_plugins_updates.php @@ -167,7 +167,7 @@ class ComponentbuilderModelJoomla_plugins_updates 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/language_translations.php b/admin/models/language_translations.php index 576238aae..ab757e5a0 100644 --- a/admin/models/language_translations.php +++ b/admin/models/language_translations.php @@ -236,7 +236,7 @@ class ComponentbuilderModelLanguage_translations 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/languages.php b/admin/models/languages.php index 8e213199b..f1b605d64 100644 --- a/admin/models/languages.php +++ b/admin/models/languages.php @@ -309,7 +309,7 @@ class ComponentbuilderModelLanguages 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/libraries_config.php b/admin/models/libraries_config.php index ef0e737c7..cce06d8aa 100644 --- a/admin/models/libraries_config.php +++ b/admin/models/libraries_config.php @@ -167,7 +167,7 @@ class ComponentbuilderModelLibraries_config 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/libraries_files_folders_urls.php b/admin/models/libraries_files_folders_urls.php index 6de29e839..b0ae9b948 100644 --- a/admin/models/libraries_files_folders_urls.php +++ b/admin/models/libraries_files_folders_urls.php @@ -167,7 +167,7 @@ class ComponentbuilderModelLibraries_files_folders_urls 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/servers.php b/admin/models/servers.php index 4eceb0595..8274b04b2 100644 --- a/admin/models/servers.php +++ b/admin/models/servers.php @@ -255,7 +255,7 @@ class ComponentbuilderModelServers 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/snippet_types.php b/admin/models/snippet_types.php index b785dd0ef..92c73f716 100644 --- a/admin/models/snippet_types.php +++ b/admin/models/snippet_types.php @@ -186,7 +186,7 @@ class ComponentbuilderModelSnippet_types 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));