summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page8
-rwxr-xr-xdemos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page8
-rw-r--r--framework/Web/UI/WebControls/THtmlArea.php2
-rw-r--r--framework/Web/UI/WebControls/THtmlArea4.php7
4 files changed, 23 insertions, 2 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page b/demos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page
index 5150922f..5f01c07e 100755
--- a/demos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/THtmlArea/Home.page
@@ -29,7 +29,7 @@ THtmlArea with manually set options
</td></tr>
<tr><td class="samplenote">
-THtmlArea with visual editting disabled:
+THtmlArea with visual editing disabled:
</td><td class="sampleaction">
<com:THtmlArea ID="HtmlArea3" EnableVisualEdit="false" />
<br/>
@@ -38,6 +38,12 @@ THtmlArea with visual editting disabled:
<com:TLiteral Encode="true" ID="Result3" />
</td></tr>
+<tr><td class="samplenote">
+Read-only THtmlArea:
+</td><td class="sampleaction">
+<com:THtmlArea ID="HtmlArea4" ReadOnly="true" Text="Sample html text: <b>bold</b> <i>italic</i>" />
+</td></tr>
+
</table>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page b/demos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page
index 6bb6449c..2b6c7a7a 100755
--- a/demos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/THtmlArea4/Home.page
@@ -29,7 +29,7 @@ THtmlArea4 with manually set options
</td></tr>
<tr><td class="samplenote">
-THtmlArea4 with visual editting disabled:
+THtmlArea4 with visual editing disabled:
</td><td class="sampleaction">
<com:THtmlArea4 ID="HtmlArea3" EnableVisualEdit="false" />
<br/>
@@ -38,6 +38,12 @@ THtmlArea4 with visual editting disabled:
<com:TLiteral Encode="true" ID="Result3" />
</td></tr>
+<tr><td class="samplenote">
+Read-only THtmlArea:
+</td><td class="sampleaction">
+<com:THtmlArea4 ID="HtmlArea4" ReadOnly="true" Text="Sample html text: <b>bold</b> <i>italic</i>" />
+</td></tr>
+
</table>
</com:TContent>
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php
index fd26d0ab..6c2985f8 100644
--- a/framework/Web/UI/WebControls/THtmlArea.php
+++ b/framework/Web/UI/WebControls/THtmlArea.php
@@ -469,6 +469,8 @@ class THtmlArea extends TTextBox
$options['theme_advanced_toolbar_align'] = 'left';
$options['theme_advanced_path_location'] = 'bottom';
$options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';
+ if($this->getReadOnly())
+ $options['readonly'] = true;
$options = array_merge($options, $this->parseEditorOptions($this->getOptions()));
return $options;
diff --git a/framework/Web/UI/WebControls/THtmlArea4.php b/framework/Web/UI/WebControls/THtmlArea4.php
index 7ae4aa4e..d5410eae 100644
--- a/framework/Web/UI/WebControls/THtmlArea4.php
+++ b/framework/Web/UI/WebControls/THtmlArea4.php
@@ -406,6 +406,13 @@ class THtmlArea4 extends TTextBox
$options['height'] = $this->getHeight();
$options['resize'] = 'both';
$options['menubar'] = false;
+ if($this->getReadOnly())
+ {
+ $options['readonly'] = true;
+ $options['toolbar'] = false;
+ $options['menubar'] = false;
+ $options['statusbar'] = false;
+ }
$options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';