summaryrefslogtreecommitdiff
path: root/framework/Data
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data')
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php24
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);
+ }
}
}