diff options
author | vdigital <vdigital@piwigo.org> | 2008-05-17 20:40:27 +0000 |
---|---|---|
committer | vdigital <vdigital@piwigo.org> | 2008-05-17 20:40:27 +0000 |
commit | 069748aa9106c1a2a583e4ab295157c7a33ad33b (patch) | |
tree | a94b5a1979dd1ef891accdd92e71c89019d17f01 | |
parent | 6ee69cf39cfb621ef72bc96e20d720d47c253fd6 (diff) |
Bug 703: Authorization system in Cat management works now with well ordered lists
(Minor: Admin theme changes)
git-svn-id: http://piwigo.org/svn/trunk@2349 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/cat_perm.php | 9 | ||||
-rw-r--r-- | include/functions_html.inc.php | 17 | ||||
-rw-r--r-- | template/yoga/theme/admin/images/header_bottom.png | bin | 0 -> 190 bytes | |||
-rw-r--r-- | template/yoga/theme/admin/images/logo23.jpg | bin | 6708 -> 0 bytes | |||
-rw-r--r-- | template/yoga/theme/admin/images/select_bt.png | bin | 493 -> 0 bytes |
5 files changed, 23 insertions, 3 deletions
diff --git a/admin/cat_perm.php b/admin/cat_perm.php index e265430cf..45eb15937 100644 --- a/admin/cat_perm.php +++ b/admin/cat_perm.php @@ -231,12 +231,13 @@ SELECT group_id WHERE cat_id = '.$page['cat'].' ;'; $group_granted_ids = array_from_query($query, 'group_id'); +$group_granted_ids = order_by_name($group_granted_ids, $groups); $template->assign('group_granted_ids', $group_granted_ids); // groups denied $template->assign('group_denied_ids', - array_diff(array_keys($groups), $group_granted_ids) + order_by_name(array_diff(array_keys($groups), $group_granted_ids), $groups) ); // users... @@ -257,7 +258,7 @@ SELECT user_id WHERE cat_id = '.$page['cat'].' ;'; $user_granted_direct_ids = array_from_query($query, 'user_id'); - +$user_granted_direct_ids = order_by_name($user_granted_direct_ids, $users); $template->assign('user_granted_direct_ids', $user_granted_direct_ids); @@ -294,7 +295,8 @@ SELECT user_id, group_id $user_granted_indirect_ids = array_diff($user_granted_by_group_ids, $user_granted_direct_ids); - + $user_granted_indirect_ids = + order_by_name($user_granted_indirect_ids, $users); foreach ($user_granted_indirect_ids as $user_id) { foreach ($granted_groups as $group_id => $group_users) @@ -317,6 +319,7 @@ SELECT user_id, group_id $user_denied_ids = array_diff(array_keys($users), $user_granted_indirect_ids, $user_granted_direct_ids); +$user_denied_ids = order_by_name($user_denied_ids, $users); $template->assign('user_denied_ids', $user_denied_ids); diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index c2e34bef6..4c24ad17f 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -731,4 +731,21 @@ function render_category_literal_description($desc) { return strip_tags($desc, '<span><p><a><br><b><i><small><big><strong><em>'); } + +/** returns the argument_ids array with new sequenced keys based on related + * names. Sequence is not case sensitive. + * Warning: By definition, this function breaks original keys + */ +function order_by_name($element_ids,$name) +{ + $ordered_element_ids = array(); + foreach ($element_ids as $k_id => $element_id) + { + $key = strtolower($name[$element_id]) .'-'. $name[$element_id] .'-'. $k_id; + $ordered_element_ids[$key] = $element_id; + } + ksort($ordered_element_ids); + return $ordered_element_ids; +} + ?> diff --git a/template/yoga/theme/admin/images/header_bottom.png b/template/yoga/theme/admin/images/header_bottom.png Binary files differnew file mode 100644 index 000000000..e4d049881 --- /dev/null +++ b/template/yoga/theme/admin/images/header_bottom.png diff --git a/template/yoga/theme/admin/images/logo23.jpg b/template/yoga/theme/admin/images/logo23.jpg Binary files differdeleted file mode 100644 index 15f830e60..000000000 --- a/template/yoga/theme/admin/images/logo23.jpg +++ /dev/null diff --git a/template/yoga/theme/admin/images/select_bt.png b/template/yoga/theme/admin/images/select_bt.png Binary files differdeleted file mode 100644 index 8082b81ca..000000000 --- a/template/yoga/theme/admin/images/select_bt.png +++ /dev/null |