[geeklog-cvs] geeklog: Scripts class does not set automatically theme css file...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Tue Jan 24 19:47:36 EST 2012
changeset 8483:67859771420f
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/67859771420f
user: Tom <websitemaster at cogeco.net>
date: Tue Jan 24 19:43:30 2012 -0500
description:
Scripts class does not set automatically theme css file now. Css file for themes now set in functions.php. Scripts class will set css file named "theme" first if found. (bug #0001407)
diffstat:
public_html/layout/professional/functions.php | 3 +++
public_html/layout/professional_css/functions.php | 3 +++
system/classes/scripts.class.php | 15 ++++++++-------
3 files changed, 14 insertions(+), 7 deletions(-)
diffs (75 lines):
diff -r e24fa62db1ea -r 67859771420f public_html/layout/professional/functions.php
--- a/public_html/layout/professional/functions.php Mon Jan 23 12:49:32 2012 -0500
+++ b/public_html/layout/professional/functions.php Tue Jan 24 19:43:30 2012 -0500
@@ -7,6 +7,9 @@
$_IMAGE_TYPE = 'png';
+// Add Theme CSS File to scripts class
+$_SCRIPTS->setCSSFile('theme', '/layout/' . $_CONF['theme'] . '/style.css');
+
/*
* For left/right block support there is no longer any need for the theme to
* put code into functions.php to set specific templates for the left/right
diff -r e24fa62db1ea -r 67859771420f public_html/layout/professional_css/functions.php
--- a/public_html/layout/professional_css/functions.php Mon Jan 23 12:49:32 2012 -0500
+++ b/public_html/layout/professional_css/functions.php Tue Jan 24 19:43:30 2012 -0500
@@ -7,6 +7,9 @@
$_IMAGE_TYPE = 'png';
+// Add Theme CSS File to scripts class
+$_SCRIPTS->setCSSFile('theme', '/layout/' . $_CONF['theme'] . '/style.css');
+
$_SCRIPTS->setJavaScriptFile('theme.confirm', '/layout/' . $_CONF['theme'] . '/javascript/confirm.js');
$_SCRIPTS->setJavaScriptFile('theme.fix_html', '/layout/' . $_CONF['theme'] . '/javascript/fix_html.js');
diff -r e24fa62db1ea -r 67859771420f system/classes/scripts.class.php
--- a/system/classes/scripts.class.php Mon Jan 23 12:49:32 2012 -0500
+++ b/system/classes/scripts.class.php Tue Jan 24 19:43:30 2012 -0500
@@ -77,14 +77,9 @@
$this->header_set = false;
$this->javascript_set = false;
- $theme_path = '/layout/' . $_CONF['theme'];
-
$this->jquery_cdn = false;
$this->jquery_ui_cdn = false;
- // Add Theme CSS File
- $this->setCSSFilePrivate('theme', $theme_path . '/style.css');
-
// Find available JavaScript libraries
$this->findJavaScriptLibraries();
@@ -97,7 +92,7 @@
}
// Setup restricted names after setting main libraries (do not want plugins messing with them)
- $this->restricted_names = array('fckeditor', 'core', 'jquery', 'theme');
+ $this->restricted_names = array('fckeditor', 'core', 'jquery');
}
@@ -376,6 +371,7 @@
return false;
}
+ $this->css_files[$name]['name'] = $name;
$this->css_files[$name]['file'] = $file;
$this->css_files[$name]['constant'] = $constant;
$this->css_files[$name]['load'] = true;
@@ -401,7 +397,12 @@
// Set CSS Files
foreach ($this->css_files as $file) {
if ($file['load'] && isset($file['file'])) {
- $headercode .= '<link rel="stylesheet" type="text/css" href="' . $_CONF['site_url'] . $file['file'] . '" ' . XHTML . '>' . LB;
+ $csslink = '<link rel="stylesheet" type="text/css" href="' . $_CONF['site_url'] . $file['file'] . '" ' . XHTML . '>' . LB;
+ if ($file['name'] == 'theme') { // load theme css first
+ $headercode = $csslink . $headercode;
+ } else {
+ $headercode .= $csslink;
+ }
}
}
More information about the geeklog-cvs
mailing list