function rb_thinktwice_rules_action_info in Rules Bonus Pack 7
Implements hook_rules_action_info().
File
- ./
rb_thinktwice.rules.inc, line 10 - Rules actions that you should think twice about. Plus some helper functions.
Code
function rb_thinktwice_rules_action_info() {
// Add actions that depend on required modules only.
$actions = array(
'rb_thinktwice_action_enable_module' => array(
'label' => t('Enable a module'),
'access' => 'administer modules',
'parameter' => array(
'module' => array(
'type' => 'text',
'options list' => 'rb_thinktwice_action_module_list',
'label' => t('Module'),
'description' => t('Choose which module to enable. Automating module
enabling may crash your site. Use at own risk.'),
'restriction' => 'input',
),
),
'help' => t('This is help text.'),
'group' => t('Rules Bonus: Think twice'),
),
'rb_thinktwice_action_disable_module' => array(
'label' => t('Disable a module'),
'access' => 'administer modules',
'parameter' => array(
'module' => array(
'type' => 'text',
'options list' => 'rb_thinktwice_action_module_list',
'label' => t('Module'),
'description' => t('Choose which module to disable. Automating module
disabling may crash your site. Use at own risk.'),
'restriction' => 'input',
),
),
'group' => t('Rules Bonus: Think twice'),
),
'rb_thinktwice_action_page_alter' => array(
'label' => t('Modify $page'),
'access' => 'administer site configuration',
'parameter' => array(
'property' => array(
'label' => t('Property to modify'),
'type' => 'text',
'description' => t('Available values are Drupal render array key
names, separated by a colon. For example: to modify
<code>$page[\'footer\'][\'system_powered-by\'][\'#markup\']</code>,
use <code>footer:system_powered-by:#markup</code>.'),
'restriction' => 'input',
),
'value' => array(
'label' => t('Value to set'),
'type' => 'text',
'description' => t('Available values are any literal string, an
integer, and true or false.'),
'restriction' => 'input',
),
),
'group' => t('Rules Bonus: Think twice'),
),
);
return $actions;
}