diff options
author | Anika Henke <anika@selfthinker.org> | 2013-11-16 21:18:23 +0000 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2013-11-16 21:28:35 +0000 |
commit | 834ad97fc976d60bd2e57b488a43aca1f39b2277 (patch) | |
tree | 13c049594fafdcd7bbb23a3999dab7ba70ed150c /lib/tpl/dokuwiki/main.php | |
parent | 030141fb5c151649e32dcc286a65102531c96558 (diff) | |
download | rpg-834ad97fc976d60bd2e57b488a43aca1f39b2277.tar.gz rpg-834ad97fc976d60bd2e57b488a43aca1f39b2277.tar.bz2 |
Improved pagetools event in dokuwiki template
This moves the template name away from the hook name into the event data (as
the 'tpl' value). Therefore it moves the previous data items into the 'items' sub array.
A 'view' value has also been added to describe in which template file the
event was called ('main' or 'detail').
This way it will be much easier for plugins to consider default cases and
differentiate between main and other layouts.
Diffstat (limited to 'lib/tpl/dokuwiki/main.php')
-rw-r--r-- | lib/tpl/dokuwiki/main.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/tpl/dokuwiki/main.php b/lib/tpl/dokuwiki/main.php index f6ca4ed86..0dbaa681b 100644 --- a/lib/tpl/dokuwiki/main.php +++ b/lib/tpl/dokuwiki/main.php @@ -75,22 +75,22 @@ $showSidebar = $hasSidebar && ($ACT=='show'); <ul> <?php $data = array( - 'edit' => tpl_action('edit', 1, 'li', 1, '<span>', '</span>'), - 'revert' => tpl_action('revert', 1, 'li', 1, '<span>', '</span>'), - 'revisions' => tpl_action('revisions', 1, 'li', 1, '<span>', '</span>'), - 'backlink' => tpl_action('backlink', 1, 'li', 1, '<span>', '</span>'), - 'subscribe' => tpl_action('subscribe', 1, 'li', 1, '<span>', '</span>'), - 'top' => tpl_action('top', 1, 'li', 1, '<span>', '</span>') + 'tpl' => $conf['template'], + 'view' => 'main', + 'items' => array( + 'edit' => tpl_action('edit', 1, 'li', 1, '<span>', '</span>'), + 'revert' => tpl_action('revert', 1, 'li', 1, '<span>', '</span>'), + 'revisions' => tpl_action('revisions', 1, 'li', 1, '<span>', '</span>'), + 'backlink' => tpl_action('backlink', 1, 'li', 1, '<span>', '</span>'), + 'subscribe' => tpl_action('subscribe', 1, 'li', 1, '<span>', '</span>'), + 'top' => tpl_action('top', 1, 'li', 1, '<span>', '</span>') + ) ); // the page tools can be amended through a custom plugin hook - // if you're deriving from this template and your design is close enough to - // the dokuwiki template you might want to trigger a DOKUWIKI event instead - // of using $conf['template'] here - $hook = 'TEMPLATE_'.strtoupper($conf['template']).'_PAGETOOLS_DISPLAY'; - $evt = new Doku_Event($hook, $data); + $evt = new Doku_Event('TEMPLATE_PAGETOOLS_DISPLAY', $data); if($evt->advise_before()){ - foreach($evt->data as $k => $html) echo $html; + foreach($evt->data['items'] as $k => $html) echo $html; } $evt->advise_after(); unset($data); |