From 0216a358d3ec296e80f64bdfbc1cb283000e3dbb Mon Sep 17 00:00:00 2001 From: The Boss Date: Thu, 15 Oct 2015 10:40:56 +0100 Subject: [PATCH 1/2] Update resources.static.php Use right join on categories so all categories (including those with no resources) can be listed in the combined category view. This allows those categories with no resources to be deleted if required as they are now all listed. --- manager/actions/resources.static.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manager/actions/resources.static.php b/manager/actions/resources.static.php index 71a6d85e75..e30c308bce 100644 --- a/manager/actions/resources.static.php +++ b/manager/actions/resources.static.php @@ -201,7 +201,7 @@ function createResourceList($resourceTable,$action,$nameField = 'name') { $rs = $modx->db->select( "{$pluginsql} {$nameField} as name, {$v['table']}.id, description, locked, categories.category, categories.id as catid", $modx->getFullTableName($v['table'])." AS {$v['table']} - LEFT JOIN ".$modx->getFullTableName('categories')." AS categories ON {$v['table']}.category = categories.id", + RIGHT JOIN ".$modx->getFullTableName('categories')." AS categories ON {$v['table']}.category = categories.id", "", "5,1" ); @@ -234,9 +234,11 @@ function createResourceList($resourceTable,$action,$nameField = 'name') { $insideUl = 1; } $class = array_key_exists('disabled',$v) && $v['disabled'] ? ' class="disabledPlugin"' : ''; + if ($v['id']) { ?>
  • >('.$_lang['locked'].')' : "" ; ?>
  • ': ''; From 69367ddec05697e3cdf50646762d8102ddc56a36 Mon Sep 17 00:00:00 2001 From: The Boss Date: Fri, 16 Oct 2015 09:23:28 +0100 Subject: [PATCH 2/2] Update resources.static.php Also make sure sort order for Combine View categories and elements are case insensitive. --- manager/actions/resources.static.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manager/actions/resources.static.php b/manager/actions/resources.static.php index e30c308bce..136b14157d 100644 --- a/manager/actions/resources.static.php +++ b/manager/actions/resources.static.php @@ -218,7 +218,9 @@ function createResourceList($resourceTable,$action,$nameField = 'name') { $name[$n] = $v['name']; } - array_multisort($category, SORT_ASC, $name, SORT_ASC, $finalInfo); + $category_lowercase = array_map('strtolower', $category); + $name_lowercase = array_map('strtolower', $name); + array_multisort($category_lowercase, SORT_ASC, SORT_STRING, $name_lowercase, SORT_ASC, SORT_STRING, $finalInfo); echo '