function scheduler_rules_action_info in Scheduler 7
Implements hook_rules_action_info().
File
- ./
scheduler.rules.inc, line 77 - Scheduler rules functions.
Code
function scheduler_rules_action_info() {
// These actions can be added when building a reaction rule. Use a $defaults
// array to avoid duplication.
$defaults = array(
'parameter' => array(
'node' => array(
'type' => 'node',
// 'label' is shown as fieldset title after adding action.
'label' => t('The node to be processed by Scheduler'),
// 'description' is shown beneath the label during add/edit.
'description' => t('This can be a node object or node id'),
),
),
'group' => t('Scheduler'),
);
// 1. Action to set the publishing date.
$actions['scheduler_set_publish_date_action'] = array(
'label' => t('Set publishing date'),
) + $defaults;
$actions['scheduler_set_publish_date_action']['parameter']['date'] = array(
'type' => 'date',
'label' => t('The date for publishing'),
'description' => t('The date when Scheduler will publish the node'),
);
// 2. Action to set the unpublishing date.
$actions['scheduler_set_unpublish_date_action'] = array(
'label' => t('Set unpublishing date'),
) + $defaults;
$actions['scheduler_set_unpublish_date_action']['parameter']['date'] = array(
'type' => 'date',
'label' => t('The date for unpublishing'),
'description' => t('The date when Scheduler will unpublish the node'),
);
// 3. Action to remove the publishing date.
$actions['scheduler_remove_publish_date_action'] = array(
'label' => t('Remove publishing date'),
) + $defaults;
// 4. Action to remove the unpublishing date.
$actions['scheduler_remove_unpublish_date_action'] = array(
'label' => t('Remove unpublishing date'),
) + $defaults;
return $actions;
}