Add a brand new theme to the Manager

This commit is contained in:
Clément Oudot 2008-05-05 17:04:33 +00:00
parent 83dce88170
commit 7b468221c3
7 changed files with 97 additions and 6 deletions

View File

@ -10,6 +10,7 @@ my $h = new Lemonldap::NG::Manager(
},
dhtmlXTreeImageLocation => "/imgs/",
applyConfFile => '__DIR__/manager/apply.conf',
cssFile => 'theme/default.css',
# jsFile => /path/to/lemonldap-ng-manager.js,
}

View File

@ -0,0 +1,67 @@
/* CSS for LemonLDAP::NG Manager */
body {
font-family: Arial, Helvetica, Verdana;
margin: 0;
padding: 0;
}
#gauche {
background: #dfdfdf url(hatch.gif);
}
#haut {
background: #eee;
}
#bas {
background: #ccc url(hatch.gif);
}
#treeBox {
background: url(logo_lemonldap-ng.png) no-repeat center 5px;
padding: 50px 0 0 0;
font-weight: bold;
}
#buttons {
margin: 20px 40px;
padding: 5px;
background: #fff;
border: 1px #ccc dashed;
}
#formulaire {
margin: 20px 40px;
}
input, textarea {
border: 1px #ccc solid;
padding: 3px;
}
table {
border-collapse: collapse;
}
#formulaire th {
background: #ddd url(hatch.gif);
}
#formulaire td {
padding: 5px;
text-align: center;
}
h1, h2, h3, h4, h5, h6, dt {
color: #d9b500;
font-weight: bold;
}
pre, code {
font: 10pt monospace;
border-left: 5px gray solid;
padding: 5px;
margin: 0 10px;
background: #ccc;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -37,6 +37,7 @@ sub new {
unless ( -r $self->{jsFile} ) {
print STDERR qq#Unable to read $self->{jsFile}. You have to set "jsFile" parameter to /path/to/lemonldap-ng-manager.js\n#;
}
$self->{pageTitle} ||= "LemonLDAP::NG Administration";
unless ( __PACKAGE__->can('ldapServer') ) {
Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} );
}
@ -62,7 +63,17 @@ sub doall {
# When using header_public here, Firefox does not load configuration
# sometimes. Where is the bug ?
print $self->header;
print $self->start_html;
# Test if we have to use specific CSS
if ( defined $self->{cssFile} ) {
print $self->start_html(
-style => $self->{cssFile},
-title => $self->{pageTitle},
)
} else {
print $self->start_html(
-title => $self->{pageTitle},
)
}
print $self->main;
print $self->end_html;
}

View File

@ -409,13 +409,21 @@ sub start_html {
my %args = @_;
$args{'-style'} = { -src => [ $args{'-style'} ] }
if ( $args{'-style'} and !ref( $args{'-style'} ) );
push @{ $args{'-style'}->{'-src'} }, "$ENV{SCRIPT_NAME}?lmQuery=css";
unshift @{ $args{'-style'}->{'-src'} }, "$ENV{SCRIPT_NAME}?lmQuery=css";
$args{'-title'} ||= 'Lemonldap::NG Configuration';
$self->CGI::start_html(%args);
}
sub main {
Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} );
my %text;
foreach(qw(field value)) {
$text{$_} = &{"txt_$_"};
$text{$_} =~s/'/\\'/g;
}
# Lemonldap::Manager javascripts;
print
qq#<script type="text/javascript" src="$ENV{SCRIPT_NAME}?lmQuery=libjs"></script>\n#;
@ -440,8 +448,8 @@ qq#<script type="text/javascript" src="$ENV{SCRIPT_NAME}?lmQuery=lmjs"></script>
<p></p>
<table border="1" width="100%" style="empty-cells:show;">
<tr>
<th width="200">Champ</th>
<th width="400">Valeur</th>
<th width="200">$text{field}</th>
<th width="400">$text{value}</th>
</tr>
<tr>
<td>

View File

@ -57,6 +57,7 @@ sub en {
domain => "Domain",
error => "Error",
exportedVars => "Exported Variables",
field => "Field",
generalParameters => "General Parameters",
globalStorageOptions => "Session Storage Parameters",
group => "Group",
@ -106,6 +107,7 @@ sub en {
unknownError => "Unknown error",
unknownErrorInVars => "Unknown error in exported attributes",
userGroups => "User Groups",
value => "Value",
virtualHosts => "Virtual Hosts",
waitingResult => "Waiting result...",
warningConfNotApplied => "You have to reload handlers to take the saved configuration in account",
@ -138,13 +140,14 @@ sub fr {
domain => "Domaine",
error => "Erreur",
exportedVars => "Attributs LDAP &agrave; exporter",
field => "Champ",
generalParameters => "Param&egrave;tres g&eacute;n&eacute;raux",
globalStorageOptions => "Param&egrave;tres du module Apache::Session",
group => "Groupe",
header => "En-t&ecirc;te",
httpHeaders => "En-t&ecirc;tes HTTP",
invalidLine => "Ligne invalide",
invalidVirtualHostName => "Nom de d'hôte virtuel incorrect",
invalidVirtualHostName => "Nom de d'h&ocirc;te virtuel incorrect",
invalidWhatToTrace => "La donn&eacute;e &agrave; inscrire dans les journaux ne peut contenir qu'un attribut export&eacute; ou une macro",
isNotANumber => "n'est pas un nombre",
isNotAValidAttributeName => "n'est pas un nom d'attribut valide",
@ -171,7 +174,7 @@ sub fr {
newMacro => "Nouvelle macro",
newRule => "Nouvelle r&egrave;gle",
newVar => "Nouvelle variable",
newVirtualHost => "Nouvel hote virtuel",
newVirtualHost => "Nouvel h&ocirc;te virtuel",
nextConf => "Suivante",
prevConf => "Pr&eacute;c&eacute;dente",
result => "R&eacute;sultat",
@ -187,6 +190,7 @@ sub fr {
unknownError => "Erreur inconnue",
unknownErrorInVars => "Erreur inconnue dans les attributs export&eacute;s",
userGroups => "Groupes d'utilisateurs",
value => "Valeur",
virtualHosts => "H&ocirc;tes virtuels",
waitingResult => "En attente...",
warningConfNotApplied => "Vous devez recharger les agents pour que la configuration sauvegard&eacute;e soit appliqu&eacute;e",