diff options
author | wei <> | 2007-05-11 00:09:07 +0000 |
---|---|---|
committer | wei <> | 2007-05-11 00:09:07 +0000 |
commit | 3c10f78f7cebe3ac4520ed0042a7d076963ce9d0 (patch) | |
tree | 705d445b3db1544881f67e16a828812dc96931a2 /framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php | |
parent | 117124d2fe308d64940b20165f8958be8bfa3592 (diff) |
add EnableDefaultStyle property
Diffstat (limited to 'framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php')
-rw-r--r-- | framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php index a9bf2d59..503bbb5e 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php @@ -99,6 +99,7 @@ abstract class TScaffoldBase extends TTemplateControl {
$this->_record = $obj->_record;
$this->setRecordClass($obj->getRecordClass());
+ $this->setEnableDefaultStyle($obj->getEnableDefaultStyle());
}
/**
@@ -174,13 +175,32 @@ abstract class TScaffoldBase extends TTemplateControl }
/**
+ * @return boolean enable default stylesheet, default is true.
+ */
+ public function getEnableDefaultStyle()
+ {
+ return $this->getViewState('EnableDefaultStyle', true);
+ }
+
+ /**
+ * @param boolean enable default stylesheet, default is true.
+ */
+ public function setEnableDefaultStyle($value)
+ {
+ return $this->setViewState('EnableDefaultStyle', TPropertyValue::ensureBoolean($value), true);
+ }
+
+ /**
* Publish the default stylesheet file.
*/
public function onPreRender($param)
{
parent::onPreRender($param);
- $url = $this->publishAsset($this->getDefaultStyle().'.css');
- $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url);
+ if($this->getEnableDefaultStyle())
+ {
+ $url = $this->publishAsset($this->getDefaultStyle().'.css');
+ $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url);
+ }
}
}
|