Index: modules/epublish/epublish.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/epublish/epublish.module,v
retrieving revision 1.13
diff -u -p -r1.13 epublish.module
--- modules/epublish/epublish.module	10 Jul 2006 02:49:34 -0000	1.13
+++ modules/epublish/epublish.module	31 Oct 2006 16:33:15 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: epublish.module,v 1.13 2006/07/10 02:49:34 patriciabarden Exp $
+// $Id: epublish.module,v 1.9.2.4 2006/07/10 02:53:14 patriciabarden Exp $
 
 /*
 		epublish.module - Part of the epublish module for Drupal
@@ -2452,33 +2452,12 @@ function epublish_admin_node() {
 	$publication = epublish_get_pub($edition->pid);
 
 	$exclusions = _epublish_build_node_exclusions(epublish_get_edition_nodes($eid));
-	$filters[] = array(t('View posts that are new or updated'), "WHERE $exclusions ORDER BY n.changed DESC");
-	$filters[] = array(t('View posts that need approval'), "WHERE ($exclusions) AND (n.status = 0 OR n.moderate = 1) ORDER BY n.changed DESC");
-	$filters[] = array(t('View posts that are promoted'), "WHERE ($exclusions) AND (n.status = 1 AND n.promote = 1) ORDER BY n.changed DESC");
-	$filters[] = array(t('View posts that are not promoted'), "WHERE ($exclusions) AND (n.status = 1 AND n.promote = 0) ORDER BY n.changed DESC");
-	$filters[] = array(t('View posts that are sticky'), "WHERE ($exclusions) AND (n.status = 1 AND n.sticky = 1) ORDER BY n.changed DESC");
-	$filters[] = array(t('View posts that are unpublished'), "WHERE ($exclusions) AND (n.status = 0 AND n.moderate = 0) ORDER BY n.changed DESC");
-
-	// Render filter form:
-	$options = array();
-	foreach ($filters as $key => $value) {
-		$options[] = $value[0];
-	}
-	$form[] = array('#value' => "<div class=\"container-inline\">\n");
-	$form['filter'] = array(
-		'#type' => 'select',
-		'#title' => t('Filter options'),
-		'#default_value' => $filter,
-		'#options' => $options,
-	);
-	$form[] = array(
-		'#type' => 'submit',
-		'#value' => t('Filter'),
-	);
-	$form[] = array('#value' => '</div>');
-	
-	$result = pager_query("SELECT DISTINCT (n.nid), n.title, n.changed, n.type, n.status FROM {node} n ". $filters[$filter][1], 50);
 
+	// use the filtering features of the core node module
+	$filter = node_build_filter_query();
+	$result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' AND (' . $exclusions . ') ORDER BY n.changed DESC', 50, 0, NULL, $filter['args']);	
+	
+	
 	// Make sure the update controls are disabled if we don't have any rows to select from.
 	$disabled = !db_num_rows($result);
 	$form['op'] = array(
@@ -2505,6 +2484,9 @@ function epublish_admin_node() {
 	$form[] = array('#value' => '<h3>' . $filters[$filter][0] . '</h3>');
 	
 	drupal_set_title(t('Add Posts to %pub', array('%pub' => "$publication->name, " . theme('epublish_edition_reference', $edition))));
+	
+	// display the filtering fields
+	$output = node_filter_form();
 	$output .= drupal_get_form('epublish_admin_node', $form);
 	return $output;
 }
@@ -2726,4 +2708,4 @@ function epublish_next($node, $topics) {
 	return NULL;
 }
 
-?>
\ No newline at end of file
+?>
