'with copyright', 'NAME' => l10n('With copyright')), array('ID' => 'without copyright', 'NAME' => l10n('Without copyright')) ); return $prefilters; } // Put the right photos in the prefilter array function CR_perform_bm_filter($filter_sets, $prefilter) { if ('with copyright' == $prefilter) { // Select all photos in the copyrights table who´s CR not is 0 $query = sprintf(' SELECT media_id FROM %s WHERE cr_id <> 0 ;', COPYRIGHTS_MEDIA); array_push($filter_sets, array_from_query($query, 'media_id')); } if ('without copyright' == $prefilter) { // Select all photo's, except the ones that have a copyright $query = sprintf(' SELECT id FROM %s WHERE id NOT IN ( SELECT media_id FROM %s WHERE cr_id <> 0 ) ;', IMAGES_TABLE, COPYRIGHTS_MEDIA); array_push($filter_sets, array_from_query($query, 'id')); } return $filter_sets; } // Test if the filters aren't set incorrectly function CR_element_set_bm_global_action($action) { if (in_array(@$_SESSION['bulk_manager_filter']['prefilter'], array('with copyrights', 'without copyrights')) and $action == 'copyrights') { // let's refresh the page because we the current set might be modified redirect(get_root_url().'admin.php?page='.$_GET['page']); } } ?>