| 1 |
<?php |
<?php |
| 2 |
// $Id: actions.module,v 1.31 2008/03/17 04:21:38 jvandyk Exp $ |
// $Id: actions.module,v 1.32 2008/04/09 18:19:25 jvandyk Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 1046 |
} |
} |
| 1047 |
|
|
| 1048 |
/** |
/** |
|
* Implementation of hook_action_info(). |
|
|
*/ |
|
|
function system_action_info() { |
|
|
return array( |
|
|
'system_message_action' => array( |
|
|
'type' => 'system', |
|
|
'description' => t('Display a message to the user'), |
|
|
'configurable' => TRUE, |
|
|
'hooks' => array( |
|
|
'nodeapi' => array('view', 'insert', 'update', 'delete'), |
|
|
'comment' => array('view', 'insert', 'update', 'delete'), |
|
|
'user' => array('view', 'insert', 'update', 'delete', 'login'), |
|
|
'taxonomy' => array('insert', 'update', 'delete'), |
|
|
), |
|
|
), |
|
|
'system_send_email_action' => array( |
|
|
'description' => t('Send e-mail'), |
|
|
'type' => 'system', |
|
|
'configurable' => TRUE, |
|
|
'hooks' => array( |
|
|
'nodeapi' => array('view', 'insert', 'update', 'delete'), |
|
|
'comment' => array('view', 'insert', 'update', 'delete'), |
|
|
'user' => array('view', 'insert', 'update', 'delete', 'login'), |
|
|
'taxonomy' => array('insert', 'update', 'delete'), |
|
|
) |
|
|
), |
|
|
'system_goto_action' => array( |
|
|
'description' => t('Redirect to URL'), |
|
|
'type' => 'system', |
|
|
'configurable' => TRUE, |
|
|
'hooks' => array( |
|
|
'nodeapi' => array('view', 'insert', 'update', 'delete'), |
|
|
'comment' => array('view', 'insert', 'update', 'delete'), |
|
|
'user' => array('view', 'insert', 'update', 'delete', 'login'), |
|
|
) |
|
|
) |
|
|
); |
|
|
} |
|
|
|
|
|
/** |
|
| 1049 |
* Return a form definition so the Send email action can be configured. |
* Return a form definition so the Send email action can be configured. |
| 1050 |
* |
* |
| 1051 |
* @see system_send_email_action_validate() |
* @see system_send_email_action_validate() |
| 1296 |
|
|
| 1297 |
/** |
/** |
| 1298 |
* Implementation of hook_action_info(). |
* Implementation of hook_action_info(). |
| 1299 |
* Renamed from node_action_info() to avoid namespace collision with workflow-ng. |
* All core hook_action_info() implementations consolidated here to avoid |
| 1300 |
|
* namespace collisions with workflow-ng. |
| 1301 |
*/ |
*/ |
| 1302 |
function actions_action_info() { |
function actions_action_info() { |
| 1303 |
return array( |
return array( |
| 1388 |
'nodeapi' => array('presave', 'insert', 'update'), |
'nodeapi' => array('presave', 'insert', 'update'), |
| 1389 |
), |
), |
| 1390 |
), |
), |
| 1391 |
|
'system_message_action' => array( |
| 1392 |
|
'type' => 'system', |
| 1393 |
|
'description' => t('Display a message to the user'), |
| 1394 |
|
'configurable' => TRUE, |
| 1395 |
|
'hooks' => array( |
| 1396 |
|
'nodeapi' => array('view', 'insert', 'update', 'delete'), |
| 1397 |
|
'comment' => array('view', 'insert', 'update', 'delete'), |
| 1398 |
|
'user' => array('view', 'insert', 'update', 'delete', 'login'), |
| 1399 |
|
'taxonomy' => array('insert', 'update', 'delete'), |
| 1400 |
|
), |
| 1401 |
|
), |
| 1402 |
|
'system_send_email_action' => array( |
| 1403 |
|
'description' => t('Send e-mail'), |
| 1404 |
|
'type' => 'system', |
| 1405 |
|
'configurable' => TRUE, |
| 1406 |
|
'hooks' => array( |
| 1407 |
|
'nodeapi' => array('view', 'insert', 'update', 'delete'), |
| 1408 |
|
'comment' => array('view', 'insert', 'update', 'delete'), |
| 1409 |
|
'user' => array('view', 'insert', 'update', 'delete', 'login'), |
| 1410 |
|
'taxonomy' => array('insert', 'update', 'delete'), |
| 1411 |
|
) |
| 1412 |
|
), |
| 1413 |
|
'system_goto_action' => array( |
| 1414 |
|
'description' => t('Redirect to URL'), |
| 1415 |
|
'type' => 'system', |
| 1416 |
|
'configurable' => TRUE, |
| 1417 |
|
'hooks' => array( |
| 1418 |
|
'nodeapi' => array('view', 'insert', 'update', 'delete'), |
| 1419 |
|
'comment' => array('view', 'insert', 'update', 'delete'), |
| 1420 |
|
'user' => array('view', 'insert', 'update', 'delete', 'login'), |
| 1421 |
|
) |
| 1422 |
|
), |
| 1423 |
|
'comment_unpublish_action' => array( |
| 1424 |
|
'description' => t('Unpublish comment'), |
| 1425 |
|
'type' => 'comment', |
| 1426 |
|
'configurable' => FALSE, |
| 1427 |
|
'hooks' => array( |
| 1428 |
|
'comment' => array('insert', 'update'), |
| 1429 |
|
) |
| 1430 |
|
), |
| 1431 |
|
'comment_unpublish_by_keyword_action' => array( |
| 1432 |
|
'description' => t('Unpublish comment containing keyword(s)'), |
| 1433 |
|
'type' => 'comment', |
| 1434 |
|
'configurable' => TRUE, |
| 1435 |
|
'hooks' => array( |
| 1436 |
|
'comment' => array('insert', 'update'), |
| 1437 |
|
) |
| 1438 |
|
), |
| 1439 |
|
'user_block_user_action' => array( |
| 1440 |
|
'description' => t('Block current user'), |
| 1441 |
|
'type' => 'user', |
| 1442 |
|
'configurable' => FALSE, |
| 1443 |
|
'hooks' => array(), |
| 1444 |
|
), |
| 1445 |
|
'user_block_ip_action' => array( |
| 1446 |
|
'description' => t('Ban IP address of current user'), |
| 1447 |
|
'type' => 'user', |
| 1448 |
|
'configurable' => FALSE, |
| 1449 |
|
'hooks' => array(), |
| 1450 |
|
), |
| 1451 |
); |
); |
| 1452 |
} |
} |
| 1453 |
|
|
| 1632 |
} |
} |
| 1633 |
|
|
| 1634 |
/** |
/** |
|
* Implementation of hook_action_info(). |
|
|
*/ |
|
|
function comment_action_info() { |
|
|
return array( |
|
|
'comment_unpublish_action' => array( |
|
|
'description' => t('Unpublish comment'), |
|
|
'type' => 'comment', |
|
|
'configurable' => FALSE, |
|
|
'hooks' => array( |
|
|
'comment' => array('insert', 'update'), |
|
|
) |
|
|
), |
|
|
'comment_unpublish_by_keyword_action' => array( |
|
|
'description' => t('Unpublish comment containing keyword(s)'), |
|
|
'type' => 'comment', |
|
|
'configurable' => TRUE, |
|
|
'hooks' => array( |
|
|
'comment' => array('insert', 'update'), |
|
|
) |
|
|
) |
|
|
); |
|
|
} |
|
|
|
|
|
/** |
|
| 1635 |
* Drupal action to unpublish a comment. |
* Drupal action to unpublish a comment. |
| 1636 |
* |
* |
| 1637 |
* @param $context |
* @param $context |
| 1726 |
} |
} |
| 1727 |
|
|
| 1728 |
/** |
/** |
|
* Implementation of hook_action_info(). |
|
|
*/ |
|
|
function user_action_info() { |
|
|
return array( |
|
|
'user_block_user_action' => array( |
|
|
'description' => t('Block current user'), |
|
|
'type' => 'user', |
|
|
'configurable' => FALSE, |
|
|
'hooks' => array(), |
|
|
), |
|
|
'user_block_ip_action' => array( |
|
|
'description' => t('Ban IP address of current user'), |
|
|
'type' => 'user', |
|
|
'configurable' => FALSE, |
|
|
'hooks' => array(), |
|
|
), |
|
|
); |
|
|
} |
|
|
|
|
|
/** |
|
| 1729 |
* Implementation of a Drupal action. |
* Implementation of a Drupal action. |
| 1730 |
* Blocks the current user. |
* Blocks the current user. |
| 1731 |
*/ |
*/ |