Commit 7d11dfdf authored by Yadd's avatar Yadd
Browse files

New manager in progress

parent b301a5b5
......@@ -40,6 +40,7 @@ my $template = HTML::Template->new(
cache => 0,
filter => sub { $manager->translate_template(@_) },
);
$template->param(SCRIPT_NAME => $ENV{SCRIPT_NAME});
$template->param(MENU => $manager->menu());
$template->param(DIR => "$skin_dir/$skin");
print $manager->header('text/html; charset=utf-8');
......
......@@ -147,3 +147,12 @@ function delKey(){
$('#'+currentId).prev().remove();
$('#'+currentId).remove();
}
function uploadConf(){
$.post(scriptname,{data: $('#li_cm9vdA2').html()},function(data){
var tmp=lmtext('li_cm9vdA2');
tmp=tmp.replace(/\d+/,data.result.cfgNum);
setlmtext('li_cm9vdA2',tmp);
setlmdata('li_cm9vdA2',data.result.cfgNum);
}
,'json');
}
......@@ -9,9 +9,9 @@
<script src="<TMPL_VAR NAME="DIR">/jquery.js" type="text/JavaScript"></script>
<script src="<TMPL_VAR NAME="DIR">/tree.js" type="text/JavaScript"></script>
<script type="text/JavaScript">//<![CDATA[
var scriptname='/experimental.cgi';var imagepath='<TMPL_VAR NAME="DIR">/';
var scriptname='<TMPL_VAR NAME="SCRIPT_NAME">';var imagepath='<TMPL_VAR NAME="DIR">/';
//]]></script>
<script src="/images//manager.js" type="text/JavaScript"></script>
<script src="<TMPL_VAR NAME="DIR">/manager.js" type="text/JavaScript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
</head>
<body>
......@@ -26,7 +26,7 @@ var scriptname='/experimental.cgi';var imagepath='<TMPL_VAR NAME="DIR">/';
<div style="z-index: 2;overflow:auto;height:500px;" id="haut" class="clsPane">
<h2 id="content_title">Lemonldap::NG Manager</h2>
<div id="buttons">
<button id="bsave" onclick="$.post(scriptname,{data: $('#li_cm9vdA2').html()},function(data){return 1},'html');" >
<button id="bsave" onclick="uploadConf()" >
<lang en="Save" fr="Sauver" />
</button>
<button id="bapply" onclick="$.post(scriptname,{apply:1},function(data){return 1},'html');" >
......
......@@ -129,6 +129,7 @@ sub confUpload {
#print STDERR Dumper( $newConf, \%errors, \%warnings );
close LOG;
$res->{result}->{cfgNum} = $self->confObj->saveConf($newConf);
my $buf = '{';
my $i=0;
while ( my ( $type, $h ) = each %$res ) {
......@@ -139,7 +140,7 @@ sub confUpload {
$i++;
}
$buf .= '}';
print $self->header( -type => 'text/javascript', -Content_Length => length($buf) ).$buf;
print $self->header( -type => 'application/json', -Content_Length => length($buf) ).$buf;
$self->quit();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment