From 4657e82a947ddd64a52e5b26de9b68e9643ffe88 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Mon, 14 Dec 2009 14:01:46 +0000 Subject: [PATCH] Insert more parameters in manager --- .../lib/Lemonldap/NG/Handler/Simple.pm | 2 +- .../example/skins/default/manager.js | 1 - .../lib/Lemonldap/NG/Manager/Downloader.pm | 41 ++++++--- .../lib/Lemonldap/NG/Manager/_Struct.pm | 85 ++++++++++++++++++- 4 files changed, 110 insertions(+), 19 deletions(-) diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm index b6009d9ee..98ccc94df 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm @@ -805,7 +805,7 @@ sub hideCookie { my $class = shift; $class->lmLog( "$class: removing cookie", 'debug' ); my $tmp = lmHeaderIn( $apacheRequest, 'Cookie' ); - $tmp =~ s/$cookieName[^,;]*[,;]?//o; + $tmp =~ s/$cookieName(?:http)?[^,;]*[,;]?//o; lmSetHeaderIn( $apacheRequest, 'Cookie' => $tmp ); } diff --git a/modules/lemonldap-ng-manager/example/skins/default/manager.js b/modules/lemonldap-ng-manager/example/skins/default/manager.js index 58d78fab9..ef6287eb8 100644 --- a/modules/lemonldap-ng-manager/example/skins/default/manager.js +++ b/modules/lemonldap-ng-manager/example/skins/default/manager.js @@ -68,7 +68,6 @@ function none(id) { } function hashRoot(){ currentId=simpleTreeCollection[0].getSelected().attr('id'); - alert(currentId); display('default','Lemonldap::NG Manager'); $('#newkbr').css('display','block'); } diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Downloader.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Downloader.pm index 67cd5253d..4c27358dd 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Downloader.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Downloader.pm @@ -50,7 +50,8 @@ sub node { # subnode points to a configuration node elsif ( $flag =~ /^n?hash$/ ) { - $res .= $self->confNode( $node, "$flag:$target", $help, $_j ); + $res .= + $self->confNode( $node, "$flag:$target", $help, $_j ); } else { @@ -85,11 +86,13 @@ sub confNode { return unless ($h); foreach ( sort keys %$h ) { if ( ref($h) ) { - $res .= $self->ajaxNode( "$target/$_", $_, "node=$node/$_\&key=$_", - $help, $js, undef, 1 ); + $res .= $self->ajaxNode( "$target/$_", $_, + "node=$node/$_\&key=$_", $help, $js, undef, 1 ); } else { - $res .= $self->confNode( "$target/$_", "btext:$target/$_", $help, $js ); + $res .= + $self->confNode( "$target/$_", "btext:$target/$_", $help, + $js ); } } } @@ -109,7 +112,8 @@ sub confNode { # Here, "notranslate" is set to true : hash values must not be # translated - $res .= $self->li($id) + $res .= + $self->li($id) . $self->span( $id, "$_", $h->{$_}, $js, $help, 1 ) . ""; } } @@ -124,19 +128,27 @@ sub confNode { $h = $self->keyToH( $target, $self->defaultConf ) unless ( defined $h ); unless ( defined $h ) { - $self->lmLog( "$target does not exists in menu hash", "warn" ); - return; + $self->lmLog( "$target does not exists in menu hash", "debug" ); + $h = { + text => '', + hash => {}, + 'int' => 0, + }->{$type}; + $self->lmLog( "Type $type unknown", 'warn' ) unless ( defined $h ); } if ( ref($h) ) { - $res .= $self->li( "$target", "closed" ) + $res .= + $self->li( "$target", "closed" ) . $self->span( "$target", $text, '', $js, $help ) . "