You are here

function scheduler_rules_condition_info in Scheduler 7

Implements hook_rules_condition_info().

File

./scheduler.rules.inc, line 201
Scheduler rules functions.

Code

function scheduler_rules_condition_info() {

  // Create a default, as most of the values are identical for all conditions.
  $default = array(
    'group' => t('Scheduler'),
    'parameter' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('The node to test for scheduling properties'),
        'description' => t('This can be a node object or node id'),
      ),
    ),
  );

  // 1. Condition to check if publishing is enabled for the content type.
  $conditions['scheduler_condition_publishing_is_enabled'] = array(
    'label' => t('Scheduled publishing is enabled for this content type'),
  ) + $default;

  // 2. Condition to check if unpublishing is enabled for the content type.
  $conditions['scheduler_condition_unpublishing_is_enabled'] = array(
    'label' => t('Scheduled unpublishing is enabled for this content type'),
  ) + $default;

  // 3. Condition to check if the node is scheduled for publishing.
  $conditions['scheduler_condition_node_is_scheduled_for_publishing'] = array(
    'label' => t('The node is scheduled for publishing'),
  ) + $default;

  // 4. Condition to check if the node is scheduled for unpublishing.
  $conditions['scheduler_condition_node_is_scheduled_for_unpublishing'] = array(
    'label' => t('The node is scheduled for unpublishing'),
  ) + $default;
  return $conditions;
}