You are here

function protected_node_rules_rules_action_info in Protected Node 7

Same name and namespace in other branches
  1. 6 protected_node_rules.rules.inc \protected_node_rules_rules_action_info()
  2. 1.0.x protected_node_rules/protected_node_rules.rules.inc \protected_node_rules_rules_action_info()

Implements hook_rules_action_info().

File

protected_node_rules/protected_node_rules.rules.inc, line 61
Rules integration for the protected_node module.

Code

function protected_node_rules_rules_action_info() {
  $defaults = array(
    'parameter' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('Content'),
      ),
    ),
    'group' => t('Protected Node'),
  );
  $items['protected_node_rules_action_protect'] = array(
    'label' => t('Protect node'),
  ) + $defaults;
  $items['protected_node_rules_action_password_protect'] = array(
    'parameter' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('Content'),
      ),
      'passwd' => array(
        'type' => 'text',
        'label' => t('Password'),
        'optional' => TRUE,
        'description' => t('Leave empty to set with a new random password.'),
      ),
      'show_title' => array(
        'type' => 'boolean',
        'label' => t('Show title'),
      ),
    ),
    'label' => t('Password protect node'),
  ) + $defaults;
  $items['protected_node_rules_action_unprotect'] = array(
    'label' => t('Unprotect the node'),
  ) + $defaults;
  $items['protected_node_rules_action_lock'] = array(
    'label' => t('Lock the node away from current user'),
  ) + $defaults;
  $items['protected_node_rules_action_unlock'] = array(
    'label' => t('Unlock the node for current user'),
  ) + $defaults;
  return $items;
}