diff options
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.api.php | 2 | ||||
-rw-r--r-- | modules/system/system.module | 50 |
2 files changed, 48 insertions, 4 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 683c7a82c..4342498cb 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -2690,6 +2690,8 @@ function hook_file_mimetype_mapping_alter(&$mapping) { * Modules that are processing actions (like Trigger module) should take * special care for the "presave" hook, in which case a dependent "save" * action should NOT be invoked. + * + * @ingroup actions */ function hook_action_info() { return array( diff --git a/modules/system/system.module b/modules/system/system.module index 5536cc757..18ada5af7 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2859,7 +2859,22 @@ function system_send_email_action_submit($form, $form_state) { } /** - * Implements a configurable Drupal action: sends an email. + * Sends an e-mail message. + * + * @param object $entity + * An optional node object, which will be added as $context['node'] if + * provided. + * @param array $context + * Array with the following elements: + * - 'recipient': E-mail message recipient. This will be passed through + * token_replace(). + * - 'subject': The subject of the message. This will be passed through + * token_replace(). + * - 'message': The message to send. This will be passed through + * token_replace(). + * - Other elements will be used as the data for token replacement. + * + * @ingroup actions */ function system_send_email_action($entity, $context) { if (empty($context['node'])) { @@ -2909,7 +2924,19 @@ function system_message_action_submit($form, $form_state) { } /** - * A configurable Drupal action. Sends a message to the current user's screen. + * Sends a message to the current user's screen. + * + * @param object $entity + * An optional node object, which will be added as $context['node'] if + * provided. + * @param array $context + * Array with the following elements: + * - 'message': The message to send. This will be passed through + * token_replace(). + * - Other elements will be used as the data for token replacement in + * the message. + * + * @ingroup actions */ function system_message_action(&$entity, $context = array()) { if (empty($context['node'])) { @@ -2921,7 +2948,7 @@ function system_message_action(&$entity, $context = array()) { } /** - * Implements a configurable Drupal action: redirect user to a URL. + * Settings form for system_goto_action(). */ function system_goto_action_form($context) { $form['url'] = array( @@ -2940,12 +2967,27 @@ function system_goto_action_submit($form, $form_state) { ); } +/** + * Redirects to a different URL. + * + * @param $entity + * Ignored. + * @param array $context + * Array with the following elements: + * - 'url': URL to redirect to. This will be passed through + * token_replace(). + * - Other elements will be used as the data for token replacement. + * + * @ingroup actions + */ function system_goto_action($entity, $context) { drupal_goto(token_replace($context['url'], $context)); } /** - * Implements a Drupal action: blocks the user's IP address. + * Blocks the current user's IP address. + * + * @ingroup actions */ function system_block_ip_action() { $ip = ip_address(); |