From 89274c0d2b04d8f0524cc37fa18bdd4cc592294a Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 3 Aug 2013 17:15:09 +0200 Subject: move the media search formlet up Currently the search box is below the media file list, where it is effectively inaccessible in a namespace with lots of files. This change moves the search box above the media file list and below the upload form. --- inc/media.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index c4378fe9e..a182ecb33 100644 --- a/inc/media.php +++ b/inc/media.php @@ -586,7 +586,10 @@ function media_filelist($ns,$auth=null,$jump='',$fullscreenview=false,$sort=fals // FIXME: print permission warning here instead? echo '
'.$lang['nothingfound'].'
'.NL; }else{ - if (!$fullscreenview) media_uploadform($ns, $auth); + if (!$fullscreenview) { + media_uploadform($ns, $auth); + media_searchform($ns); + } $dir = utf8_encodeFN(str_replace(':','/',$ns)); $data = array(); @@ -609,7 +612,6 @@ function media_filelist($ns,$auth=null,$jump='',$fullscreenview=false,$sort=fals if ($fullscreenview) echo ''.NL; } } - if (!$fullscreenview) media_searchform($ns); } /** -- cgit v1.2.3 From 00e3e3940de140e6fe6ce3c558c71a47f676b456 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 3 Aug 2013 17:17:58 +0200 Subject: fix the default ordering of media files to be "natural". also allow the order to be specified in more places. --- inc/media.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index a182ecb33..a9f6be771 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1296,7 +1296,7 @@ function media_restore($image, $rev, $auth){ * @author Kate Arzamastseva * @triggers MEDIA_SEARCH */ -function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort=''){ +function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort='natural'){ global $conf; global $lang; @@ -1316,15 +1316,10 @@ function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort=''){ $conf['mediadir'], 'search_media', array('showmsg'=>false,'pattern'=>$pattern), - $dir); + $dir, + 1, + $sort); } - - $data = array(); - foreach ($evdata['data'] as $k => $v) { - $data[$k] = ($sort == 'date') ? $v['mtime'] : $v['id']; - } - array_multisort($data, SORT_DESC, SORT_NUMERIC, $evdata['data']); - $evt->advise_after(); unset($evt); } -- cgit v1.2.3