summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/THtmlArea.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/THtmlArea.php')
-rw-r--r--framework/Web/UI/WebControls/THtmlArea.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php
index 7fea5862..8d55c074 100644
--- a/framework/Web/UI/WebControls/THtmlArea.php
+++ b/framework/Web/UI/WebControls/THtmlArea.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI
@@ -334,7 +334,7 @@ class THtmlArea extends TTextBox
$options['languages'] = $this->getLanguageSuffix($this->getCulture());
$options['disk_cache'] = true;
$options['debug'] = false;
- $js = TJavaScript::encode($options);
+ $js = TJavaScript::encode($options,true,true);
$script = "if(typeof(tinyMCE_GZ)!='undefined'){ tinyMCE_GZ.init({$js}); }";
$scripts->registerBeginScript($key, $script);
}
@@ -353,7 +353,7 @@ class THtmlArea extends TTextBox
protected function registerEditorClientScript($writer)
{
$scripts = $this->getPage()->getClientScript();
- $options = TJavaScript::encode($this->getEditorOptions());
+ $options = TJavaScript::encode($this->getEditorOptions(),true,true); // Force encoding of empty strings
$script = "if(typeof(tinyMCE)!='undefined'){ tinyMCE.init($options); }";
$scripts->registerEndScript('prado:THtmlArea'.$this->ClientID,$script);
}
@@ -436,7 +436,14 @@ class THtmlArea extends TTextBox
$option = explode(":",$bits,2);
if(count($option) == 2)
- $options[trim($option[0])] = trim(preg_replace('/\'|"/','', $option[1]));
+ {
+ $value=trim(preg_replace('/\'|"/','', $option[1]));
+ if (($s=strtolower($value))==='false')
+ $value=false;
+ elseif ($s==='true')
+ $value=true;
+ $options[trim($option[0])] = $value;
+ }
}
return $options;
}
@@ -447,10 +454,10 @@ class THtmlArea extends TTextBox
protected function getLanguageSuffix($culture)
{
$app = $this->getApplication()->getGlobalization();
- if(empty($culture) && !is_null($app))
+ if(empty($culture) && ($app!==null))
$culture = $app->getCulture();
$variants = array();
- if(!is_null($app))
+ if($app!==null)
$variants = $app->getCultureVariants($culture);
foreach($variants as $variant)