Skip to content
Snippets Groups Projects
Commit 7a1c09e0 authored by Christopher Smith's avatar Christopher Smith
Browse files

Merge pull request #236 from splitbrain/pagetoolsevent

add TEMPLATE_DOKUWIKI_PAGETOOLFLOAT_DISPLAY event to template
parents 301f606f ab3a75dc
No related branches found
No related tags found
No related merge requests found
......@@ -109,16 +109,32 @@ header('X-UA-Compatible: IE=edge,chrome=1');
<h3 class="a11y"><?php echo $lang['page_tools']; ?></h3>
<div class="tools">
<ul>
<?php // View in media manager; @todo: transfer logic to backend
<?php
$data = array();
// View in media manager; @todo: transfer logic to backend
$imgNS = getNS($IMG);
$authNS = auth_quickaclcheck("$imgNS:*");
if (($authNS >= AUTH_UPLOAD) && function_exists('media_managerURL')) {
$mmURL = media_managerURL(array('ns' => $imgNS, 'image' => $IMG));
echo '<li><a href="'.$mmURL.'" class="mediaManager"><span>'.$lang['img_manager'].'</span></a></li>';
$data['mediaManager'] = '<li><a href="'.$mmURL.'" class="mediaManager"><span>'.$lang['img_manager'].'</span></a></li>';
}
?>
<?php // Back to [ID]; @todo: transfer logic to backend
echo '<li><a href="'.wl($ID).'" class="back"><span>'.$lang['img_backto'].' '.$ID.'</span></a></li>';
// Back to [ID]; @todo: transfer logic to backend
$data['img_backto'] = '<li><a href="'.wl($ID).'" class="back"><span>'.$lang['img_backto'].' '.$ID.'</span></a></li>';
// the page tools can be ammended 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['tpl'] here
$hook = 'TEMPLATE_'.strtoupper($conf['tpl']).'_PAGETOOLS_DISPLAY';
$evt = new Doku_Event($hook, $data);
if($evt->advise_before()){
foreach($evt->data as $k => $html) echo $html;
}
$evt->advise_after();
unset($data);
unset($evt);
?>
</ul>
</div>
......
......@@ -75,12 +75,27 @@ $showSidebar = $hasSidebar && ($ACT=='show');
<div class="tools">
<ul>
<?php
tpl_action('edit', 1, 'li', 0, '<span>', '</span>');
tpl_action('revert', 1, 'li', 0, '<span>', '</span>');
tpl_action('revisions', 1, 'li', 0, '<span>', '</span>');
tpl_action('backlink', 1, 'li', 0, '<span>', '</span>');
tpl_action('subscribe', 1, 'li', 0, '<span>', '</span>');
tpl_action('top', 1, 'li', 0, '<span>', '</span>');
$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>')
);
// the page tools can be ammended 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['tpl'] here
$hook = 'TEMPLATE_'.strtoupper($conf['tpl']).'_PAGETOOLS_DISPLAY';
$evt = new Doku_Event($hook, $data);
if($evt->advise_before()){
foreach($evt->data as $k => $html) echo $html;
}
$evt->advise_after();
unset($data);
unset($evt);
?>
</ul>
</div>
......
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