Commit ac7637bc authored by Gábor Hojtsy's avatar Gábor Hojtsy

#172773 by numerous contributors: Make the actions interface usable by mere...

#172773 by numerous contributors: Make the actions interface usable by mere mortals (including rename of actions.module to trigger, but keeping the actions themselfs).

Complete previous history of actions module:
 - #148410 by jvandyk: added rewrite of the actions module!
 - #155986 by Uwe: fixed typos.
 - #155828 by Eaton, pwolanin and jvandyk: let actions live even if actions.module is not turned on
parent f73786d1
......@@ -2144,16 +2144,16 @@ function comment_hook_info() {
'comment' => array(
'comment' => array(
'insert' => array(
'runs when' => t('When a comment has been created'),
'runs when' => t('After saving a new comment'),
),
'update' => array(
'runs when' => t('When a comment has been updated'),
'runs when' => t('After saving an updated comment'),
),
'delete' => array(
'runs when' => t('When a comment has been deleted')
'runs when' => t('After deleting a comment')
),
'view' => array(
'runs when' => t('When a comment is being viewed')
'runs when' => t('When a comment is being viewed by an authenticated user')
),
),
),
......@@ -2170,7 +2170,7 @@ function comment_action_info() {
'type' => 'comment',
'configurable' => FALSE,
'hooks' => array(
'comment' => array('insert', 'update', 'view'),
'comment' => array('insert', 'update'),
)
),
'comment_unpublish_by_keyword_action' => array(
......@@ -2209,7 +2209,7 @@ function comment_unpublish_by_keyword_action_form($context) {
$form['keywords'] = array(
'#title' => t('Keywords'),
'#type' => 'textarea',
'#description' => t('The comment will be unpublished if it contains any of the character sequences above. Use a comma-separated list of character sequences. Example: funny, bungee jumping, "Company, Inc.".'),
'#description' => t('The comment will be unpublished if it contains any of the character sequences above. Use a comma-separated list of character sequences. Example: funny, bungee jumping, "Company, Inc.". Character sequences are case-sensitive.'),
'#default_value' => isset($context['keywords']) ? drupal_implode_tags($context['keywords']) : '',
);
return $form;
......
......@@ -2308,16 +2308,16 @@ function node_hook_info() {
'node' => array(
'nodeapi' => array(
'presave' => array(
'runs when' => t('When content is about to be saved'),
'runs when' => t('When either saving a new post or updating an existing post'),
),
'insert' => array(
'runs when' => t('When content has been created'),
'runs when' => t('After saving a new post'),
),
'update' => array(
'runs when' => t('When content has been updated'),
'runs when' => t('After saving an updated post'),
),
'delete' => array(
'runs when' => t('When content has been deleted')
'runs when' => t('After deleting a post')
),
'view' => array(
'runs when' => t('When content is viewed by an authenticated user')
......@@ -2336,65 +2336,71 @@ function node_action_info() {
'type' => 'node',
'description' => t('Publish post'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
'hooks' => array(
'nodeapi' => array('presave', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'nodeapi' => array('presave'),
'comment' => array('insert', 'update'),
),
),
'node_unpublish_action' => array(
'type' => 'node',
'description' => t('Unpublish post'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
'hooks' => array(
'nodeapi' => array('presave', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'nodeapi' => array('presave'),
'comment' => array('delete', 'insert', 'update'),
),
),
'node_make_sticky_action' => array(
'type' => 'node',
'description' => t('Make post sticky'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
'hooks' => array(
'nodeapi' => array('presave', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'nodeapi' => array('presave'),
'comment' => array('insert', 'update'),
),
),
'node_make_unsticky_action' => array(
'type' => 'node',
'description' => t('Make post unsticky'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
'hooks' => array(
'nodeapi' => array('presave', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'nodeapi' => array('presave'),
'comment' => array('delete', 'insert', 'update'),
),
),
'node_promote_action' => array(
'type' => 'node',
'description' => t('Promote post to front page'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
'hooks' => array(
'nodeapi' => array('presave', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'user' => array('login'),
'nodeapi' => array('presave'),
'comment' => array('insert', 'update'),
),
),
'node_unpromote_action' => array(
'type' => 'node',
'description' => t('Remove post from front page'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
'hooks' => array(
'nodeapi' => array('presave', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'nodeapi' => array('presave'),
'comment' => array('delete', 'insert', 'update'),
),
),
'node_assign_owner_action' => array(
'type' => 'node',
'description' => t('Change the author of a post'),
'configurable' => TRUE,
'behavior' => array('changes_node_property'),
'hooks' => array(
'any' => TRUE,
'nodeapi' => array('presave', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'nodeapi' => array('presave'),
'comment' => array('delete', 'insert', 'update'),
),
),
'node_save_action' => array(
......@@ -2402,9 +2408,7 @@ function node_action_info() {
'description' => t('Save post'),
'configurable' => FALSE,
'hooks' => array(
'nodeapi' => array('delete', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'user' => array('login'),
'comment' => array('delete', 'insert', 'update'),
),
),
'node_unpublish_by_keyword_action' => array(
......@@ -2412,8 +2416,7 @@ function node_action_info() {
'description' => t('Unpublish post containing keyword(s)'),
'configurable' => TRUE,
'hooks' => array(
'nodeapi' => array('presave', 'insert', 'update', 'view'),
'comment' => array('delete', 'insert', 'update', 'view'),
'nodeapi' => array('presave', 'insert', 'update'),
),
),
);
......@@ -2546,7 +2549,7 @@ function node_unpublish_by_keyword_action_form($context) {
$form['keywords'] = array(
'#title' => t('Keywords'),
'#type' => 'textarea',
'#description' => t('The node will be unpublished if it contains any of the character sequences above. Use a comma-separated list of character sequences. Example: funny, bungee jumping, "Company, Inc.".'),
'#description' => t('The node will be unpublished if it contains any of the character sequences above. Use a comma-separated list of character sequences. Example: funny, bungee jumping, "Company, Inc.". Character sequences are case-sensitive.'),
'#default_value' => isset($context['keywords']) ? drupal_implode_tags($context['keywords']) : '',
);
return $form;
......
This diff is collapsed.
......@@ -1149,13 +1149,13 @@ function taxonomy_hook_info() {
'taxonomy' => array(
'taxonomy' => array(
'insert' => array(
'runs when' => t('When a new category has been created'),
'runs when' => t('After saving a new category to the database'),
),
'update' => array(
'runs when' => t('When a category has been updated'),
'runs when' => t('After saving an updated category to the database'),
),
'delete' => array(
'runs when' => t('When a category has been deleted')
'runs when' => t('After deleting a category')
),
),
),
......
; $Id$
name = Actions
description = Enables triggerable Drupal actions.
name = Trigger
description = Enables actions to be fired on certain system events, such as when new content is created.
package = Core - optional
version = VERSION
core = 6.x
......@@ -4,9 +4,9 @@
/**
* Implementation of hook_install().
*/
function actions_install() {
function trigger_install() {
// Create tables.
drupal_install_schema('actions');
drupal_install_schema('trigger');
// Do initial synchronization of actions in code and the database.
actions_synchronize(actions_list());
......@@ -15,7 +15,7 @@ function actions_install() {
/**
* Implementation of hook_uninstall().
*/
function actions_uninstall() {
function trigger_uninstall() {
// Remove tables.
drupal_uninstall_schema('actions');
drupal_uninstall_schema('trigger');
}
<?php
// $Id$
function actions_schema() {
$schema['actions_assignments'] = array(
function trigger_schema() {
$schema['trigger_assignments'] = array(
'fields' => array(
'hook' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
'op' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
......
......@@ -1991,22 +1991,22 @@ function user_hook_info() {
'user' => array(
'user' => array(
'insert' => array(
'runs when' => t('When a user account has been created'),
'runs when' => t('After a user account has been created'),
),
'update' => array(
'runs when' => t('When a user account has been updated'),
'runs when' => t("After a user's profile has been updated"),
),
'delete' => array(
'runs when' => t('When a user account has been deleted')
'runs when' => t('After a user has been deleted')
),
'login' => array(
'runs when' => t('When a user has logged in')
'runs when' => t('After a user has logged in')
),
'logout' => array(
'runs when' => t('When a user has logged out')
'runs when' => t('After a user has logged out')
),
'view' => array(
'runs when' => t("When a user's account information is displayed")
'runs when' => t("When a user's profile is being viewed")
),
),
),
......@@ -2022,21 +2022,13 @@ function user_action_info() {
'description' => t('Block current user'),
'type' => 'user',
'configurable' => FALSE,
'hooks' => array(
'nodeapi' => array('presave', 'delete', 'insert', 'update', 'view'),
'comment' => array('view', 'insert', 'update', 'delete'),
'user' => array('logout'),
),
),
'hooks' => array(),
),
'user_block_ip_action' => array(
'description' => t('Ban IP address of current user'),
'type' => 'user',
'configurable' => FALSE,
'hooks' => array(
'nodeapi' => array('presave', 'delete', 'insert', 'update', 'view'),
'comment' => array('view', 'insert', 'update', 'delete'),
'user' => array('logout'),
)
'hooks' => array(),
),
);
}
......@@ -2073,8 +2065,8 @@ function user_block_ip_action() {
/**
* Submit handler for the user registration form.
*
* This function is shared by the installation form and the normal registration form,
*
* This function is shared by the installation form and the normal registration form,
* which is why it can't be in the user.pages.inc file.
*/
function user_register_submit($form, &$form_state) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment