From 7ee28a4a78d8038438677bc412200c1c647c30f9 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 16 Oct 2008 14:27:07 +0000 Subject: [PATCH] - LSformElement_ssh_key -> Refonte en utilisant les templates --- .../class/class.LSformElement_ssh_key.php | 61 ++++++++----------- .../default/LSformElement_ssh_key.tpl | 7 +++ .../default/LSformElement_ssh_key_field.tpl | 9 +++ 3 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 trunk/templates/default/LSformElement_ssh_key.tpl create mode 100644 trunk/templates/default/LSformElement_ssh_key_field.tpl diff --git a/trunk/includes/class/class.LSformElement_ssh_key.php b/trunk/includes/class/class.LSformElement_ssh_key.php index b3b1bf4a..f8b37b2d 100644 --- a/trunk/includes/class/class.LSformElement_ssh_key.php +++ b/trunk/includes/class/class.LSformElement_ssh_key.php @@ -32,6 +32,9 @@ class LSformElement_ssh_key extends LSformElement { + var $template = 'LSformElement_ssh_key.tpl'; + var $fieldTemplate = 'LSformElement_ssh_key_field.tpl'; + /** * Retourne les infos d'affichage de l'élément * @@ -42,50 +45,36 @@ class LSformElement_ssh_key extends LSformElement { function getDisplay(){ $GLOBALS['LSsession'] -> addCssFile('LSformElement_ssh_key.css'); $return = $this -> getLabelInfos(); - // value - $return['html'] = "\n"; + $return['html'] = $this -> fetchTemplate(NULL,$params); return $return; } - - /** - * Retourne le code HTML d'un champ vide - * - * @retval string Code HTML d'un champ vide. - */ - function getEmptyField() { - $multiple = $this -> getMultipleData(); - return "\n".$multiple; - } - + } ?> diff --git a/trunk/templates/default/LSformElement_ssh_key.tpl b/trunk/templates/default/LSformElement_ssh_key.tpl new file mode 100644 index 00000000..8af878d9 --- /dev/null +++ b/trunk/templates/default/LSformElement_ssh_key.tpl @@ -0,0 +1,7 @@ + diff --git a/trunk/templates/default/LSformElement_ssh_key_field.tpl b/trunk/templates/default/LSformElement_ssh_key_field.tpl new file mode 100644 index 00000000..2fcf1c7c --- /dev/null +++ b/trunk/templates/default/LSformElement_ssh_key_field.tpl @@ -0,0 +1,9 @@ +{if $freeze} + {if $value.type} + {$value.shortTxt}... (Type : {$value.type}) {$value.mail}

{$value.value}

+ {else} + {$value.shortTxt}... ({$unknowTypeTxt})

{$value.value}

+ {/if} +{else} + +{/if}