summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls
diff options
context:
space:
mode:
authorjavalizard <>2010-04-18 15:30:32 +0000
committerjavalizard <>2010-04-18 15:30:32 +0000
commitef5dbc7cf8387052a707d6b57105fa6660e8fd35 (patch)
treeca40c29fb790c4cfa2b4a20cb51468a32ddfb402 /framework/Web/UI/WebControls
parent12f04df3c800a0776fbf6d2d1cb70bed8f47ed2a (diff)
exposes the default tagname to the system by making the getDefaultTagName public. Also adds getIsMutated to tell if the tag has changed. getDefaultTagName allows for simple and complex behaviors for selecting a default TagName.
lemon is to lime as yellow is to green => TWebControl is to THtmlElement as getTagName is to getDefaultTagName
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r--framework/Web/UI/WebControls/THeader1.php2
-rw-r--r--framework/Web/UI/WebControls/THeader2.php2
-rw-r--r--framework/Web/UI/WebControls/THeader3.php2
-rw-r--r--framework/Web/UI/WebControls/THeader4.php2
-rw-r--r--framework/Web/UI/WebControls/THeader5.php2
-rw-r--r--framework/Web/UI/WebControls/THeader6.php2
-rw-r--r--framework/Web/UI/WebControls/THtmlElement.php12
7 files changed, 16 insertions, 8 deletions
diff --git a/framework/Web/UI/WebControls/THeader1.php b/framework/Web/UI/WebControls/THeader1.php
index a4d29267..3ad40001 100644
--- a/framework/Web/UI/WebControls/THeader1.php
+++ b/framework/Web/UI/WebControls/THeader1.php
@@ -28,7 +28,7 @@ class THeader1 extends THtmlElement {
/**
* @return string tag name
*/
- protected function getDefaultTagName()
+ public function getDefaultTagName()
{
return 'h1';
}
diff --git a/framework/Web/UI/WebControls/THeader2.php b/framework/Web/UI/WebControls/THeader2.php
index 62cde55b..168c349c 100644
--- a/framework/Web/UI/WebControls/THeader2.php
+++ b/framework/Web/UI/WebControls/THeader2.php
@@ -28,7 +28,7 @@ class THeader2 extends THtmlElement {
/**
* @return string tag name
*/
- protected function getDefaultTagName()
+ public function getDefaultTagName()
{
return 'h2';
}
diff --git a/framework/Web/UI/WebControls/THeader3.php b/framework/Web/UI/WebControls/THeader3.php
index c12ed6d6..0de923e9 100644
--- a/framework/Web/UI/WebControls/THeader3.php
+++ b/framework/Web/UI/WebControls/THeader3.php
@@ -28,7 +28,7 @@ class THeader3 extends THtmlElement {
/**
* @return string tag name
*/
- protected function getDefaultTagName()
+ public function getDefaultTagName()
{
return 'h3';
}
diff --git a/framework/Web/UI/WebControls/THeader4.php b/framework/Web/UI/WebControls/THeader4.php
index d673d4c2..59624b66 100644
--- a/framework/Web/UI/WebControls/THeader4.php
+++ b/framework/Web/UI/WebControls/THeader4.php
@@ -28,7 +28,7 @@ class THeader4 extends THtmlElement {
/**
* @return string tag name
*/
- protected function getDefaultTagName()
+ public function getDefaultTagName()
{
return 'h4';
}
diff --git a/framework/Web/UI/WebControls/THeader5.php b/framework/Web/UI/WebControls/THeader5.php
index 59baef91..a48d2dfd 100644
--- a/framework/Web/UI/WebControls/THeader5.php
+++ b/framework/Web/UI/WebControls/THeader5.php
@@ -28,7 +28,7 @@ class THeader5 extends THtmlElement {
/**
* @return string tag name
*/
- protected function getDefaultTagName()
+ public function getDefaultTagName()
{
return 'h5';
}
diff --git a/framework/Web/UI/WebControls/THeader6.php b/framework/Web/UI/WebControls/THeader6.php
index 3e3e978a..8720bada 100644
--- a/framework/Web/UI/WebControls/THeader6.php
+++ b/framework/Web/UI/WebControls/THeader6.php
@@ -28,7 +28,7 @@ class THeader6 extends THtmlElement {
/**
* @return string tag name
*/
- protected function getDefaultTagName()
+ public function getDefaultTagName()
{
return 'h6';
}
diff --git a/framework/Web/UI/WebControls/THtmlElement.php b/framework/Web/UI/WebControls/THtmlElement.php
index cd290aa6..300edfe0 100644
--- a/framework/Web/UI/WebControls/THtmlElement.php
+++ b/framework/Web/UI/WebControls/THtmlElement.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2010 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -54,7 +54,15 @@ class THtmlElement extends TWebControl
* This is the default tag when no other is specified
* @return string the default tag
*/
- protected function getDefaultTagName() {
+ public function getDefaultTagName() {
return 'span';
}
+
+ /**
+ * This tells you if this TagName has deviated from the original
+ * @return boolean true if TagName has deviated from the default.
+ */
+ public function getIsMutated() {
+ return $this->_tagName !== null && $this->_tagName != $this->getDefaultTagName();
+ }
}