mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-22 16:33:48 +01:00
LSmail : add possibilty to set some display options from JS
This commit is contained in:
parent
71480875d4
commit
d6e1257ed8
3 changed files with 34 additions and 3 deletions
|
@ -52,6 +52,8 @@ class LSmail {
|
||||||
|
|
||||||
LStemplate :: assign('LSmail_msg',$msg);
|
LStemplate :: assign('LSmail_msg',$msg);
|
||||||
LStemplate :: assign('LSmail_subject',$subject);
|
LStemplate :: assign('LSmail_subject',$subject);
|
||||||
|
LStemplate :: assign('LSmail_options',$_REQUEST['options']);
|
||||||
|
|
||||||
if (is_array($_REQUEST['mails'])) {
|
if (is_array($_REQUEST['mails'])) {
|
||||||
LStemplate :: assign('LSmail_mails',$_REQUEST['mails']);
|
LStemplate :: assign('LSmail_mails',$_REQUEST['mails']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,10 @@ var LSmail = new Class({
|
||||||
this.setSubject(subject);
|
this.setSubject(subject);
|
||||||
this.object = {};
|
this.object = {};
|
||||||
this.opened = 0;
|
this.opened = 0;
|
||||||
|
this.options = {
|
||||||
|
display_mail_field: 1,
|
||||||
|
display_subject_field: 1
|
||||||
|
};
|
||||||
this.listeners = {
|
this.listeners = {
|
||||||
close: new Array(),
|
close: new Array(),
|
||||||
valid: new Array()
|
valid: new Array()
|
||||||
|
@ -45,7 +49,23 @@ var LSmail = new Class({
|
||||||
dn: dn
|
dn: dn
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setOption: function(option,value) {
|
||||||
|
this.options[option]=value;
|
||||||
|
},
|
||||||
|
|
||||||
|
hideMailField: function() {
|
||||||
|
this.setOption('display_mail_field',0);
|
||||||
|
},
|
||||||
|
|
||||||
|
hideSubjectField: function() {
|
||||||
|
this.setOption('display_subject_field',0);
|
||||||
|
},
|
||||||
|
|
||||||
|
setClass: function(c) {
|
||||||
|
this.setOption('class',c);
|
||||||
|
},
|
||||||
|
|
||||||
open: function(startElement) {
|
open: function(startElement) {
|
||||||
if (this.opened==0) {
|
if (this.opened==0) {
|
||||||
var data = {
|
var data = {
|
||||||
|
@ -54,7 +74,8 @@ var LSmail = new Class({
|
||||||
object: this.object,
|
object: this.object,
|
||||||
mails: this.mails,
|
mails: this.mails,
|
||||||
msg: this.msg,
|
msg: this.msg,
|
||||||
subject: this.subject
|
subject: this.subject,
|
||||||
|
options: this.options
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($type(startElement)) {
|
if ($type(startElement)) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<dl class='LSform LSmail'>
|
<dl class='LSform{if $LSmail_options.class} {$LSmail_options.class}{/if}'>
|
||||||
|
{if $LSmail_options.display_mail_field}
|
||||||
<dt class='LSform'>{$LSmail_mail_label}</dt>
|
<dt class='LSform'>{$LSmail_mail_label}</dt>
|
||||||
<dd class='LSform'>
|
<dd class='LSform'>
|
||||||
{if $LSmail_mails != ""}
|
{if $LSmail_mails != ""}
|
||||||
|
@ -13,10 +14,17 @@
|
||||||
<input type='text' name='LSmail_mail' id='LSmail_mail'/>
|
<input type='text' name='LSmail_mail' id='LSmail_mail'/>
|
||||||
{/if}
|
{/if}
|
||||||
</dd>
|
</dd>
|
||||||
|
{else}
|
||||||
|
<input type='hidden' name='LSmail_mail' id='LSmail_mail' value='{$LSmail_mails[0]}'/>
|
||||||
|
{/if}
|
||||||
|
{if $LSmail_options.display_subject_field}
|
||||||
<dt class='LSform'>{$LSmail_subject_label}</dt>
|
<dt class='LSform'>{$LSmail_subject_label}</dt>
|
||||||
<dd class='LSform'>
|
<dd class='LSform'>
|
||||||
<input type='text' name='LSmail_subject' id='LSmail_subject' value="{$LSmail_subject}"/>
|
<input type='text' name='LSmail_subject' id='LSmail_subject' value="{$LSmail_subject}"/>
|
||||||
</dd>
|
</dd>
|
||||||
|
{else}
|
||||||
|
<input type='hidden' name='LSmail_subject' id='LSmail_subject' value="{$LSmail_subject}"/>
|
||||||
|
{/if}
|
||||||
<dt class='LSform'>{$LSmail_msg_label}</dt>
|
<dt class='LSform'>{$LSmail_msg_label}</dt>
|
||||||
<dd class='LSform'>
|
<dd class='LSform'>
|
||||||
<textarea name='LSmail_msg' id='LSmail_msg'>{$LSmail_msg}</textarea>
|
<textarea name='LSmail_msg' id='LSmail_msg'>{$LSmail_msg}</textarea>
|
||||||
|
|
Loading…
Reference in a new issue