Changeset 13646


Ignore:
Timestamp:
03/19/12 12:07:08 (8 years ago)
Author:
plg
Message:

feature 2596: Batch Manager, improve ergonomy on privacy level filter

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager.php

    r12922 r13646  
    8484    { 
    8585      $_SESSION['bulk_manager_filter']['level'] = $_POST['filter_level']; 
     86       
     87      if (isset($_POST['filter_level_include_lower'])) 
     88      { 
     89        $_SESSION['bulk_manager_filter']['level_include_lower'] = true; 
     90      } 
    8691    } 
    8792  } 
     
    290295if (isset($_SESSION['bulk_manager_filter']['level'])) 
    291296{ 
     297  $operator = '='; 
     298  if (isset($_SESSION['bulk_manager_filter']['level_include_lower'])) 
     299  { 
     300    $operator = '<='; 
     301  } 
     302   
    292303  $query = ' 
    293304SELECT id 
    294305  FROM '.IMAGES_TABLE.' 
    295   WHERE level >= '.$_SESSION['bulk_manager_filter']['level'].' 
     306  WHERE level '.$operator.' '.$_SESSION['bulk_manager_filter']['level'].' 
    296307;'; 
    297308  array_push( 
  • trunk/admin/batch_manager_global.php

    r13544 r13646  
    520520 
    521521// privacy level 
     522foreach ($conf['available_permission_levels'] as $level) 
     523{ 
     524  $level_options[$level] = l10n(sprintf('Level %d', $level)); 
     525 
     526  if (0 == $level) 
     527  { 
     528    $level_options[$level] = l10n('Everybody'); 
     529  } 
     530} 
    522531$template->assign( 
    523     array( 
    524       'filter_level_options'=> get_privacy_level_options(), 
    525       'filter_level_options_selected' => isset($_SESSION['bulk_manager_filter']['level']) 
    526         ? $_SESSION['bulk_manager_filter']['level'] 
    527         : 0, 
     532  array( 
     533    'filter_level_options'=> $level_options, 
     534    'filter_level_options_selected' => isset($_SESSION['bulk_manager_filter']['level']) 
     535    ? $_SESSION['bulk_manager_filter']['level'] 
     536    : 0, 
    528537    ) 
    529538  ); 
    530539 
     540// tags 
    531541if (!empty($_SESSION['bulk_manager_filter']['tags'])) 
    532542{ 
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r13575 r13646  
    539539        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> 
    540540        <input type="checkbox" name="filter_level_use" class="useFilterCheckbox" {if isset($filter.level)}checked="checked"{/if}> 
    541         {'Who can see these photos?'|@translate} 
     541        {'Privacy level'|@translate} 
    542542        <select name="filter_level" size="1"> 
    543543          {html_options options=$filter_level_options selected=$filter_level_options_selected} 
    544544        </select> 
     545        <label><input type="checkbox" name="filter_level_include_lower" {if isset($filter.level_include_lower)}checked="checked"{/if}> {'include photos with lower privacy level'|@translate}</label> 
    545546      </li> 
    546547    </ul> 
     
    553554        <option value="filter_category">{'Album'|@translate}</option> 
    554555                                <option value="filter_tags">{'Tags'|@translate}</option> 
    555         <option value="filter_level">{'Who can see these photos?'|@translate}</option> 
     556        <option value="filter_level">{'Privacy level'|@translate}</option> 
    556557      </select> 
    557558<!--      <input id="removeFilters" class="submit" type="submit" value="Remove all filters" name="removeFilters"> --> 
  • trunk/language/en_UK/admin.lang.php

    r13593 r13646  
    874874$lang['Select users...'] = 'Select users...'; 
    875875$lang['%u users have automatic permission because they belong to a granted group.'] = '%u users have automatic permission because they belong to a granted group.'; 
     876$lang['include photos with lower privacy level'] = 'include photos with lower privacy level'; 
    876877?> 
  • trunk/language/fr_FR/admin.lang.php

    r13593 r13646  
    889889$lang['Select users...'] = 'Sélectionnez les utilisateurs...'; 
    890890$lang['%u users have automatic permission because they belong to a granted group.'] = '%u utilisateurs ont automatiquement la permission car ils appartiennent à un groupe autorisé.'; 
     891$lang['include photos with lower privacy level'] = 'inclure les photos d\'un niveau de confidentialité inférieur'; 
    891892?> 
Note: See TracChangeset for help on using the changeset viewer.