From b4105c04d680033ad123810d8d923b1cd7df1aa8 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 12 Aug 2015 12:21:20 +0200 Subject: [PATCH] Add new form element type for telephone number --- .../includes/class/class.LSattr_html_tel.php | 32 +++++++++++++ .../class/class.LSformElement_tel.php | 48 +++++++++++++++++++ .../default/LSformElement_uri_field.tpl | 2 +- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 public_html/includes/class/class.LSattr_html_tel.php create mode 100644 public_html/includes/class/class.LSformElement_tel.php diff --git a/public_html/includes/class/class.LSattr_html_tel.php b/public_html/includes/class/class.LSattr_html_tel.php new file mode 100644 index 00000000..6fdb4651 --- /dev/null +++ b/public_html/includes/class/class.LSattr_html_tel.php @@ -0,0 +1,32 @@ + + */ +class LSattr_html_tel extends LSattr_html { + + var $LSformElement_type = 'tel'; + +} diff --git a/public_html/includes/class/class.LSformElement_tel.php b/public_html/includes/class/class.LSformElement_tel.php new file mode 100644 index 00000000..e108063f --- /dev/null +++ b/public_html/includes/class/class.LSformElement_tel.php @@ -0,0 +1,48 @@ + + */ + +class LSformElement_tel extends LSformElement_text { + + var $fetchVariables = array( + 'uriClass' => 'LSformElement_tel', + 'uriPrefix' => 'tel:' + ); + + var $fieldTemplate = 'LSformElement_uri_field.tpl'; + + function getDisplay() { + $this -> fetchVariables['uriLinkTitle'] = $this -> attr_html -> attribute -> ldapObject ->getDisplayName(); + return parent :: getDisplay(); + } + +} diff --git a/public_html/templates/default/LSformElement_uri_field.tpl b/public_html/templates/default/LSformElement_uri_field.tpl index d538d1b5..5b7d9459 100644 --- a/public_html/templates/default/LSformElement_uri_field.tpl +++ b/public_html/templates/default/LSformElement_uri_field.tpl @@ -1,7 +1,7 @@ {if $freeze} {if $value} - {$value} + {$value} {else} {$noValueTxt} {/if}