summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-04-21 17:26:27 +0200
committerFabio Bas <ctrlaltca@gmail.com>2014-04-21 17:26:27 +0200
commit25ba19196387f11285d50c2f658b4becd48f710f (patch)
tree4e59ec1cdf4d20e4d6d656758e9ac58bce5e9229 /framework/Web
parentb438554637e082544d2288e5c3654448c2f53683 (diff)
TJuiControlAdapter: guess value datatype before passing it to clientside
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/JuiControls/TJuiControlAdapter.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/framework/Web/UI/JuiControls/TJuiControlAdapter.php b/framework/Web/UI/JuiControls/TJuiControlAdapter.php
index 6ae3f5e5..3668a8b4 100644
--- a/framework/Web/UI/JuiControls/TJuiControlAdapter.php
+++ b/framework/Web/UI/JuiControls/TJuiControlAdapter.php
@@ -146,7 +146,20 @@ class TJuiControlOptions
{
if(0 == strcasecmp($name, $option))
{
- $this->_options[$option] = $value;
+ $low = strtolower($value);
+ if($low === 'null')
+ {
+ $this->_options[$option] = null;
+ } elseif($low === 'true') {
+ $this->_options[$option] = true;
+ } elseif($low === 'false') {
+ $this->_options[$option] = false;
+ } elseif(is_numeric($value)) {
+ // trick to get float or integer automatically when needed
+ $this->_options[$option] = $value + 0;
+ } else {
+ $this->_options[$option] = $value;
+ }
return;
}
}