From 1446cf001a20ce9bcc4c65217040aa524c7ff774 Mon Sep 17 00:00:00 2001
From: Pieter Frenssen <pieter@frenssen.be>
Date: Thu, 18 Apr 2013 18:34:40 +0200
Subject: [PATCH] Issue #1966876 by pfrenssen, jonathan1055: Allow to alter the
 list of nodes to be published or unpublished.

---
 scheduler.module | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scheduler.module b/scheduler.module
index e3ff2fc..6b53634 100644
--- a/scheduler.module
+++ b/scheduler.module
@@ -745,6 +745,10 @@ function _scheduler_publish() {
 
   $nids = array_unique(array_merge($nids, _scheduler_scheduler_nid_list('publish')));
 
+  // Allow other modules to alter the node list.
+  $action = 'publish';
+  drupal_alter('scheduler_node_list', $nids, $action);
+
   foreach ($nids as $nid) {
     $n = node_load($nid);
     $n->changed = $n->publish_on;
@@ -820,6 +824,10 @@ function _scheduler_unpublish() {
 
   $nids = array_unique(array_merge($nids, _scheduler_scheduler_nid_list('unpublish')));
 
+  // Allow other modules to alter the node list.
+  $action = 'unpublish';
+  drupal_alter('scheduler_node_list', $nids, $action);
+
   foreach ($nids as $nid) {
     // If this node is to be unpublished, we can update the node and remove the
     // record since it cannot be republished.
-- 
1.8.2.1

