mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-22 08:23:49 +01:00
LSformElement::mailQuota : Added suffix parameter
This commit is contained in:
parent
938d672f65
commit
6e5bd2ba34
1 changed files with 17 additions and 3 deletions
|
@ -54,7 +54,7 @@ class LSformElement_mailQuota extends LSformElement {
|
||||||
$quotas=array();
|
$quotas=array();
|
||||||
|
|
||||||
foreach ($this -> values as $value) {
|
foreach ($this -> values as $value) {
|
||||||
if (ereg('([0-9]*)S',$value,$regs)) {
|
if (ereg('([0-9]*)'.$this -> getSuffix(),$value,$regs)) {
|
||||||
$infos = array(
|
$infos = array(
|
||||||
'size' => $regs[1]
|
'size' => $regs[1]
|
||||||
);
|
);
|
||||||
|
@ -107,7 +107,21 @@ class LSformElement_mailQuota extends LSformElement {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return suffix value
|
||||||
|
*
|
||||||
|
* @retval string Suffix value
|
||||||
|
**/
|
||||||
|
function getSuffix() {
|
||||||
|
if(isset($this -> params['html_options']['suffix'])){
|
||||||
|
return strval($this -> params['html_options']['suffix']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "S";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recupère la valeur de l'élement passée en POST
|
* Recupère la valeur de l'élement passée en POST
|
||||||
*
|
*
|
||||||
|
@ -136,7 +150,7 @@ class LSformElement_mailQuota extends LSformElement {
|
||||||
if (isset($_POST[$this -> name.'_sizeFact'][$key]) && ($_POST[$this -> name.'_sizeFact'][$key]!=1)) {
|
if (isset($_POST[$this -> name.'_sizeFact'][$key]) && ($_POST[$this -> name.'_sizeFact'][$key]!=1)) {
|
||||||
$f = $_POST[$this -> name.'_sizeFact'][$key];
|
$f = $_POST[$this -> name.'_sizeFact'][$key];
|
||||||
}
|
}
|
||||||
$return[$this -> name][$key] = ($val*$f).'S';
|
$return[$this -> name][$key] = ($val*$f).$this->getSuffix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue