mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-23 02:19:07 +01:00
LSattr_html :: date : Add showNowButton and showTodayButton parameters
This commit is contained in:
parent
a935828a83
commit
835dccb5f6
3 changed files with 48 additions and 14 deletions
|
@ -12,6 +12,8 @@
|
||||||
'format' => '[Format d'affichage de la date]',
|
'format' => '[Format d'affichage de la date]',
|
||||||
'time' => '[Booleen pour le choix ou non de l heure]',
|
'time' => '[Booleen pour le choix ou non de l heure]',
|
||||||
'manual' => '[Booleen pour l edition manuelle ou non]',
|
'manual' => '[Booleen pour l edition manuelle ou non]',
|
||||||
|
'showNowButton' => '[Booleen]',
|
||||||
|
'showTodayButton' => '[Booleen]',
|
||||||
'style' => '[Nom du style utilise]'
|
'style' => '[Nom du style utilise]'
|
||||||
),]]>
|
),]]>
|
||||||
...
|
...
|
||||||
|
@ -176,6 +178,22 @@
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>showNowButton</term>
|
||||||
|
<listitem>
|
||||||
|
<simpara>Booléen définissant si le bouton <emphasis>Maintenant</emphasis> est
|
||||||
|
affiché ou non. Par défaut, il est affiché.</simpara>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>showTodayButton</term>
|
||||||
|
<listitem>
|
||||||
|
<simpara>Booléen définissant si le bouton <emphasis>Aujourd'hui</emphasis> est
|
||||||
|
affiché ou non. Par défaut, il est affiché.</simpara>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>style</term>
|
<term>style</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
|
@ -165,7 +165,9 @@ class LSformElement_date extends LSformElement {
|
||||||
'format' => $this -> php2js_format($this -> getFormat()),
|
'format' => $this -> php2js_format($this -> getFormat()),
|
||||||
'style' => $this -> getStyle(),
|
'style' => $this -> getStyle(),
|
||||||
'time' => (isset($this -> params['html_options']['time'])?$this -> params['html_options']['time']:true),
|
'time' => (isset($this -> params['html_options']['time'])?$this -> params['html_options']['time']:true),
|
||||||
'manual' => (isset($this -> params['html_options']['manual'])?$this -> params['html_options']['manual']:true)
|
'manual' => (isset($this -> params['html_options']['manual'])?$this -> params['html_options']['manual']:true),
|
||||||
|
'showNowButton' => (isset($this -> params['html_options']['showNowButton'])?$this -> params['html_options']['showNowButton']:true),
|
||||||
|
'showTodayButton' => (isset($this -> params['html_options']['showTodayButton'])?$this -> params['html_options']['showTodayButton']:true),
|
||||||
);
|
);
|
||||||
LSsession :: addJSconfigParam($this -> name,$params);
|
LSsession :: addJSconfigParam($this -> name,$params);
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,12 @@ var LSformElement_date_field = new Class({
|
||||||
if (!$type(this.params.manual)) {
|
if (!$type(this.params.manual)) {
|
||||||
this.params.manual = true;
|
this.params.manual = true;
|
||||||
}
|
}
|
||||||
|
if (!$type(this.params.showNowButton)) {
|
||||||
|
this.params.showNowButton = true;
|
||||||
|
}
|
||||||
|
if (!$type(this.params.showTodayButton)) {
|
||||||
|
this.params.showNowButton = true;
|
||||||
|
}
|
||||||
if (!$type(this.params.style)) {
|
if (!$type(this.params.style)) {
|
||||||
this.params.style = 'dashboard';
|
this.params.style = 'dashboard';
|
||||||
}
|
}
|
||||||
|
@ -37,19 +42,28 @@ var LSformElement_date_field = new Class({
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
this.nowBtn = new Element('img');
|
if (this.params.showNowButton) {
|
||||||
this.nowBtn.src = varLSdefault.imagePath('now');
|
this.nowBtn = new Element('img');
|
||||||
this.nowBtn.addClass('btn');
|
this.nowBtn.src = varLSdefault.imagePath('now');
|
||||||
this.nowBtn.addEvent('click',this.onNowBtnClick.bind(this));
|
this.nowBtn.addClass('btn');
|
||||||
this.nowBtn.injectAfter(this.input);
|
this.nowBtn.addEvent('click',this.onNowBtnClick.bind(this));
|
||||||
varLSdefault.addHelpInfo(this.nowBtn,'LSformElement_date','now');
|
this.nowBtn.injectAfter(this.input);
|
||||||
|
varLSdefault.addHelpInfo(this.nowBtn,'LSformElement_date','now');
|
||||||
|
}
|
||||||
|
|
||||||
this.todayBtn = new Element('img');
|
if (this.params.showTodayButton) {
|
||||||
this.todayBtn.src = varLSdefault.imagePath('calendar');
|
this.todayBtn = new Element('img');
|
||||||
this.todayBtn.addClass('btn');
|
this.todayBtn.src = varLSdefault.imagePath('calendar');
|
||||||
this.todayBtn.addEvent('click',this.onTodayBtnClick.bind(this));
|
this.todayBtn.addClass('btn');
|
||||||
this.todayBtn.injectAfter(this.nowBtn);
|
this.todayBtn.addEvent('click',this.onTodayBtnClick.bind(this));
|
||||||
varLSdefault.addHelpInfo(this.todayBtn,'LSformElement_date','today');
|
if (!$type(this.nowBtn)) {
|
||||||
|
this.todayBtn.injectAfter(this.input);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.todayBtn.injectAfter(this.nowBtn);
|
||||||
|
}
|
||||||
|
varLSdefault.addHelpInfo(this.todayBtn,'LSformElement_date','today');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onNowBtnClick: function() {
|
onNowBtnClick: function() {
|
||||||
|
|
Loading…
Reference in a new issue