Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dev:changes_in_2.7 [2014/09/18 15:26]
mistic100
dev:changes_in_2.7 [2014/09/22 15:25] (current)
plg info about batch manager and filters + search.tpl
Line 141: Line 141:
 jQuery('[data-add-album]').pwgAddAlbum({ cache: categoriesCache }); jQuery('[data-add-album]').pwgAddAlbum({ cache: categoriesCache });
 </code> </code>
 +
 +==== Batch Manager, add filters ====
 +
 +We have added 2 trigger_change to add filters in the Batch Manager. The first on batch_manager_register_filters let you register a filter:
 +
 +<code php>add_event_handler('batch_manager_register_filters', 'bmab_register_filter');
 +function bmab_register_filter($filters)
 +{
 +  if (isset($_POST['filter_added_by_use']))
 +  {
 +    check_input_parameter('filter_added_by', $_POST, false, PATTERN_ID);
 +    
 +    $filters['added_by'] = $_POST['filter_added_by'];
 +  }
 +
 +  return $filters;
 +}</code>
 +
 +The second trigger_change batch_manager_perform_filters let you define the list of photos that match the filter, and add the set of photos to $filter_sets.
 +
 +<code php>add_event_handler('batch_manager_perform_filters', 'bmab_perform_filter');
 +function bmab_perform_filter($filter_sets)
 +{
 +  if (isset($_SESSION['bulk_manager_filter']['added_by']))
 +  {
 +    $query = '
 +SELECT
 +    id
 +  FROM '.IMAGES_TABLE.'
 +  WHERE added_by = '.$_SESSION['bulk_manager_filter']['added_by'].'
 +;';
 +    $filter_sets[] = array_from_query($query, 'id');
 +  }
 +
 +  return $filter_sets;
 +}</code>
 +
 +See a full example on http://piwigo.org/dev/browser/extensions/batch_manager_added_by/main.inc.php
  
 ====Take A Tour plugin ==== ====Take A Tour plugin ====
Line 178: Line 216:
 {$THUMB_SRC} template variable is not assigned anymore. Use instead {$current.derivatives.thumb->get_url()} {$THUMB_SRC} template variable is not assigned anymore. Use instead {$current.derivatives.thumb->get_url()}
 ==== search.tpl - major changes ==== ==== search.tpl - major changes ====
-TODO+ 
 +The template search.tpl has deeply modified, so if you have a custom one in your theme, you'd better restart your customization from the new themes/default/template/search.tpl
 
Back to top
dev/changes_in_2.7.1411046787.txt.gz · Last modified: 2014/09/18 15:26 by mistic100
 
 
github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact