trigger_assign
modules/trigger/trigger.admin.inc, строка 16
- Версии
- 6
trigger_assign($type = NULL)
Build the form that allows users to assign actions to hooks.
Параметры
$type
Name of hook.
Возвращаемое значение
HTML form.
Код
<?php
function trigger_assign($type = NULL) {
// If no type is specified we default to node actions, since they
// are the most common.
if (!isset($type)) {
drupal_goto('admin/build/trigger/node');
}
if ($type == 'node') {
$type = 'nodeapi';
}
$output = '';
$hooks = module_invoke_all('hook_info');
foreach ($hooks as $module => $hook) {
if (isset($hook[$type])) {
foreach ($hook[$type] as $op => $description) {
$form_id = 'trigger_'. $type .'_'. $op .'_assign_form';
$output .= drupal_get_form($form_id, $type, $op, $description['runs when']);
}
}
}
return $output;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии