Skip to content
Snippets Groups Projects
Commit a4d6db92 authored by Gerrit Uitslag's avatar Gerrit Uitslag
Browse files

Merge pull request #1279 from splitbrain/tpl_action_get2

TPL_ACTION_UNKNOWN event for building action/button links
parents ab526dfa 3131073d
No related branches found
No related tags found
No related merge requests found
......@@ -647,6 +647,8 @@ function tpl_get_action($type) {
$params = array('do' => $type);
$nofollow = true;
$replacement = '';
$unknown = false;
switch($type) {
case 'edit':
// most complicated type - we need to decide on current action
......@@ -771,9 +773,23 @@ function tpl_get_action($type) {
//$type = 'media';
break;
default:
return '[unknown %s type]';
//unknown type
$unknown = true;
}
return compact('accesskey', 'type', 'id', 'method', 'params', 'nofollow', 'replacement');
$data = compact('accesskey', 'type', 'id', 'method', 'params', 'nofollow', 'replacement');
$evt = new Doku_Event('TPL_ACTION_GET', $data);
if($evt->advise_before()) {
//handle unknown types
if($unknown) {
$data = '[unknown %s type]';
}
}
$evt->advise_after();
unset($evt);
return $data;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment