From 20c284546fb68c4ec1bd50d0463a45b2d660c48e Mon Sep 17 00:00:00 2001 From: rub Date: Tue, 1 May 2007 13:57:52 +0000 Subject: Issue 0000684: History [Search] - Add a thumbnail display o Display choice can be selected o Display choice is saved on on cookie o Small improvement picture link (hoverbox on all the link, alt&title on classic mode) o New cookie functions and use Enhance computing method of script_basename function. http://forum.phpwebgallery.net/viewtopic.php?pid=58258#p58258 Merge BSF 1988:1989 into branch-1_7 git-svn-id: http://piwigo.org/svn/trunk@1992 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/history.php | 89 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 25 deletions(-) (limited to 'admin') diff --git a/admin/history.php b/admin/history.php index cdfe5ee81..a7056f838 100644 --- a/admin/history.php +++ b/admin/history.php @@ -28,11 +28,6 @@ * Display filtered history lines */ -// echo '
$_POST:
-// '; print_r($_POST); echo '
'; -// echo '
$_GET:
-// '; print_r($_GET); echo '
'; - // +-----------------------------------------------------------------------+ // | functions | // +-----------------------------------------------------------------------+ @@ -59,6 +54,7 @@ else } $types = array('none', 'picture', 'high', 'other'); +$display_thumbnails = array('no_display_thumbnail', 'display_thumbnail_classic', 'display_thumbnail_hoverbox'); // +-----------------------------------------------------------------------+ // | Check Access and exit when user status is not ok | @@ -114,6 +110,10 @@ if (isset($_POST['submit'])) ); } + $search['fields']['display_thumbnail'] = $_POST['display_thumbnail']; + // Display choise are also save to one cookie + pwg_set_cookie_var('history_display_thumbnail', $_POST['display_thumbnail']); + // TODO manage inconsistency of having $_POST['image_id'] and // $_POST['filename'] simultaneously @@ -560,37 +560,52 @@ SELECT 'image_id' => $line['image_id'], ) ); - - // (1258) + $element = array( 'id' => $line['image_id'], 'file' => $file_of_image[$line['image_id']], 'path' => $path_of_image[$line['image_id']], 'tn_ext' => $tn_ext_of_image[$line['image_id']], ); - $image_string = ''; - if (!isset($conf['history_no_thumb']) or $conf['history_no_thumb']) { - $thumb_mode = "over"; - if (isset($conf['history_no_hover']) and $conf['history_no_hover']) { - $thumb_mode = "thumbnail"; - } - $image_string = '' - .'('.$line['image_id'].') '; - } - else { - $image_string= ''; - $image_string.= '('.$line['image_id'].')'; - } - + + $image_title = '('.$line['image_id'].')'; + if (isset($label_of_image[$line['image_id']])) { - $image_string.= ' '.$label_of_image[$line['image_id']]; + $image_title.= ' '.$label_of_image[$line['image_id']]; } else { - $image_string.= ' unknown filename'; + $image_title.= ' unknown filename'; + } + + $image_string = ''; + + switch ($page['search']['fields']['display_thumbnail']) + { + case 'no_display_thumbnail': + { + $image_string= ''.$image_title.''; + break; + } + case 'display_thumbnail_classic': + { + $image_string = + '' + .''.$image_title.'' + .''; + break; + } + case 'display_thumbnail_hoverbox': + { + $image_string = + '' + .''.$image_title.'' + .''.$image_title.''; + break; + } } } @@ -726,6 +741,8 @@ if (isset($page['search'])) $form['image_id'] = @$page['search']['fields']['image_id']; $form['filename'] = @$page['search']['fields']['filename']; + + $form['display_thumbnail'] = @$page['search']['fields']['display_thumbnail']; } else { @@ -735,6 +752,9 @@ else $form['start_month'] = $form['end_month'] = date('n'); $form['start_day'] = $form['end_day'] = date('j'); $form['types'] = $types; + // Hoverbox by default + $form['display_thumbnail'] = + pwg_get_cookie_var('history_display_thumbnail', $display_thumbnails[2]); } // start date @@ -809,7 +829,26 @@ while ($row = mysql_fetch_array($result)) ) ); } + +foreach ($display_thumbnails as $display_thumbnail) +{ + $selected = ''; + if ($display_thumbnail === $form['display_thumbnail']) + { + $selected = 'selected="selected"'; + } + + $template->assign_block_vars( + 'display_thumbnail', + array( + 'VALUE' => $display_thumbnail, + 'CONTENT' => l10n($display_thumbnail), + 'SELECTED' => $selected, + ) + ); +} + // +-----------------------------------------------------------------------+ // | html code display | // +-----------------------------------------------------------------------+ -- cgit v1.2.3