Changeset 6025


Ignore:
Timestamp:
05/01/10 00:38:17 (9 years ago)
Author:
plg
Message:

bug 1637: make the privacy level the same everywher, use "who can see this photo?"
instead of "minimum privacy level".

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/element_set_global.php

    r5933 r6025  
    410410 
    411411// image level options 
    412 $tpl_options = array(); 
    413 foreach ($conf['available_permission_levels'] as $level) 
    414 { 
    415   $tpl_options[$level] = l10n( sprintf('Level %d', $level) ); 
    416 } 
    417412$template->assign( 
    418413    array( 
    419       'level_options'=> $tpl_options, 
     414      'level_options'=> get_privacy_level_options(), 
     415      'level_options_selected' => 0, 
    420416    ) 
    421417  ); 
  • trunk/admin/element_set_unit.php

    r5955 r6025  
    139139ksort($month_list); 
    140140 
    141 $tpl_options = array(); 
    142 foreach ($conf['available_permission_levels'] as $level) 
    143 { 
    144   $tpl_options[$level] = l10n( sprintf('Level %d', $level) ); 
    145 } 
    146  
    147141$template->assign( 
    148142  array( 
     
    157151    'F_ACTION'=>$base_url.get_query_string_diff(array()),     
    158152    'month_list' => $month_list, 
    159     'level_options' => $tpl_options 
     153    'level_options' => get_privacy_level_options(), 
    160154    ) 
    161155  ); 
     
    246240        'NAME' => !empty($row['name'])?$row['name']:'', 
    247241        'AUTHOR' => !empty($row['author'])?$row['author']:'', 
    248         'LEVEL' => !empty($row['level'])?$row['level']:'', 
     242        'LEVEL' => !empty($row['level'])?$row['level']:'0', 
    249243        'DESCRIPTION' => !empty($row['comment'])?$row['comment']:'', 
    250244        'DATE_CREATION_YEAR' => $year, 
  • trunk/admin/photos_add_direct.php

    r5960 r6025  
    431431 
    432432// image level options 
    433 $tpl_options = array(); 
    434 foreach (array_reverse($conf['available_permission_levels']) as $level) 
    435 { 
    436   $label = null; 
    437    
    438   if (0 == $level) 
    439   { 
    440     $label = l10n('Everybody'); 
    441   } 
    442   else 
    443   { 
    444     $labels = array(); 
    445     $sub_levels = array_reverse($conf['available_permission_levels']); 
    446     foreach ($sub_levels as $sub_level) 
    447     { 
    448       if ($sub_level == 0 or $sub_level < $level) 
    449       { 
    450         break; 
    451       } 
    452       array_push( 
    453         $labels, 
    454         l10n( 
    455           sprintf( 
    456             'Level %d', 
    457             $sub_level 
    458             ) 
    459           ) 
    460         ); 
    461     } 
    462      
    463     $label = implode(', ', $labels); 
    464   } 
    465   $tpl_options[$level] = $label; 
    466 } 
    467433$selected_level = isset($_POST['level']) ? $_POST['level'] : 0; 
    468434$template->assign( 
    469435    array( 
    470       'level_options'=> $tpl_options, 
     436      'level_options'=> get_privacy_level_options(), 
    471437      'level_options_selected' => array($selected_level) 
    472438    ) 
  • trunk/admin/picture_modify.php

    r5288 r6025  
    260260 
    261261// image level options 
    262 $tpl_options = array(); 
    263 foreach ($conf['available_permission_levels'] as $level) 
    264 { 
    265   $tpl_options[$level] = l10n( sprintf('Level %d', $level) ).' ('.$level.')'; 
    266 } 
    267262$selected_level = isset($_POST['level']) ? $_POST['level'] : $row['level']; 
    268263$template->assign( 
    269264    array( 
    270       'level_options'=> $tpl_options, 
     265      'level_options'=> get_privacy_level_options(), 
    271266      'level_options_selected' => array($selected_level) 
    272267    ) 
  • trunk/admin/site_update.php

    r5920 r6025  
    891891} 
    892892 
    893 $tpl_introduction['privacy_level_options']=array(); 
    894 foreach ($conf['available_permission_levels'] as $level) 
    895 { 
    896   $tpl_introduction['privacy_level_options'][$level] = l10n( sprintf('Level %d', $level) ); 
    897 } 
     893$tpl_introduction['privacy_level_options'] = get_privacy_level_options(); 
    898894 
    899895$template->assign('introduction', $tpl_introduction); 
  • trunk/admin/themes/default/template/configuration.tpl

    r5618 r6025  
    378378    <li> 
    379379      <label> 
    380         <span class="property">{'Privacy level'|@translate} ({'available for administrators only'|@translate})</span> 
     380        <span class="property">{'Who can see this photo?'|@translate} ({'available for administrators only'|@translate})</span> 
    381381        <input type="checkbox" name="picture_informations[privacy_level]" {if ($display.picture_informations.privacy_level)}checked="checked"{/if}> 
    382382      </label> 
  • trunk/admin/themes/default/template/element_set_global.tpl

    r5366 r6025  
    186186 
    187187    <tr> 
    188       <td>{'Minimum privacy level'|@translate}</td> 
     188      <td>{'Who can see these photos?'|@translate}</td> 
    189189      <td> 
    190190        <label><input type="radio" name="level_action" value="leave" checked="checked">{'leave'|@translate}</label> 
    191191        <label><input type="radio" name="level_action" value="set" id="level_action_set">{'set to'|@translate}</label> 
    192192        <select onchange="document.getElementById('level_action_set').checked = true;" name="level" size="1"> 
    193           {html_options options=$level_options} 
     193          {html_options options=$level_options selected=$level_options_selected} 
    194194        </select> 
    195195      </td> 
  • trunk/admin/themes/default/template/element_set_unit.tpl

    r5956 r6025  
    103103    </tr> 
    104104    <tr> 
    105       <td><strong>{'Minimum privacy level'|@translate}</strong></td> 
     105      <td><strong>{'Who can see this photo?'|@translate}</strong></td> 
    106106      <td> 
    107107        <select name="level-{$element.ID}"> 
  • trunk/admin/themes/default/template/picture_modify.tpl

    r5198 r6025  
    153153 
    154154  <tr> 
    155     <td><strong>{'Minimum privacy level'|@translate}</strong></td> 
     155    <td><strong>{'Who can see this photo?'|@translate}</strong></td> 
    156156    <td> 
    157157      <select name="level" size="1"> 
  • trunk/admin/themes/default/template/site_update.tpl

    r5123 r6025  
    7070                                        <li><label><input type="checkbox" name="display_info" value="1" {if $introduction.display_info}checked="checked"{/if}> {'display maximum informations (added categories and elements, deleted categories and elements)'|@translate}</label></li> 
    7171                                        <li><label><input type="checkbox" name="add_to_caddie" value="1" {if $introduction.add_to_caddie}checked="checked"{/if}> {'add new elements to caddie'|@translate}</label></li> 
    72                                         <li><label>{'Minimum privacy level'|@translate} <select name="privacy_level">{html_options options=$introduction.privacy_level_options selected=$introduction.privacy_level_selected}</select></label></li> 
     72                                        <li><label>{'Who can see these photos?'|@translate} <select name="privacy_level">{html_options options=$introduction.privacy_level_options selected=$introduction.privacy_level_selected}</select></label></li> 
    7373                                </ul> 
    7474                        </li> 
  • trunk/include/functions.inc.php

    r5982 r6025  
    15251525  } 
    15261526} 
     1527 
     1528 
     1529function get_privacy_level_options() 
     1530{ 
     1531  global $conf; 
     1532   
     1533  $options = array(); 
     1534  foreach (array_reverse($conf['available_permission_levels']) as $level) 
     1535  { 
     1536    $label = null; 
     1537   
     1538    if (0 == $level) 
     1539    { 
     1540      $label = l10n('Everybody'); 
     1541    } 
     1542    else 
     1543    { 
     1544      $labels = array(); 
     1545      $sub_levels = array_reverse($conf['available_permission_levels']); 
     1546      foreach ($sub_levels as $sub_level) 
     1547      { 
     1548        if ($sub_level == 0 or $sub_level < $level) 
     1549        { 
     1550          break; 
     1551        } 
     1552        array_push( 
     1553          $labels, 
     1554          l10n( 
     1555            sprintf( 
     1556              'Level %d', 
     1557              $sub_level 
     1558              ) 
     1559            ) 
     1560          ); 
     1561      } 
     1562       
     1563      $label = implode(', ', $labels); 
     1564    } 
     1565    $options[$level] = $label; 
     1566  } 
     1567  return $options; 
     1568} 
    15271569?> 
  • trunk/language/en_UK/admin.lang.php

    r5997 r6025  
    671671$lang['Everybody'] = 'Everybody'; 
    672672$lang['Who can see these photos?'] = 'Who can see these photos?'; 
     673$lang['Who can see this photo?'] = 'Who can see this photo?'; 
    673674$lang['... or switch to the old style form'] = '... or switch to the old style form'; 
    674675$lang['... or switch to the multiple files form'] = '... or switch to the multiple files form'; 
  • trunk/language/fr_FR/admin.lang.php

    r5997 r6025  
    672672$lang['Everybody'] = 'Tout le monde'; 
    673673$lang['Who can see these photos?'] = 'Qui peut voir ces photos ?'; 
     674$lang['Who can see this photo?'] = 'Qui peut voir cette photo ?'; 
    674675$lang['... or switch to the old style form'] = '... ou utiliser le formulaire "à l\'ancienne"'; 
    675676$lang['... or switch to the multiple files form'] = '... ou utiliser le formulaire multi-fichiers'; 
  • trunk/picture.php

    r5653 r6025  
    783783    ); 
    784784 
    785   $template->assign('available_permission_levels', $conf['available_permission_levels']); 
     785  $template->assign('available_permission_levels', get_privacy_level_options()); 
    786786} 
    787787 
  • trunk/themes/default/template/picture.tpl

    r5931 r6025  
    223223{if $display_info.privacy_level and isset($available_permission_levels) } 
    224224        <tr id="Privacy"> 
    225                 <td class="label">{'Privacy level'|@translate}:</td> 
     225                <td class="label">{'Who can see this photo?'|@translate}</td> 
    226226                <td class="value">  
    227227<script type="text/javascript"> 
     
    241241</script> 
    242242        <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)"> 
    243         {foreach from=$available_permission_levels item=level} 
    244                 <option value="{$level}"{if $current.level==$level} selected="selected"{/if}>{$pwg->l10n($pwg->sprintf('Level %d',$level))}</option> 
    245         {/foreach} 
     243          {html_options options=$available_permission_levels selected=$current.level} 
    246244        </select> 
    247245        </td></tr> 
Note: See TracChangeset for help on using the changeset viewer.