mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +01:00
LSattr_html :: select_list : use static keyword instead of self to make children classes override easier
This commit is contained in:
parent
40334100e6
commit
13dd1f1f6f
1 changed files with 15 additions and 15 deletions
|
@ -74,7 +74,7 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
* la valeur des balises option et en valeur ce qui sera affiché.
|
* la valeur des balises option et en valeur ce qui sera affiché.
|
||||||
*/
|
*/
|
||||||
protected function getPossibleValues() {
|
protected function getPossibleValues() {
|
||||||
return self :: _getPossibleValues(
|
return static :: _getPossibleValues(
|
||||||
$this -> getConfig('html_options'),
|
$this -> getConfig('html_options'),
|
||||||
$this -> name,
|
$this -> name,
|
||||||
$this->attribute->ldapObject
|
$this->attribute->ldapObject
|
||||||
|
@ -98,12 +98,12 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
if (isset($options['possible_values']) && is_array($options['possible_values'])) {
|
if (isset($options['possible_values']) && is_array($options['possible_values'])) {
|
||||||
foreach($options['possible_values'] as $val_key => $val_label) {
|
foreach($options['possible_values'] as $val_key => $val_label) {
|
||||||
if($val_key==='OTHER_OBJECT') {
|
if($val_key==='OTHER_OBJECT') {
|
||||||
$objInfos=self :: getLSobjectPossibleValues($val_label,$options,$name);
|
$objInfos=static :: getLSobjectPossibleValues($val_label,$options,$name);
|
||||||
$retInfos=self :: _array_merge($retInfos,$objInfos);
|
$retInfos=static :: _array_merge($retInfos,$objInfos);
|
||||||
}
|
}
|
||||||
elseif($val_key==='OTHER_ATTRIBUTE') {
|
elseif($val_key==='OTHER_ATTRIBUTE') {
|
||||||
$attrInfos=self :: getLSattributePossibleValues($val_label, $options, $name, $ldapObject);
|
$attrInfos=static :: getLSattributePossibleValues($val_label, $options, $name, $ldapObject);
|
||||||
$retInfos=self :: _array_merge($retInfos,$attrInfos);
|
$retInfos=static :: _array_merge($retInfos,$attrInfos);
|
||||||
}
|
}
|
||||||
elseif (is_array($val_label)) {
|
elseif (is_array($val_label)) {
|
||||||
if (!isset($val_label['possible_values']) || !is_array($val_label['possible_values']) || !isset($val_label['label']))
|
if (!isset($val_label['possible_values']) || !is_array($val_label['possible_values']) || !isset($val_label['label']))
|
||||||
|
@ -111,8 +111,8 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
$subRetInfos=array();
|
$subRetInfos=array();
|
||||||
foreach($val_label['possible_values'] as $vk => $vl) {
|
foreach($val_label['possible_values'] as $vk => $vl) {
|
||||||
if ($vk==='OTHER_OBJECT') {
|
if ($vk==='OTHER_OBJECT') {
|
||||||
$objInfos=self :: getLSobjectPossibleValues($vl,$options,$name);
|
$objInfos=static :: getLSobjectPossibleValues($vl,$options,$name);
|
||||||
$subRetInfos=self :: _array_merge($subRetInfos,$objInfos);
|
$subRetInfos=static :: _array_merge($subRetInfos,$objInfos);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$vk=$ldapObject->getFData($vk);
|
$vk=$ldapObject->getFData($vk);
|
||||||
|
@ -125,7 +125,7 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
$subRetInfos[$vk]=$vl;
|
$subRetInfos[$vk]=$vl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self :: _sort($subRetInfos,$options);
|
static :: _sort($subRetInfos,$options);
|
||||||
if (isset($options['translate_labels']) && !$options['translate_labels']) {
|
if (isset($options['translate_labels']) && !$options['translate_labels']) {
|
||||||
$subRetLabel = $ldapObject->getFData($val_label['label']);
|
$subRetLabel = $ldapObject->getFData($val_label['label']);
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self :: _sort($retInfos,$options);
|
static :: _sort($retInfos,$options);
|
||||||
|
|
||||||
return $retInfos;
|
return $retInfos;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
* @retval int Value for uasort
|
* @retval int Value for uasort
|
||||||
**/
|
**/
|
||||||
protected static function _sortTwoValuesDesc(&$va,&$vb) {
|
protected static function _sortTwoValuesDesc(&$va,&$vb) {
|
||||||
return (-1 * self :: _sortTwoValuesAsc($va,$vb));
|
return (-1 * static :: _sortTwoValuesAsc($va,$vb));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self :: _sort($retInfos,$options);
|
static :: _sort($retInfos,$options);
|
||||||
|
|
||||||
return $retInfos;
|
return $retInfos;
|
||||||
}
|
}
|
||||||
|
@ -373,15 +373,15 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
LSerror :: addErrorCode('LSattr_html_select_list_03',$attr['attr']);
|
LSerror :: addErrorCode('LSattr_html_select_list_03',$attr['attr']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$retInfos = self :: getLSattributePossibleValues($attr['attr'], $options ,$name ,$ldapObject);
|
$retInfos = static :: getLSattributePossibleValues($attr['attr'], $options ,$name ,$ldapObject);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LSerror :: addErrorCode('LSattr_html_select_list_02',$attr['attr']);
|
LSerror :: addErrorCode('LSattr_html_select_list_02',$attr['attr']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach($attr as $sub_attr => $sub_label) {
|
foreach($attr as $sub_attr => $sub_label) {
|
||||||
$subRetInfos = self :: getLSattributePossibleValues($sub_attr, $options ,$name ,$ldapObject);
|
$subRetInfos = static :: getLSattributePossibleValues($sub_attr, $options ,$name ,$ldapObject);
|
||||||
self :: _sort($subRetInfos,$options);
|
static :: _sort($subRetInfos,$options);
|
||||||
$retInfos[] = array (
|
$retInfos[] = array (
|
||||||
'label' => $sub_label,
|
'label' => $sub_label,
|
||||||
'possible_values' => $subRetInfos
|
'possible_values' => $subRetInfos
|
||||||
|
@ -389,7 +389,7 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self :: _sort($retInfos,$options);
|
static :: _sort($retInfos,$options);
|
||||||
return $retInfos;
|
return $retInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue