From a9bf201212c07ca8d8202cbc5b6007f0b3cfc5a5 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 22 Apr 2012 19:32:36 +0000 Subject: [PATCH] support transient fields --- lam/lib/html.inc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lam/lib/html.inc b/lam/lib/html.inc index 208127d5..8f7fce45 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -357,6 +357,8 @@ class htmlInputField extends htmlElement { private $isEnabled = true; /** indicates that the value should be saved in obfuscated form */ private $obfuscate = false; + /** indicates that this field should not automatically be saved in the self service or server profile */ + private $transient = false; /** required field */ protected $required = false; /** validation rule */ @@ -433,6 +435,9 @@ class htmlInputField extends htmlElement { $disabled = ' disabled'; } echo ''; + if ($this->transient) { + return array(); + } if ($this->obfuscate) { return array($this->fieldName => 'text_obfuscated'); } @@ -486,6 +491,15 @@ class htmlInputField extends htmlElement { $this->obfuscate = $obfuscate; } + /** + * Specifies that the value should not be automatically saved when used in self service or server profile (default: false). + * + * @param boolean $transient transient field + */ + public function setTransient($transient) { + $this->transient = $transient; + } + /** * Specifies if the input field is required. * @@ -683,7 +697,7 @@ class htmlButton extends htmlElement { // image button if ($this->isImageButton) { $class = ' class="smallImageButton"'; - $style = ' style="background-image: url(../../graphics/' . $this->value . ');"'; + $style = ' style="background-image: url(../../graphics/' . $this->value . '); background-color: transparent;"'; } // text button elseif ($this->iconClass == null) { @@ -819,6 +833,8 @@ class htmlSelect extends htmlElement { private $transformSingleSelect = true; /** onchange event */ private $onchangeEvent = null; + /** indicates that this field should not automatically be saved in the self service or server profile */ + private $transient = false; /** * Constructor. @@ -920,6 +936,9 @@ class htmlSelect extends htmlElement { elseif (sizeof($this->elements) == 0) { echo ''; } + if ($this->transient) { + return array(); + } if ($this->multiSelect) { return array($this->name => 'multiselect'); } @@ -1047,6 +1066,15 @@ class htmlSelect extends htmlElement { $this->onchangeEvent = htmlspecialchars($onchangeEvent); } + /** + * Specifies that the value should not be automatically saved when used in self service or server profile (default: false). + * + * @param boolean $transient transient field + */ + public function setTransient($transient) { + $this->transient = $transient; + } + } /**