From f2f4855ed73f0a5b3e00a13682b2b7daff784383 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 28 Oct 2015 11:42:33 +0100 Subject: [PATCH] fix ML Filter doubled filename References #356 Closes #369 --- include/functions_images.inc.php | 16 +++++++++------- templates/2k11/admin/media_pane.tpl | 6 +++--- templates/2k11/admin/style.css | 18 +++++++++++++++--- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/include/functions_images.inc.php b/include/functions_images.inc.php index c4852699..8bbf5b16 100644 --- a/include/functions_images.inc.php +++ b/include/functions_images.inc.php @@ -36,11 +36,11 @@ function serendipity_isActiveFile($file) { * @access public * @param int The offset to start fetching media files * @param int How many items to fetch - * @param int The number (referenced varaible) of fetched items + * @param int The number (referenced variable) of fetched items * @param string The "ORDER BY" sql part when fetching items * @param string Order by DESC or ASC * @param string Only fetch files from a specific directory - * @param string Only fetch specific filenames + * @param string Only fetch specific filenames (including check for realname match) * @param string Only fetch media with specific keyword * @param array An array of restricting filter sets * @param boolean Apply strict directory checks, or include subdirectories? @@ -2019,7 +2019,8 @@ function serendipity_getimagesize($file, $ft_mime = '', $suf = '') { } /** - * Get the available fields of the media database + * Get the available fields of the media database, except name, + * since this is handled extra and hardcoded as 'only_filename' * * @access public * @return array Array with available, sortable fields @@ -2031,10 +2032,10 @@ function serendipity_getImageFields() { $x = array( 'i.date' => array('desc' => SORT_ORDER_DATE, 'type' => 'date' - ), + )/*, 'i.name' => array('desc' => SORT_ORDER_NAME - ), + ),*/ ); @@ -2042,10 +2043,10 @@ function serendipity_getImageFields() { $x = array( 'i.date' => array('desc' => SORT_ORDER_DATE, 'type' => 'date' - ), + ),/*, 'i.name' => array('desc' => SORT_ORDER_NAME - ), + ),*/ 'i.authorid' => array('desc' => AUTHOR, 'type' => 'authors' @@ -2937,6 +2938,7 @@ function serendipity_showMedia(&$file, &$paths, $url = '', $manage = false, $lin 'keywords_selected' => $serendipity['GET']['keywords'], 'filter' => $serendipity['GET']['filter'], 'sort_order' => serendipity_getImageFields(), + 'simpleFilters' => $serendipity['simpleFilters'], 'toggle_dir' => empty($serendipity['GET']['toggle_dir']) ? 'no' : $serendipity['GET']['toggle_dir'], 'authors' => serendipity_fetchUsers(), 'sort_row_interval' => array(8, 16, 50, 100), diff --git a/templates/2k11/admin/media_pane.tpl b/templates/2k11/admin/media_pane.tpl index d5930d61..d197041b 100644 --- a/templates/2k11/admin/media_pane.tpl +++ b/templates/2k11/admin/media_pane.tpl @@ -106,17 +106,17 @@ {* media filter end *} {/foreach} -
+
-
+
-
+
{foreach $media.keywords AS $keyword} {$keyword|escape|truncate:20:"…"} diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css index 1d2621a6..3353027a 100644 --- a/templates/2k11/admin/style.css +++ b/templates/2k11/admin/style.css @@ -980,6 +980,10 @@ input[type=checkbox], margin-bottom: .75em; } +#media_filter > .keywords { + margin-bottom: 0.75em; +} + #media_filter_path .form_select { margin: 0 0 0 .125em; } @@ -3035,6 +3039,11 @@ img.mfp-img { width: 20%; } + #media_filter > .left, + #media_filter > .center {/*mediafilter*/ + margin-right: .2em; + } + .user_level { display: inline; } @@ -3367,6 +3376,12 @@ img.mfp-img { width: 33% ; } + #media_filter > div.keywords {/*simple filter*/ + float: right; + margin-top: -2.5em; + margin-bottom: 0; + } + #filter_entries .form_select, #filter_entries .form_field { float: left; @@ -3383,8 +3398,6 @@ img.mfp-img { clear: left; } - #media_filter_file, - #media_pane_sort .left, #serendipity_comment .form_area { clear: both; } @@ -3550,7 +3563,6 @@ img.mfp-img { } } - /* LARGER SCREENS */ @media only screen and (min-width: 1280px) { .js .configuration_group .media_choose input {