function rules_test_rules_action_info

Implements hook_rules_action_info().

File

tests/rules_test.rules.inc, line 120

Code

function rules_test_rules_action_info() {
    $items['rules_test_action'] = array(
        'label' => t('Test action'),
        'group' => t('Rules test'),
    );
    return $items + array(
        'rules_node_publish_action' => array(
            'label' => t('Publish content, but do not save'),
            'parameter' => array(
                'node' => array(
                    'type' => 'node',
                    'label' => t('Content'),
                ),
            ),
            'callbacks' => array(
                'help' => 'rules_test_custom_help',
            ),
            'group' => t('Rules test'),
            'base' => 'node_publish_action',
        ),
        'rules_node_publish_action_save' => array(
            'label' => t('Publish content'),
            'parameter' => array(
                'node' => array(
                    'type' => 'node',
                    'label' => t('Content'),
                    'save' => TRUE,
                ),
            ),
            'group' => t('Rules test'),
            'base' => 'node_publish_action',
        ),
        'rules_node_make_sticky_action' => array(
            'label' => t('Make content sticky'),
            'parameter' => array(
                'node' => array(
                    'type' => 'node',
                    'label' => t('Content'),
                    'save' => TRUE,
                ),
            ),
            'group' => t('Rules test'),
            'base' => 'node_make_sticky_action',
        ),
        // The same action again requiring a 'page' node.
'rules_node_page_make_sticky_action' => array(
            'label' => t('Mage page content sticky'),
            'parameter' => array(
                'node' => array(
                    'type' => 'node',
                    'label' => t('Content'),
                    'save' => TRUE,
                    'bundles' => array(
                        'page',
                    ),
                ),
            ),
            'group' => t('Rules test'),
            'base' => 'node_make_sticky_action',
        ),
        'rules_action_test_reference' => array(
            'label' => t('Change argument passed by reference'),
            'parameter' => array(
                // For references working right, we need a data type with a wrapper.
'arg' => array(
                    'type' => 'test',
                ),
            ),
            'group' => t('Rules test'),
        ),
        'rules_action_load_node' => array(
            'label' => t('Fetch content by id'),
            'parameter' => array(
                'nid' => array(
                    'type' => 'integer',
                    'label' => t('Content ID'),
                ),
                'vid' => array(
                    'type' => 'integer',
                    'label' => t('Content Revision ID'),
                    'description' => t("If you want to fetch a specific revision, specify it's revision id. Else leave it empty to fetch the currently active revision."),
                    'optional' => TRUE,
                ),
            ),
            'provides' => array(
                'node_loaded' => array(
                    'type' => 'node',
                    'label' => t('Loaded content'),
                    'label callback' => 'rules_action_load_node_variable_label',
                ),
            ),
            'group' => t('Node'),
            'access callback' => 'rules_node_integration_access',
        ),
        'rules_action_delete_node' => array(
            'label' => t('Delete content'),
            'parameter' => array(
                'node' => array(
                    'type' => 'node',
                    'label' => t('Content'),
                ),
            ),
            'group' => t('Node'),
            'access callback' => 'rules_node_integration_access',
        ),
        // An action for testing named parameters.
'rules_action_node_set_title' => array(
            'label' => t('Content'),
            'parameter' => array(
                'node' => array(
                    'type' => 'node',
                    'label' => t('Content'),
                ),
                'title' => array(
                    'type' => 'text',
                    'label' => t('Text'),
                ),
            ),
            'named parameter' => TRUE,
            'group' => t('Node'),
            'access callback' => 'rules_node_integration_access',
        ),
        // Tests automatic saving with a non-entity data type.
'test_type_save' => array(
            'base' => 'rules_test_type_save',
            'label' => t('Save test type'),
            'parameter' => array(
                'node' => array(
                    'type' => 'rules_test_type',
                    'label' => t('Test content'),
                    'save' => TRUE,
                ),
            ),
            'group' => t('Node'),
        ),
    );
}