diff --git a/administrator/templates/hathor/index.php b/administrator/templates/hathor/index.php index cc7d96edf6511..cd585fd336999 100644 --- a/administrator/templates/hathor/index.php +++ b/administrator/templates/hathor/index.php @@ -39,22 +39,6 @@ $doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '.css'); -// Load custom.css -$file = 'templates/' . $this->template . '/css/custom.css'; - -if (is_file($file)) -{ - $doc->addStyleSheetVersion($file); -} - -// Load specific language related CSS -$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; - -if (is_file($file)) -{ - $doc->addStyleSheetVersion($file); -} - // Load additional CSS styles for rtl sites if ($this->direction == 'rtl') { @@ -62,18 +46,26 @@ $doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '_rtl.css'); } +// Load additional CSS styles for bold Text +if ($this->params->get('boldText')) +{ + $doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/boldtext.css'); +} + // Load specific language related CSS -$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; +$languageCss = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; -if (is_file($file)) +if (file_exists($languageCss) && filesize($languageCss) > 0) { - $doc->addStyleSheetVersion($file); + $doc->addStyleSheetVersion($languageCss); } -// Load additional CSS styles for bold Text -if ($this->params->get('boldText')) +// Load custom.css +$customCss = 'templates/' . $this->template . '/css/custom.css'; + +if (file_exists($customCss) && filesize($customCss) > 0) { - $doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/boldtext.css'); + $doc->addStyleSheetVersion($customCss); } // Load template javascript @@ -195,4 +187,4 @@ })(jQuery); - + \ No newline at end of file diff --git a/administrator/templates/isis/index.php b/administrator/templates/isis/index.php index 9a984750bdd42..bc94071e868e4 100644 --- a/administrator/templates/isis/index.php +++ b/administrator/templates/isis/index.php @@ -19,25 +19,26 @@ // Add JavaScript Frameworks JHtml::_('bootstrap.framework'); + $doc->addScriptVersion($this->baseurl . '/templates/' . $this->template . '/js/template.js'); // Add Stylesheets $doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/template' . ($this->direction == 'rtl' ? '-rtl' : '') . '.css'); // Load specific language related CSS -$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; +$languageCss = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; -if (is_file($file)) +if (file_exists($languageCss) && filesize($languageCss) > 0) { - $doc->addStyleSheetVersion($file); + $doc->addStyleSheetVersion($languageCss); } // Load custom.css -$file = 'templates/' . $this->template . '/css/custom.css'; +$customCss = 'templates/' . $this->template . '/css/custom.css'; -if (is_file($file)) +if (file_exists($customCss) && filesize($customCss) > 0) { - $doc->addStyleSheetVersion($file); + $doc->addStyleSheetVersion($customCss); } // Detecting Active Variables @@ -315,4 +316,4 @@ function colorIsLight($color) - + \ No newline at end of file diff --git a/templates/beez3/index.php b/templates/beez3/index.php index dcf459cffc670..593a351cb5ba9 100644 --- a/templates/beez3/index.php +++ b/templates/beez3/index.php @@ -65,6 +65,14 @@ $doc->addScript($this->baseurl . '/templates/' . $this->template . '/javascript/respond.src.js', 'text/javascript'); $doc->addScript($this->baseurl . '/templates/' . $this->template . '/javascript/template.js', 'text/javascript'); +// Check for a custom CSS file +$userCss = JPATH_SITE . '/templates/' . $this->template . '/css/user.css'; + +if (file_exists($userCss) && filesize($userCss) > 0) +{ + $doc->addStyleSheetVersion('templates/' . $this->template . '/css/user.css'); +} + ?> diff --git a/templates/protostar/index.php b/templates/protostar/index.php index 316260f23b1f3..6c824c064f53b 100644 --- a/templates/protostar/index.php +++ b/templates/protostar/index.php @@ -47,7 +47,7 @@ if (file_exists($userCss) && filesize($userCss) > 0) { - $doc->addStyleSheet('templates/' . $this->template . '/css/user.css'); + $doc->addStyleSheetVersion('templates/' . $this->template . '/css/user.css'); } // Load optional RTL Bootstrap CSS