Added the category code to the new filters area. gh-378 Update the direction default the descending.

This commit is contained in:
Llewellyn van der Merwe 2020-11-30 17:30:10 +02:00
parent f20039b390
commit 3324576c95
Signed by untrusted user: Llewellyn
GPG Key ID: EFC0C720A240551C
32 changed files with 57 additions and 33 deletions

View File

@ -5617,6 +5617,31 @@ class Fields extends Structure
. '<option value="">JOPTION_SELECT_PUBLISHED</option>'; . '<option value="">JOPTION_SELECT_PUBLISHED</option>';
$field_filter_sets[] = $this->_t(2) . '</field>'; $field_filter_sets[] = $this->_t(2) . '</field>';
} }
// 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) . '<field';
$field_filter_sets[] = $this->_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 // add the access filter if this view has access
// and if access manually is not set // and if access manually is not set
if (isset($this->accessBuilder[$nameSingleCode]) if (isset($this->accessBuilder[$nameSingleCode])

View File

@ -15404,7 +15404,6 @@ class Interpretation extends Fields
$query .= PHP_EOL; $query .= PHP_EOL;
} }
// setup values for the view ordering // setup values for the view ordering
// add dynamic ordering (Admin view) // add dynamic ordering (Admin view)
if (isset($this->viewsDefaultOrdering[$nameListCode]) if (isset($this->viewsDefaultOrdering[$nameListCode])
&& $this->viewsDefaultOrdering[$nameListCode]['add_admin_ordering'] && $this->viewsDefaultOrdering[$nameListCode]['add_admin_ordering']
@ -15464,7 +15463,7 @@ class Interpretation extends Fields
$query .= PHP_EOL . $this->_t(2) $query .= PHP_EOL . $this->_t(2)
. "\$orderCol = \$this->state->get('list.ordering', 'a.id');"; . "\$orderCol = \$this->state->get('list.ordering', 'a.id');";
$query .= PHP_EOL . $this->_t(2) $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) . "if (\$orderCol != '')";
$query .= PHP_EOL . $this->_t(2) . "{"; $query .= PHP_EOL . $this->_t(2) . "{";
$query .= PHP_EOL . $this->_t(3) $query .= PHP_EOL . $this->_t(3)

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelAdmins_fields extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -239,7 +239,7 @@ class ComponentbuilderModelClass_extendings extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_admin_views extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_config extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_dashboard extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_files_folders extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_modules extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_placeholders extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_plugins extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_site_views extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelComponents_updates extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -222,7 +222,7 @@ class ComponentbuilderModelFieldtypes extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -313,7 +313,7 @@ class ComponentbuilderModelHelp_documents extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelJoomla_modules_files_folders_urls extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelJoomla_modules_updates extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -186,7 +186,7 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelJoomla_plugins_updates extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -236,7 +236,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -309,7 +309,7 @@ class ComponentbuilderModelLanguages extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelLibraries_config extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -167,7 +167,7 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -255,7 +255,7 @@ class ComponentbuilderModelServers extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));

View File

@ -186,7 +186,7 @@ class ComponentbuilderModelSnippet_types extends JModelList
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));