Configure application list in Manager - work in progress (#29)

This commit is contained in:
Clément Oudot 2010-09-20 15:23:03 +00:00
parent ff58e89b0a
commit 68420c6e42
5 changed files with 91 additions and 6 deletions

View File

@ -102,7 +102,7 @@ sub unserialize {
# Manage hashes
if ( $k =~
/^(?:exportedVars|locationRules|groups|exportedHeaders|macros|globalStorageOptions|remoteGlobalStorageOptions|notificationStorageOptions|samlIDPMetaDataXML|samlIDPMetaDataExportedAttributes|samlIDPMetaDataOptions|samlSPMetaDataXML|samlSPMetaDataExportedAttributes|samlSPMetaDataOptions|samlStorageOptions|CAS_proxiedServices|logoutServices|authChoiceModules)$/
/^(?:exportedVars|locationRules|groups|exportedHeaders|macros|globalStorageOptions|remoteGlobalStorageOptions|notificationStorageOptions|samlIDPMetaDataXML|samlIDPMetaDataExportedAttributes|samlIDPMetaDataOptions|samlSPMetaDataXML|samlSPMetaDataExportedAttributes|samlSPMetaDataOptions|samlStorageOptions|CAS_proxiedServices|logoutServices|authChoiceModules|applicationList)$/
and $v ||= {}
and not ref($v) )
{

View File

@ -286,6 +286,8 @@ function display(div,title) {
$('#newsamlattributeb,#delsamlattributeb').hide();
$('#newsamlattributebr').hide();
$('#newchoicer,#newchoice,#delchoice').hide();
$('#newcategoryr,#delcategory').hide();
$('#newapplicationr,#delapplication').hide();
var height_cur=$('#buttons').height()+$('#edition').height()+$('#help').height();
var height_max=$('#menu').height();
if(height_cur > height_max || $('#help_content').is(':visible')==false){
@ -1008,3 +1010,32 @@ function setlmauthchoice(id){
setlmdata(id,auth+'|'+user+'|'+password);
}
/* Application list */
function applicationListCategoryRoot(id){
currentId=id;
display('default','');
$('#newcategoryr').show();
}
function newCategoryR(){
var name = prompt(text4newCategory,'mycategory');
if(!name){return false;}
var newIdValue=newId(currentId);
simpleTreeCollection[0].addNode(newIdValue,name,function(d,s){
$('>span',s).attr('onClick','applicationListCategory("'+newIdValue+'")').attr('name',name).attr('value','My Category').attr('id','text_'+newIdValue);
applicationListCategory(newIdValue);
});
return false;
}
function delCategory(){
delKey();
}
function applicationListCategory(id){
currentId=id;
$('#applicationListCategoryKey').attr('value',lmtext(id));
$('#applicationListCategoryName').attr('value',lmdata(id));
display('applicationListCategory',lmtext(id));
$('#delcategory,#newapplicationr').show();
}

View File

@ -31,6 +31,8 @@
var text4newGeneratedFile='<lang en="Password (optional)" fr="Mot de passe (optionnel)" />';
var text4edit='<lang en="Edit" fr="Éditer" />';
var text4protect='<lang en="Protect" fr="Protéger" />';
var text4newCategory='<lang en="Category identifier" fr="Identifiant de la catégorie" />';
var text4newApplication='<lang en="Application identifier" fr="Identifiant de l\'application" />';
//]]></script>
<script src="<TMPL_VAR NAME="DIR">/manager.js" type="text/JavaScript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
@ -147,6 +149,23 @@
<lang en="Delete choice" fr="Supprimer le choix" />
</button>
<button id="newcategoryr" style="display:none;" onclick="newCategoryR();return false;" class="ui-state-default ui-corner-all">
<lang en="New category" fr="Nouvelle catégorie" />
</button>
<button id="delcategory" style="display:none;" onclick="delCategory();return false;" class="ui-state-default ui-corner-all">
<lang en="Delete category" fr="Supprimer la catégorie" />
</button>
<button id="newapplicationr" style="display:none;" onclick="newApplicationR();return false;" class="ui-state-default ui-corner-all">
<lang en="New application" fr="Nouvelle application" />
</button>
<button id="delapplication" style="display:none;" onclick="delApplication();return false;" class="ui-state-default ui-corner-all">
<lang en="Delete application" fr="Supprimer l'application" />
</button>
</div>
<!-- Buttons -->
@ -447,6 +466,24 @@
</button>
</div>
<!-- applicationList -->
<div id="content_applicationListCategory" class="hidden">
<table>
<tr>
<td><lang en="Key" fr="Nom de la clef"/></td>
<td><input type="text" id="applicationListCategoryKey" /></td>
</tr>
<tr>
<td><lang en="Display name" fr="Nom à afficher"/></td>
<td><input type="text" id="applicationListCategoryName" /></td>
</tr>
</table>
<br />
<button onclick="setlminputtext(currentId,'#applicationListCategoryKey');setlminputdata(currentId,'#applicationListCategoryName');return false;" class="ui-state-default ui-corner-all">
<lang en="Apply" fr="Appliquer" />
</button>
</div>
</div>
</form>

View File

@ -232,29 +232,38 @@ sub struct {
# PORTAL PARAMETERS
portalParams => {
_nodes => [qw(portal n:portalModules n:portalCustomization)],
_nodes => [qw(portal n:portalMenu n:portalCustomization)],
_help => 'portalParams',
portal => 'text:/portal:portal:text',
portalMenu => {
_nodes => [qw(portalModules cn:applicationList)],
portalModules => {
_nodes => [
qw(portalDisplayLogout portalDisplayResetPassword portalDisplayChangePassword portalDisplayAppslist)
],
portalDisplayLogout => 'text:/portalDisplayLogout',
portalDisplayResetPassword =>
'bool:/portalDisplayResetPassword',
portalDisplayChangePassword =>
'text:/portalDisplayChangePassword',
portalDisplayAppslist => 'text:/portalDisplayAppslist',
},
applicationList => {
_nodes => [
'hash:/applicationList:default:applicationListCategory'
],
_js => 'applicationListCategoryRoot',
},
},
portalCustomization => {
_nodes => [
qw(portalSkin portalAutocomplete portalRequireOldPassword portalUserAttr portalOpenLinkInNewWindow)
qw(portalSkin portalDisplayResetPassword portalAutocomplete portalRequireOldPassword portalUserAttr portalOpenLinkInNewWindow)
],
portalSkin => 'text:/portalSkin:portalParams:skinSelect',
portalDisplayResetPassword =>
'bool:/portalDisplayResetPassword',
portalAutocomplete => 'bool:/portalAutocomplete',
portalRequireOldPassword =>
'bool:/portalRequireOldPassword',
@ -1048,6 +1057,10 @@ sub testStruct {
my $testNotDefined = { test => sub { 1 }, msgFail => 'Ok' };
return {
applicationList => {
keyTest => qr/^(\d*)?\w+$/,
keyMsgFail => 'Bad category ID',
},
mailFrom => $testNotDefined,
trustedDomains => $testNotDefined,
exportedAttr => $testNotDefined,

View File

@ -66,6 +66,7 @@ sub en {
advancedParams => 'Advanced parameters',
apacheParams => 'Apache parameters',
apacheAuthnLevel => 'Authentication level',
applicationList => 'Categories and applications',
attributesAndMacros => 'Attributes and macros',
authChoiceModules => 'Allowed modules',
authChoiceParam => 'URL parameter',
@ -206,7 +207,8 @@ sub en {
portalDisplayLogout => 'Logout',
portalDisplayResetPassword => 'Reset password',
portalForceAuthn => 'Force authentication',
portalModules => 'Modules',
portalMenu => 'Menu',
portalModules => 'Modules activation',
portalOpenLinkInNewWindow => 'New window',
portalParams => 'Portal',
portalRequireOldPassword => 'Require old password',
@ -416,6 +418,7 @@ sub fr {
advancedParams => 'Paramètres avancés',
apacheParams => 'Paramètres Apache',
apacheAuthnLevel => 'Niveau d\'authentification',
applicationList => 'Catégories et applications',
attributesAndMacros => 'Attributs et macros',
authChoiceModules => 'Modules autorisés',
authChoiceParam => 'Parmètre de l\'URL',
@ -556,6 +559,7 @@ sub fr {
portalDisplayLogout => 'Déconnexion',
portalDisplayResetPassword => 'Réinitialisation de mot de passe',
portalForceAuthn => 'Authentication forcée',
portalMenu => 'Menu',
portalModules => 'Modules',
portalOpenLinkInNewWindow => 'Nouvelle fenêtre',
portalParams => 'Portail',