summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-12-18 22:31:06 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-12-18 22:31:06 +0000
commit714d09b1c3ab71f08c43703cb380e89eaeccdf57 (patch)
tree3937b27f3a4138a0fa8292a92826da19b8e43e6f /plugins
parent72367be6ffdbdbfd642ebf9b244c35984bef2990 (diff)
downloadnexus-714d09b1c3ab71f08c43703cb380e89eaeccdf57.tar.gz
nexus-714d09b1c3ab71f08c43703cb380e89eaeccdf57.tar.bz2
nexus-714d09b1c3ab71f08c43703cb380e89eaeccdf57.zip
merge recent changes into HEAD
Diffstat (limited to 'plugins')
-rw-r--r--plugins/menu.tikiwiki.php29
1 files changed, 19 insertions, 10 deletions
diff --git a/plugins/menu.tikiwiki.php b/plugins/menu.tikiwiki.php
index f2c22ce..6de2f4e 100644
--- a/plugins/menu.tikiwiki.php
+++ b/plugins/menu.tikiwiki.php
@@ -4,7 +4,7 @@
*
* @abstract creates a javascript expandable menu
* @author xing@synapse.plus.com
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
* @package nexus
* @subpackage plugins
*/
@@ -55,15 +55,7 @@ function writeTikiWikiCache( $pMenuHash ) {
$type = $pMenuHash->mInfo['type'];
foreach( $pMenuHash->mInfo['tree'] as $key => $item ) {
if( $item['first'] ) {
- $togid = 'togid'.$item['item_id'];
- $data .= '<div id="'.$togid.'" ';
- $data .= 'style="display:{if $smarty.cookies.'.$togid.' eq \'c\'}none{elseif $smarty.cookies.'.$togid.' eq \'o\'}block{else}';
- if( $key != 0 && preg_match( "/c$/", $type ) ) {
- $data .= 'none';
- } else {
- $data .= 'block';
- }
- $data .= '{/if};">';
+ $data .= '<div id="togid'.$item['item_id'].'">';
} else {
// close permission clauses
if( $perm_cycle ) {
@@ -105,6 +97,23 @@ function writeTikiWikiCache( $pMenuHash ) {
}
}
$data .= '</div><!-- end .menu -->';
+
+ // apply state of expandable menus
+ $data .= '<script type="text/javascript">';
+ foreach( $pMenuHash->mInfo['tree'] as $key => $item ) {
+ if( $item['first'] ) {
+ $togid = 'togid'.$item['item_id'];
+ $data .= '$(\''.$togid.'\').style.display = \'{if $smarty.cookies.'.$togid.' eq \'c\'}none{elseif $smarty.cookies.'.$togid.' eq \'o\'}block{else}';
+ if( $key != 0 && preg_match( "/c$/", $type ) ) {
+ $data .= 'none';
+ } else {
+ $data .= 'block';
+ }
+ $data .= '{/if}\';';
+ }
+ }
+ $data .= '</script>';
+
$data .= '{/bitmodule}';
$ret[$menu_file] = $data;
return $ret;