From a00de5b59af578ac2c2a88d06027a06fc0d9ae1d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 17 Aug 2008 22:38:41 +0200 Subject: tpl_actiondropdown added This new template function allows a dropdown menu to be used to access all the DokuWiki do actions with minimal space requirement. darcs-hash:20080817203841-7ad00-f267285a3e9f119c5aaaf73ca276e3a2f1f72a94.gz --- inc/template.php | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ lib/scripts/script.js | 17 +++++++++ 2 files changed, 117 insertions(+) diff --git a/inc/template.php b/inc/template.php index c3cfe21f2..9a874530d 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1157,4 +1157,104 @@ function tpl_mediaTree(){ ptln(''); } + +/** + * Print a dropdown menu with all DokuWiki actions + * + * Note: this will not use any pretty URLs + * + * @author Andreas Gohr + */ +function tpl_actiondropdown($empty='',$button='>'){ + global $ID; + global $INFO; + global $REV; + global $ACT; + global $conf; + global $lang; + global $auth; + + + echo '
'; #FIXME action + echo ''; + if($REV) echo ''; + echo ''; + + echo ''; + echo ''; + echo '
'; +} + //Setup VIM: ex: et ts=4 enc=utf-8 : + diff --git a/lib/scripts/script.js b/lib/scripts/script.js index fd2679f01..8a5770f16 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -501,3 +501,20 @@ function cleanMsgArea(){ } } } + +/** + * Add the event handler to the actiondropdown + * + * @author Andreas Gohr + */ +addInitEvent(function(){ + var selector = $('action__selector'); + if(!selector) return; + + addEvent(selector,'change',function(e){ + this.form.submit(); + }); + + $('action__selectorbtn').style.display = 'none'; +}); + -- cgit v1.2.3