- Generalize the select element
- Options in select area are displayed with their descriptions
- SecuredCookie parameter is displayed within the select element
This commit is contained in:
Thomas CHEMINEAU 2010-03-18 15:22:10 +00:00
parent 3bf4c14d1c
commit 415cf5a167
5 changed files with 48 additions and 35 deletions

View File

@ -49,6 +49,8 @@ example/skins/default/folder_delete.png
example/skins/default/folder_edit.png example/skins/default/folder_edit.png
example/skins/default/help.png example/skins/default/help.png
example/skins/default/hframe.png example/skins/default/hframe.png
example/skins/default/images/1downarrow_16x16.png
example/skins/default/images/1rightarrow_16x16.png
example/skins/default/images/ui-bg_diagonals-thick_18_b81900_40x40.png example/skins/default/images/ui-bg_diagonals-thick_18_b81900_40x40.png
example/skins/default/images/ui-bg_diagonals-thick_20_666666_40x40.png example/skins/default/images/ui-bg_diagonals-thick_20_666666_40x40.png
example/skins/default/images/ui-bg_flat_10_000000_40x100.png example/skins/default/images/ui-bg_flat_10_000000_40x100.png

View File

@ -332,19 +332,19 @@ function authParams(id) {
} }
}); });
formateSelect('authText',[ formateSelect('authText',[
'Apache', 'Apache:Apache',
'CAS', 'CAS:Central Authentication Service (CAS)',
'DBI', 'DBI:Database (DBI)',
'LA', 'LA:Liberty Alliance',
'LDAP', 'LDAP:LDAP',
'Multi', 'Multi:Multi',
'Null', 'Null:None',
'OpenID', 'OpenID:OpenID',
'Proxy', 'Proxy:Proxy',
'Remote', 'Remote:Remote',
'SAML', 'SAML:SAML v2',
'SSL', 'SSL:SSL',
'Twitter' 'Twitter:Twitter'
],t[0]); ],t[0]);
display('authParams',lmtext(id)); display('authParams',lmtext(id));
} }
@ -352,14 +352,14 @@ function userdbParams(id) {
currentId=id; currentId=id;
$('#authOptions').hide(); $('#authOptions').hide();
formateSelect('authText',[ formateSelect('authText',[
'DBI', 'DBI:Database (DBI)',
'Env', 'Env:Environment',
'LDAP', 'LDAP:LDAP',
'Multi', 'Multi:Multi',
'Null', 'Null:None',
'Proxy', 'Proxy:Proxy',
'Remote', 'Remote:Remote',
'SAML' 'SAML:SAML v2'
],lmdata(id)); ],lmdata(id));
display('authParams',lmtext(id)); display('authParams',lmtext(id));
} }
@ -367,9 +367,9 @@ function passworddbParams(id) {
currentId=id; currentId=id;
$('#authOptions').hide(); $('#authOptions').hide();
formateSelect('authText',[ formateSelect('authText',[
'DBI', 'DBI:Database (DBI)',
'LDAP', 'LDAP:LDAP',
'Null' 'Null:None'
],lmdata(id)); ],lmdata(id));
display('authParams',lmtext(id)); display('authParams',lmtext(id));
} }
@ -469,8 +469,12 @@ function samlService(id) {
} }
function securedCookieValues(id){ function securedCookieValues(id){
currentId=id; currentId=id;
$('#securedCookie'+lmdata(id)).attr('checked',1); formateSelect('select',[
display('securedCookie',lmtext(id)); '0:'+text4securedCookie0,
'1:'+text4securedCookie1,
'2:'+text4securedCookie2
],lmdata(id));
display('select',lmtext(id));
} }
function vhost(id){ function vhost(id){
currentId=id; currentId=id;
@ -734,9 +738,10 @@ function downloadFile(id){
function formateSelect(id,values,selectedValue) { function formateSelect(id,values,selectedValue) {
var options=''; var options='';
for(i=0;i<values.length;i++){ for(i=0;i<values.length;i++){
options+='<option value="'+values[i]+'"'; var t=values[i].split(':');
if(selectedValue==values[i]){options+=' selected';} options+='<option value="'+t[0]+'"';
options+='>'+values[i]+'</option>'; if(selectedValue==t[0]){options+=' selected';}
options+='>'+t[1]+'</option>';
} }
$('#'+id).empty().append(options); $('#'+id).empty().append(options);
} }

View File

@ -25,6 +25,9 @@
var text4newSamlMetaData='<lang en="SAML Metadatas name" fr="Nom des métadatas SAML" />'; var text4newSamlMetaData='<lang en="SAML Metadatas name" fr="Nom des métadatas SAML" />';
var text4newSamlAttribute='<lang en="Attribute name" fr="Nom de l\'attribut" />'; var text4newSamlAttribute='<lang en="Attribute name" fr="Nom de l\'attribut" />';
var text4newFilename='<lang en="Filename" fr="Nom du fichier" />'; var text4newFilename='<lang en="Filename" fr="Nom du fichier" />';
var text4securedCookie0='<lang en="Non secured cookie" fr="Cookie non sécurisé"/>';
var text4securedCookie1='<lang en="Secured cookie (HTTPS)" fr="Cookie sécurisé (HTTPS)"/>';
var text4securedCookie2='Double cookie (HTTP and HTTPS)';
//]]></script> //]]></script>
<script src="<TMPL_VAR NAME="DIR">/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" /> <meta http-equiv="Content-Type" content="text/html; charset=utf8" />
@ -206,11 +209,13 @@
</table> </table>
</div> </div>
<!-- Specific to securedCookie (TODO push in _Struct.pm) --> <!-- Select -->
<div id="content_securedCookie" class="hidden"> <div id="content_select" class="hidden">
<input id="securedCookie0" type="radio" name="securedCookie" value="0" onclick="setlmdata('li_L3NlY3VyZWRDb29raWU1','0')" /> <lang en="Non secured cookie" fr="Cookie non sécurisé"/><br/> <select id="select"></select>
<input id="securedCookie1" type="radio" name="securedCookie" value="1" onclick="setlmdata('li_L3NlY3VyZWRDb29raWU1','1')" /> <lang en="Secured cookie (HTTPS)" fr="Cookie sécurisé (HTTPS)"/><br/> <br /><br />
<input id="securedCookie2" type="radio" name="securedCookie" value="2" onclick="setlmdata('li_L3NlY3VyZWRDb29raWU1','2')" /> Double cookie (HTTP and HTTPS)<br/> <button onclick="setlminputdata(currentId,select);return false;" class="ui-state-default ui-corner-all">
<lang en="Apply" fr="Appliquer" />
</button>
</div> </div>
<!-- Integer --> <!-- Integer -->

View File

@ -223,6 +223,7 @@ sub confNode {
textarea => '', textarea => '',
bool => 0, bool => 0,
filearea => '', filearea => '',
select => '',
}->{$type}; }->{$type};
$self->lmLog( "Type $type unknown", 'warn' ) unless ( defined $h ); $self->lmLog( "Type $type unknown", 'warn' ) unless ( defined $h );
} }

View File

@ -312,7 +312,7 @@ sub struct {
domain => 'text:/domain:domain:text', domain => 'text:/domain:domain:text',
cda => 'bool:/cda', cda => 'bool:/cda',
securedCookie => securedCookie =>
'int:/securedCookie:securedCookie:securedCookieValues', 'select:/securedCookie:securedCookie:securedCookieValues',
cookieExpiration => 'text:/cookieExpiration', cookieExpiration => 'text:/cookieExpiration',
}, },