Changeset 5576


Ignore:
Timestamp:
04/02/10 20:32:23 (10 years ago)
Author:
nikrou
Message:

Fix missing keys and misspelling keys in translations +
small refatcoring in admin/history.

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/history.php

    r5196 r5576  
    5252 
    5353$types = array('none', 'picture', 'high', 'other'); 
    54 $display_thumbnails = array('No display', 'Classic display', 'Hoverbox display'); 
     54 
     55$display_thumbnails = array('no_display_thumbnail' => l10n('No display'), 
     56                            'display_thumbnail_classic' => l10n('Classic display'), 
     57                            'display_thumbnail_hoverbox' => l10n('Hoverbox display') 
     58  ); 
    5559 
    5660// +-----------------------------------------------------------------------+ 
     
    117121  $search['fields']['display_thumbnail'] = $_POST['display_thumbnail']; 
    118122  // Display choise are also save to one cookie 
    119   $cookie_val = ($_POST['display_thumbnail']!=$display_thumbnails[2] and in_array($_POST['display_thumbnail'], $display_thumbnails)) ? $_POST['display_thumbnail']:null; 
    120   pwg_set_cookie_var('history_display_thumbnail', $cookie_val, strtotime('+1 month') ); 
     123  if (!empty($_POST['display_thumbnail']) 
     124      and isset($display_thumbnails[$_POST['display_thumbnail']])) 
     125  { 
     126    $cookie_val = $_POST['display_thumbnail']; 
     127  } 
     128  else 
     129  { 
     130    $cookie_val = null; 
     131  } 
     132   
     133  pwg_set_cookie_var('display_thumbnail', $cookie_val, strtotime('+1 month') ); 
    121134 
    122135  // TODO manage inconsistency of having $_POST['image_id'] and 
    123136  // $_POST['filename'] simultaneously 
    124  
    125   // echo '<pre>'; print_r($search); echo '</pre>'; 
    126137 
    127138  if (!empty($search)) 
     
    625636  // Hoverbox by default 
    626637  $form['display_thumbnail'] = 
    627     pwg_get_cookie_var('history_display_thumbnail', $display_thumbnails[2]); 
     638    pwg_get_cookie_var('display_thumbnail', 'no_display_thumbnail'); 
    628639} 
    629640 
     
    672683); 
    673684 
    674 $template->assign( 
    675   array( 
    676       'display_thumbnail_values' => $display_thumbnails, 
    677       'display_thumbnail_selected' => array($form['display_thumbnail']), 
    678     ) 
    679   ); 
     685$template->assign('display_thumbnails', $display_thumbnails); 
     686$template->assign('display_thumbnail_selected', $form['display_thumbnail']); 
    680687 
    681688// +-----------------------------------------------------------------------+ 
  • trunk/admin/themes/default/template/history.tpl

    r5123 r5576  
    7777    {'Thumbnails'|@translate} 
    7878    <select name="display_thumbnail"> 
    79       {html_options values=$display_thumbnail_values output=$display_thumbnail_values|translate selected=$display_thumbnail_selected} 
     79      {html_options options=$display_thumbnails selected=$display_thumbnail_selected} 
    8080    </select> 
    8181  </label> 
Note: See TracChangeset for help on using the changeset viewer.