diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2015-08-01 02:20:13 +0200 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2015-08-01 02:20:13 +0200 |
commit | 7b4365a732a993fcabe66b9ff4b4c85afb5ae367 (patch) | |
tree | 035848e73f9a59e4273683968c562dfdb084adf4 /inc | |
parent | 66ff014ab579963895d7c103592a980c35b5845f (diff) | |
download | rpg-7b4365a732a993fcabe66b9ff4b4c85afb5ae367.tar.gz rpg-7b4365a732a993fcabe66b9ff4b4c85afb5ae367.tar.bz2 |
TPL_ACTION_UNKNOWN event for building action/button links
Diffstat (limited to 'inc')
-rw-r--r-- | inc/template.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/inc/template.php b/inc/template.php index f918d1a04..5508233ae 100644 --- a/inc/template.php +++ b/inc/template.php @@ -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_UNKNOWN', $data); + if($evt->advise_before()) { + //handle unknown types + if($unknown) { + $data = '[unknown %s type]'.$type; + } + } + $evt->advise_after(); + unset($evt); + + return $data; } /** |