aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-04-02 18:32:23 +0000
committernikrou <nikrou@piwigo.org>2010-04-02 18:32:23 +0000
commit213cacc855d8843fee41db9b406e76efc140d88a (patch)
tree2930b9aae924af59ca4f3b1017559abd917c17a7
parent4061fefe7139792ac09687daec0013c2b1db62ae (diff)
Fix missing keys and misspelling keys in translations +
small refatcoring in admin/history. git-svn-id: http://piwigo.org/svn/trunk@5576 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/history.php31
-rw-r--r--admin/themes/default/template/history.tpl2
2 files changed, 20 insertions, 13 deletions
diff --git a/admin/history.php b/admin/history.php
index 4e7466e8c..e49cbd9f0 100644
--- a/admin/history.php
+++ b/admin/history.php
@@ -51,7 +51,11 @@ else
}
$types = array('none', 'picture', 'high', 'other');
-$display_thumbnails = array('No display', 'Classic display', 'Hoverbox display');
+
+$display_thumbnails = array('no_display_thumbnail' => l10n('No display'),
+ 'display_thumbnail_classic' => l10n('Classic display'),
+ 'display_thumbnail_hoverbox' => l10n('Hoverbox display')
+ );
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
@@ -116,14 +120,21 @@ if (isset($_POST['submit']))
$search['fields']['display_thumbnail'] = $_POST['display_thumbnail'];
// Display choise are also save to one cookie
- $cookie_val = ($_POST['display_thumbnail']!=$display_thumbnails[2] and in_array($_POST['display_thumbnail'], $display_thumbnails)) ? $_POST['display_thumbnail']:null;
- pwg_set_cookie_var('history_display_thumbnail', $cookie_val, strtotime('+1 month') );
+ if (!empty($_POST['display_thumbnail'])
+ and isset($display_thumbnails[$_POST['display_thumbnail']]))
+ {
+ $cookie_val = $_POST['display_thumbnail'];
+ }
+ else
+ {
+ $cookie_val = null;
+ }
+
+ pwg_set_cookie_var('display_thumbnail', $cookie_val, strtotime('+1 month') );
// TODO manage inconsistency of having $_POST['image_id'] and
// $_POST['filename'] simultaneously
- // echo '<pre>'; print_r($search); echo '</pre>';
-
if (!empty($search))
{
// register search rules in database, then they will be available on
@@ -624,7 +635,7 @@ else
$form['types'] = $types;
// Hoverbox by default
$form['display_thumbnail'] =
- pwg_get_cookie_var('history_display_thumbnail', $display_thumbnails[2]);
+ pwg_get_cookie_var('display_thumbnail', 'no_display_thumbnail');
}
@@ -671,12 +682,8 @@ $template->assign(
)
);
-$template->assign(
- array(
- 'display_thumbnail_values' => $display_thumbnails,
- 'display_thumbnail_selected' => array($form['display_thumbnail']),
- )
- );
+$template->assign('display_thumbnails', $display_thumbnails);
+$template->assign('display_thumbnail_selected', $form['display_thumbnail']);
// +-----------------------------------------------------------------------+
// | html code display |
diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl
index 5d0cd771e..00d179e7b 100644
--- a/admin/themes/default/template/history.tpl
+++ b/admin/themes/default/template/history.tpl
@@ -76,7 +76,7 @@
<label>
{'Thumbnails'|@translate}
<select name="display_thumbnail">
- {html_options values=$display_thumbnail_values output=$display_thumbnail_values|translate selected=$display_thumbnail_selected}
+ {html_options options=$display_thumbnails selected=$display_thumbnail_selected}
</select>
</label>