Index: scheduler.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/scheduler/Attic/scheduler.install,v retrieving revision 1.4 diff -u -p -r1.4 scheduler.install --- scheduler.install 26 Jul 2006 05:49:58 -0000 1.4 +++ scheduler.install 20 Mar 2008 20:45:34 -0000 @@ -26,6 +26,15 @@ function scheduler_install() { } } +/** + * Implementation of hook_uninstall(). + */ +function schedules_uninstall() { + if (function_exists('actions_synchronize')) { + actions_synchronize(); + } +} + function scheduler_update_1() { return _system_update_utf8(array('scheduler')); } @@ -47,3 +56,10 @@ function scheduler_update_2() { return $ret; } + +function scheduler_update_3() { + if (function_exists('actions_synchronize')) { + actions_synchronize(); + } + return array(); +} Index: scheduler.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/scheduler/Attic/scheduler.module,v retrieving revision 1.46.4.21 diff -u -p -r1.46.4.21 scheduler.module --- scheduler.module 11 Mar 2008 13:06:39 -0000 1.46.4.21 +++ scheduler.module 20 Mar 2008 20:45:35 -0000 @@ -363,3 +363,92 @@ function scheduler_views_tables() { return $tables; } +/** + * Implementation of a Drupal action. + * Sets the status of a node to 1, meaning published, unless + * the node has publish/unpublish data set by the Scheduler + * module. + */ +function action_scheduler_publish_unless_scheduled($op, $edit = array(), &$node) { + switch($op) { + case 'do': + if (empty($node->scheduler['publish_on'])) { + $node->status = '1'; + $node->revision = '0'; + if (!$edit['defer']) { + node_save($node); + } + watchdog('action', t('Set node id %id to Published', array('%id' => intval($node->nid)))); + } + else { + watchdog('action', t('Deferred publication of node id %id to the Scheduler module', array('%id' => intval($node->nid)))); + } + break; + + case 'metadata': + return array( + 'description' => t('Publish node unless Scheduled'), + 'type' => t('Node'), + 'batchable' => true, + 'configurable' => false, + ); + + // return an HTML config form for the action + case 'form': + return ''; + + // validate the HTML form + case 'validate': + return TRUE; + + // process the HTML form to store configuration + case 'submit': + return ''; + } +} + +/** + * Implementation of a Drupal action. + * Sets the status of a node to 0, meaning unpublished, unless + * the node has publish/unpublish data set by the Scheduler + * module. + * + */ +function action_scheduler_unpublish_unless_scheduled($op, $edit = array(), &$node) { + switch($op) { + case 'metadata': + return array( + 'description' => t('Unpublish node unless Scheduled'), + 'type' => t('Node'), + 'batchable' => true, + 'configurable' => false, + ); + + case 'do': + if (empty($node->scheduler['unpublish_on'])) { + $node->status = '0'; + $node->revision = '0'; + if (!array_key_exists('defer', $edit)) { + node_save($node); + } + watchdog('action', t('Set node id %id to Unpublished', array('%id' => intval($node->nid)))); + } + else { + watchdog('action', t('Deferred unpublication of node id %id to the Scheduler module', array('%id' => intval($node->nid)))); + } + break; + + // return an HTML config form for the action + case 'form': + return ''; + + // validate the HTML form + case 'validate': + return TRUE; + + // process the HTML form to store configuration + case 'submit': + return ''; + } +} +