| 1 |
<?php |
<?php |
| 2 |
// $Id: actions.module,v 1.38 2008/04/29 20:00:33 jvandyk Exp $ |
// $Id: actions.module,v 1.39 2008/05/05 15:08:38 jvandyk Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 46 |
*/ |
*/ |
| 47 |
function actions_menu($may_cache) { |
function actions_menu($may_cache) { |
| 48 |
$items = array(); |
$items = array(); |
| 49 |
$access = user_access('administer_actions'); |
$access = user_access('administer actions'); |
| 50 |
|
|
| 51 |
if ($may_cache) { |
if ($may_cache) { |
| 52 |
$items[] = array( |
$items[] = array( |
| 175 |
* Implementation of hook_perm(). |
* Implementation of hook_perm(). |
| 176 |
*/ |
*/ |
| 177 |
function actions_perm() { |
function actions_perm() { |
| 178 |
return array('administer_actions'); |
return array('administer actions'); |
| 179 |
} |
} |
| 180 |
|
|
| 181 |
/** |
/** |
| 206 |
} |
} |
| 207 |
|
|
| 208 |
$row = array(); |
$row = array(); |
| 209 |
$instances_present = db_fetch_object(db_query("SELECT aid FROM {actions} WHERE parameters != ''")); |
$instances_present = db_fetch_object(db_query("SELECT aid FROM {actions} WHERE parameters <> ''")); |
| 210 |
$header = array( |
$header = array( |
| 211 |
array('data' => t('Action type'), 'field' => 'type'), |
array('data' => t('Action type'), 'field' => 'type'), |
| 212 |
array('data' => t('Description'), 'field' => 'description'), |
array('data' => t('Description'), 'field' => 'description'), |
| 512 |
'#value' => $aid, |
'#value' => $aid, |
| 513 |
); |
); |
| 514 |
|
|
| 515 |
$action = db_result(db_query("SELECT aid FROM {actions} WHERE MD5(aid) = '%s' AND parameters != ''", $aid)); |
$action = db_result(db_query("SELECT aid FROM {actions} WHERE MD5(aid) = '%s' AND parameters <> ''", $aid)); |
| 516 |
$actions = actions_get_all_actions(); |
$actions = actions_get_all_actions(); |
| 517 |
|
|
| 518 |
$destination = 'admin/build/trigger/'. ($hook == 'nodeapi' ? 'node' : $hook); |
$destination = 'admin/build/trigger/'. ($hook == 'nodeapi' ? 'node' : $hook); |
| 1278 |
break; |
break; |
| 1279 |
default: |
default: |
| 1280 |
// Check context for node. |
// Check context for node. |
| 1281 |
if (!isset($object) && isset($context['node'])) { |
if (!isset($object) && isset($context['node'])) { |
| 1282 |
$node = $context['node']; |
$node = $context['node']; |
| 1283 |
} |
} |
| 1284 |
else { |
else { |