mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 22:43:47 +01:00
LSaddons::supann : Added simple supannLabeledValue attribute type
This commit is contained in:
parent
1240e109c6
commit
f77741d23c
3 changed files with 57 additions and 4 deletions
|
@ -331,6 +331,28 @@ LSerror :: defineError('SUPANN_02',
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple découpage label/valeur sans traduction réel
|
||||
*
|
||||
* @param[in] $key La cle
|
||||
* @param[in] $value La valeur
|
||||
*
|
||||
* @retval array Un tableau cle->valeur contenant label et translated
|
||||
**/
|
||||
function supannTranslateLabeledValue($value) {
|
||||
$label='no';
|
||||
$pl=supannParseLabeledValue($value);
|
||||
if ($pl) {
|
||||
$label=$pl['label'];
|
||||
$value=$pl['value'];
|
||||
}
|
||||
|
||||
return array(
|
||||
'label' => $label,
|
||||
'translated' => $value
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Traduit une valeur en fonction de sa cle extrait d'un attribut
|
||||
* supannRoleEntite.
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2007 Easter-eggs
|
||||
* http://ldapsaisie.labs.libre-entreprise.org
|
||||
*
|
||||
* Author: See AUTHORS file in top-level directory.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
* Type d'attribut HTML supannLabeledValue
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*/
|
||||
class LSattr_html_supannLabeledValue extends LSattr_html {
|
||||
|
||||
var $LSformElement_type = 'supannLabeledValue';
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -73,10 +73,7 @@ class LSformElement_supannLabeledValue extends LSformElement {
|
|||
* @retval array Un tableau cle->valeur contenant translated et label ou False
|
||||
**/
|
||||
function translate($value) {
|
||||
return array (
|
||||
'translated' => 'NOT IMPLEMENTED',
|
||||
'label' => 'NOT IMPLEMENTED',
|
||||
);
|
||||
return supannTranslateLabeledValue($value);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue