[geeklog-hg] geeklog: Fixed sorting of css files when using ETag. Added a che...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Jul 28 09:30:41 EDT 2013


changeset 9231:cfc30d5dc481
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/cfc30d5dc481
user: Tom <websitemaster at cogeco.net>
date: Sat Jul 27 21:23:10 2013 -0400
description:
Fixed sorting of css files when using ETag. Added a check for styl.css.php in theme directory before using ETag.

diffstat:

 public_html/layout/modern_curve/functions.php |  64 +++++++++++++-------------
 public_html/layout/modern_curve/style.css.php |   6 +-
 public_html/lib-common.php                    |   4 +
 system/classes/scripts.class.php              |  16 +++---
 4 files changed, 47 insertions(+), 43 deletions(-)

diffs (153 lines):

diff -r 41567b113ad0 -r cfc30d5dc481 public_html/layout/modern_curve/functions.php
--- a/public_html/layout/modern_curve/functions.php	Sat Jul 27 17:57:04 2013 -0400
+++ b/public_html/layout/modern_curve/functions.php	Sat Jul 27 21:23:10 2013 -0400
@@ -73,42 +73,42 @@
     // Instead of importing all files in a single css file we will load them seperately 
     // since each file needs to be processed by style.css.php for language template vars
     return array(
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/compatible.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/default.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/common.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/layout.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/block.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/option.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/form.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/story.css'),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/compatible.css', 'priority' => 1.00),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/default.css', 'priority' => 1.01),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/common.css', 'priority' => 1.02),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/layout.css', 'priority' => 1.03),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/block.css', 'priority' => 1.04),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/option.css', 'priority' => 1.05),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/form.css', 'priority' => 1.06),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/story.css', 'priority' => 1.07),
          
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/article/article.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/comment/comment.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/navbar/navbar.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/preferences/preferences.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/search/search.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/stats/stats.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/submit/submit.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/trackback/trackback.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/users/users.css'),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/article/article.css', 'priority' => 1.08),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/comment/comment.css', 'priority' => 1.09),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/navbar/navbar.css', 'priority' => 1.10),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/preferences/preferences.css', 'priority' => 1.11),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/search/search.css', 'priority' => 1.12),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/stats/stats.css', 'priority' => 1.13),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/submit/submit.css', 'priority' => 1.14),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/trackback/trackback.css', 'priority' => 1.15),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/users/users.css', 'priority' => 1.16),
          
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/common.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/block.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/envcheck.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/group.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/lists.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/commandcontrol.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/plugins.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/story.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/topic.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/trackback.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/user.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/configuration.css'),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/common.css', 'priority' => 1.17),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/block.css', 'priority' => 1.18),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/envcheck.css', 'priority' => 1.19),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/group.css', 'priority' => 1.20),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/lists.css', 'priority' => 1.21),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/commandcontrol.css', 'priority' => 1.22),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/plugins.css', 'priority' => 1.23),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/story.css', 'priority' => 1.24),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/topic.css', 'priority' => 1.25),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/trackback.css', 'priority' => 1.26),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/user.css', 'priority' => 1.27),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/admin/configuration.css', 'priority' => 1.28),
          
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/plugin/japanize.css'),
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/plugin/sitecalendar.css'),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/plugin/japanize.css', 'priority' => 1.29),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/plugin/sitecalendar.css', 'priority' => 1.30),
          
-         array('file' => '/layout/' . $_CONF['theme'] . '/css/tooltips/tooltips.css'),
+         array('file' => '/layout/' . $_CONF['theme'] . '/css/tooltips/tooltips.css', 'priority' => 1.31),
     );
 }
 
diff -r 41567b113ad0 -r cfc30d5dc481 public_html/layout/modern_curve/style.css.php
--- a/public_html/layout/modern_curve/style.css.php	Sat Jul 27 17:57:04 2013 -0400
+++ b/public_html/layout/modern_curve/style.css.php	Sat Jul 27 21:23:10 2013 -0400
@@ -107,14 +107,14 @@
         $cssfiles[] = $info;
     }
 }
-/*
-// Sort CSS Files based on priority if needed
+
+// Sort Theme CSS Files based on priority if needed
 $priority = array();
 foreach($cssfiles as $k => $d) {
   $priority[$k] = $d['priority'];
 }
 array_multisort($priority, SORT_ASC, $cssfiles);
-*/
+
 // Add in custom.css at end after sort
 if (!empty($theme_default)) {
     $info = array();
diff -r 41567b113ad0 -r cfc30d5dc481 public_html/lib-common.php
--- a/public_html/lib-common.php	Sat Jul 27 17:57:04 2013 -0400
+++ b/public_html/lib-common.php	Sat Jul 27 21:23:10 2013 -0400
@@ -360,6 +360,10 @@
     }
     $_CONF['supported_version_theme'] = (!isset($theme_config['supported_version_theme']))   ? $_CONF['supported_version_theme']   : $theme_config['supported_version_theme'];
     $_CONF['theme_etag'] = (!isset($theme_config['etag']))   ? $_CONF['theme_etag']   : $theme_config['etag'];
+    if ($_CONF['theme_etag'] AND !file_exists($_CONF['path_layout'] . 'style.css.php')) {
+        // See if stylw.css.php file exists that is required
+        $_CONF['theme_etag'] = false;
+    }
 }
 /**
 * themes can specify the default image type
diff -r 41567b113ad0 -r cfc30d5dc481 system/classes/scripts.class.php
--- a/system/classes/scripts.class.php	Sat Jul 27 17:57:04 2013 -0400
+++ b/system/classes/scripts.class.php	Sat Jul 27 21:23:10 2013 -0400
@@ -449,7 +449,7 @@
         $this->css_files[$name]['name'] = $name;
         $this->css_files[$name]['file'] = $file;
         $this->css_files[$name]['extra'] = $extra;
-        $this->css_files[$name]['priority'] = COM_applyFilter($priority, true);
+        $this->css_files[$name]['priority'] = $priority;
         $this->css_files[$name]['constant'] = $constant;
         if ($_CONF['theme_etag'] AND $type == 'theme') {
             // Don't load css regular way for themes with etag enabled
@@ -475,11 +475,6 @@
         $this->header_set = true;
         
         $headercode = '';
-        
-        // Set JavaScript Library files first incase other scripts need them
-        if (!$this->library_files_footer) { // // Do we load jQuery now?
-            $headercode .= $this->setJavaScriptLibraries();
-        }
 
         // Sort CSS Files based on priority
         $priority = array();
@@ -507,8 +502,13 @@
                 }
             }
         }
-
-        // Set JavaScript (do this before file in case variables are needed)
+        
+        // Set JavaScript Library files first incase other scripts need them
+        if (!$this->library_files_footer) { // // Do we load jQuery now?
+            $headercode .= $this->setJavaScriptLibraries();
+        }
+        
+        // Set JavaScript Variables (do this before file in case variables are needed)
         $iso639Code = COM_getLangIso639Code();
         $headercode .= <<<EOD
 <script type="text/javascript">



More information about the geeklog-cvs mailing list