LSformElement_mail : Added disableMailSending parameter
authorBenjamin Renard <brenard@easter-eggs.com>
Fri, 3 Dec 2010 17:04:40 +0000 (18:04 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Fri, 3 Dec 2010 17:04:40 +0000 (18:04 +0100)
public_html/includes/class/class.LSformElement_mail.php
public_html/includes/js/LSformElement_mail.js

index 3459d1f..9ef255a 100644 (file)
@@ -56,6 +56,13 @@ class LSformElement_mail extends LSformElement_text {
     }
     return parent :: getDisplay();
   }
+
+  function fetchTemplate($template=NULL,$variables=array()) {
+    if (isset($this -> params['html_options']['disableMailSending']) && $this -> params['html_options']['disableMailSending']) {
+      $this -> fetchVariables['uriClass'] .= " LSformElement_mail_disableMailSending";
+    }
+    return  parent :: fetchTemplate($template,$variables);
+  }
 }
 
 ?>
index c6d88c5..21f122e 100644 (file)
@@ -12,10 +12,14 @@ var LSformElement_mail = new Class({
         el = document;
       }
       el.getElements('input.LSformElement_mail').each(function(input) {
-        this.addBtnAfter.bind(this)(input);
+       if (!input.hasClass('LSformElement_mail_disableMailSending')) {
+          this.addBtnAfter.bind(this)(input);
+        }
       }, this);
       el.getElements('a.LSformElement_mail').each(function(a) {
-        this.addBtnAfter.bind(this)(a);
+        if (!input.hasClass('LSformElement_mail_disableMailSending')) {
+          this.addBtnAfter.bind(this)(a);
+        }
       }, this);
     },