summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2015-08-05 12:27:31 +0200
committerGerrit Uitslag <klapinklapin@gmail.com>2015-08-05 12:27:31 +0200
commita4d6db92b30b08c4a684293a033b04ab84232421 (patch)
tree222e965fa181cda0a6448bd4183204efd76067c7
parentab526dfa3b0d8c74e022312fb4403c774f62ac67 (diff)
parent3131073da5a9b9c69c5b2b4509e985e9e27afe99 (diff)
downloadrpg-a4d6db92b30b08c4a684293a033b04ab84232421.tar.gz
rpg-a4d6db92b30b08c4a684293a033b04ab84232421.tar.bz2
Merge pull request #1279 from splitbrain/tpl_action_get2
TPL_ACTION_UNKNOWN event for building action/button links
-rw-r--r--inc/template.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/inc/template.php b/inc/template.php
index 70d93669d..a1bdc8d64 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_GET', $data);
+ if($evt->advise_before()) {
+ //handle unknown types
+ if($unknown) {
+ $data = '[unknown %s type]';
+ }
+ }
+ $evt->advise_after();
+ unset($evt);
+
+ return $data;
}
/**