Changeset 11210 for extensions


Ignore:
Timestamp:
Jun 2, 2011, 5:12:13 PM (13 years ago)
Author:
patdenice
Message:

Add two prefilters: with author and withour author

Location:
extensions/batch_manager_prefilters
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/batch_manager_prefilters/language/de_DE/plugin.lang.php

    r10734 r11210  
    44$lang['with HD'] = 'mit HD';
    55$lang['without HD'] = 'ohne HD';
     6/*TODO*/$lang['with author'] = 'with author';
     7/*TODO*/$lang['without author'] = 'without author';
    68
    79?>
  • extensions/batch_manager_prefilters/language/en_UK/plugin.lang.php

    r10379 r11210  
    44$lang['with HD'] = 'with HD';
    55$lang['without HD'] = 'without HD';
     6$lang['with author'] = 'with author';
     7$lang['without author'] = 'without author';
    68
    79?>
  • extensions/batch_manager_prefilters/language/fr_FR/plugin.lang.php

    r10379 r11210  
    44$lang['with HD'] = 'avec HD';
    55$lang['without HD'] = 'sans HD';
     6$lang['with author'] = 'avec auteur';
     7$lang['without author'] = 'sans auteur';
    68
    79?>
  • extensions/batch_manager_prefilters/language/it_IT/plugin.lang.php

    r10473 r11210  
    44$lang['with HD'] = 'con HD';
    55$lang['without HD'] = 'senza HD';
     6/*TODO*/$lang['with author'] = 'with author';
     7/*TODO*/$lang['without author'] = 'without author';
    68
    79?>
  • extensions/batch_manager_prefilters/language/lv_LV/plugin.lang.php

    r10509 r11210  
    44$lang['with HD'] = 'ar HD';
    55$lang['without HD'] = 'bez HD';
     6/*TODO*/$lang['with author'] = 'with author';
     7/*TODO*/$lang['without author'] = 'without author';
    68
    79?>
  • extensions/batch_manager_prefilters/language/pl_PL/plugin.lang.php

    r11033 r11210  
    33$lang['with tags'] = 'z tagami';
    44$lang['with HD'] = 'z HD';
    5 $lang['without HD'] = 'bez HD';
     5$lang['without HD'] = 'bez HD';
     6/*TODO*/$lang['with author'] = 'with author';
     7/*TODO*/$lang['without author'] = 'without author';
    68
    79?>
  • extensions/batch_manager_prefilters/language/ru_RU/plugin.lang.php

    r10696 r11210  
    44$lang['with HD'] = 'с HD';
    55$lang['without HD'] = 'без HD';
     6/*TODO*/$lang['with author'] = 'with author';
     7/*TODO*/$lang['without author'] = 'without author';
    68
    79?>
  • extensions/batch_manager_prefilters/language/sk_SK/plugin.lang.php

    r10519 r11210  
    44$lang['with HD'] = 's HD';
    55$lang['without HD'] = 'bez HD';
     6/*TODO*/$lang['with author'] = 'with author';
     7/*TODO*/$lang['without author'] = 'without author';
    68
    79?>
  • extensions/batch_manager_prefilters/language/sv_SE/plugin.lang.php

    r10732 r11210  
    44$lang['with HD'] = 'med HD';
    55$lang['without HD'] = 'utan HD';
     6/*TODO*/$lang['with author'] = 'with author';
     7/*TODO*/$lang['without author'] = 'without author';
    68
    79?>
  • extensions/batch_manager_prefilters/main.inc.php

    r10379 r11210  
    1313add_event_handler('get_batch_manager_prefilters', 'add_bmp');
    1414add_event_handler('perform_batch_manager_prefilters', 'perform_bmp', 50, 2);
     15add_event_handler('element_set_global_action', 'element_set_global_action_bmp');
    1516
    1617function add_bmp($prefilters)
     
    2122    array('ID' => 'with tags', 'NAME' => l10n('with tags')),
    2223    array('ID' => 'with HD', 'NAME' => l10n('with HD')),
    23     array('ID' => 'without HD', 'NAME' => l10n('without HD'))
     24    array('ID' => 'without HD', 'NAME' => l10n('without HD')),
     25    array('ID' => 'with author', 'NAME' => l10n('with author')),
     26    array('ID' => 'without author', 'NAME' => l10n('without author'))
    2427  );
    2528
     
    4750  }
    4851
     52  if ('with author' == $prefilter)
     53  {
     54    $query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE author IS NOT NULL;';
     55    array_push($filter_sets, array_from_query($query, 'id'));
     56  }
     57
     58  if ('without author' == $prefilter)
     59  {
     60    $query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE author IS NULL;';
     61    array_push($filter_sets, array_from_query($query, 'id'));
     62  }
     63
    4964  return $filter_sets;
    5065}
    5166
     67function element_set_global_action_bmp($action)
     68{
     69  if (($_SESSION['bulk_manager_filter']['prefilter'] == 'with tags' and in_array($action, array('add_tags', 'del_tags')))
     70    or (in_array($_SESSION['bulk_manager_filter']['prefilter'], array('with author', 'without author')) and $action == 'author'))
     71  {
     72    // let's refresh the page because we the current set might be modified
     73    redirect(get_root_url().'admin.php?page='.$_GET['page']);
     74  }
     75}
     76
    5277?>
Note: See TracChangeset for help on using the changeset viewer.