summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-02 23:41:16 +0200
committeremkael <emkael@tlen.pl>2016-05-02 23:41:16 +0200
commit8bbd37b880aa1e63eaa8cbe6432d69a8158fd892 (patch)
treec0b5b6d519e69bdc8a1da65c84bf0d10b723d214
parentc1ba0e05fbd618d48fce4995f34e14c2175b1dfc (diff)
* registering control CSS as themed, if available
-rw-r--r--app/php/web/TemplateControl.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/app/php/web/TemplateControl.php b/app/php/web/TemplateControl.php
index 213a680..cc7f840 100644
--- a/app/php/web/TemplateControl.php
+++ b/app/php/web/TemplateControl.php
@@ -128,10 +128,17 @@ class TemplateControl extends TTemplateControl {
$this->_registerControlStyleDependencies(
$this->getControlStyleDependencies()
);
- $this->Page->ClientScript->registerStyleSheetFile(
- 'TemplateControl.' . get_class($this),
- $this->Application->AssetManager->publishFilePath($styleFile)
- );
+ if (method_exists($this->Page->ClientScript, 'registerThemeStyleSheetFile')) {
+ $this->Page->ClientScript->registerThemeStyleSheetFile(
+ 'TemplateControl.' . get_class($this),
+ $this->Application->AssetManager->publishFilePath($styleFile)
+ );
+ } else {
+ $this->Page->ClientScript->registerStyleSheetFile(
+ 'TemplateControl.' . get_class($this),
+ $this->Application->AssetManager->publishFilePath($styleFile)
+ );
+ }
}
private function _registerExternalStyleDependencies($dependencies) {