public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Search Repo:
Quick change for defaults handling in stylesheet.php

git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@2738 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Wed May 03 08:37:28 -0700 2006
commit  c8ec248e9695c91b73c131803f386c2cb6be5559
tree    1d77df4d9cccc6fe631835038638595885df4204
parent  ad1155997dc04b8a4c1a8185683ea342df43dd13
...
32
33
34
 
 
 
35
36
37
38
39
40
41
 
42
43
44
...
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
139
140
141
142
143
144
145
146
147
148
149
150
...
152
153
154
 
 
 
 
 
 
 
155
156
157
...
32
33
34
35
36
37
38
39
40
41
42
43
 
44
45
46
47
...
91
92
93
 
 
 
 
 
 
 
 
 
 
 
94
95
96
...
131
132
133
 
 
 
 
 
 
134
135
136
...
138
139
140
141
142
143
144
145
146
147
148
149
150
0
@@ -32,13 +32,16 @@ if (isset($_GET["mediatype"])) $mediatype = $_GET["mediatype"];
0
 $name = '';
0
 if (isset($_GET['name'])) $name = $_GET['name'];
0
 
0
+$stripbackground = false;
0
+if (isset($_GET["stripbackground"])) $stripbackground = true;
0
+
0
 if ($templateid == '' && $name == '') return '';
0
 
0
 require_once('config.php');
0
 
0
 $css='';
0
 
0
-if (!isset($config['old_stylesheet']) || $config['old_stylesheet'] == false)
0
+if (isset($config['old_stylesheet']) && $config['old_stylesheet'] == false)
0
 {
0
 
0
   $encoding = '';
0
@@ -88,17 +91,6 @@ else
0
 
0
   require_once(dirname(__FILE__)."/include.php");
0
 
0
- $templateid = "";
0
- $mediatype = '';
0
- $name = '';
0
- $css = '';
0
- $nostylesheet = false;
0
- $stripbackground = false;
0
- if (isset($_GET["templateid"])) $templateid = $_GET["templateid"];
0
- if (isset($_GET["mediatype"])) $mediatype = $_GET["mediatype"];
0
- if (isset($_GET['name'])) $name = $_GET['name'];
0
- if (isset($_GET["stripbackground"])) $stripbackground = true;
0
-
0
   if ($name != '')
0
   {
0
     //TODO: Make stylesheet handling OOP
0
@@ -139,12 +131,6 @@ else
0
 
0
   header("Content-Type: text/css; charset=" . (isset($result['encoding'])?$result['encoding']:'UTF-8'));
0
 
0
- if ($stripbackground)
0
- {
0
- #$css = preg_replace('/(\w*?background-color.*?\:\w*?).*?(;.*?)/', '', $css);
0
- $css = preg_replace('/(\w*?background-color.*?\:\w*?).*?(;.*?)/', '\\1transparent\\2', $css);
0
- $css = preg_replace('/(\w*?background-image.*?\:\w*?).*?(;.*?)/', '', $css);
0
- }
0
 
0
 }
0
 
0
@@ -152,6 +138,13 @@ else
0
 #(and also breaks if gzip is on)
0
 #header("Content-Length: ".strlen($css));
0
 
0
+if ($stripbackground)
0
+{
0
+ #$css = preg_replace('/(\w*?background-color.*?\:\w*?).*?(;.*?)/', '', $css);
0
+ $css = preg_replace('/(\w*?background-color.*?\:\w*?).*?(;.*?)/', '\\1transparent\\2', $css);
0
+ $css = preg_replace('/(\w*?background-image.*?\:\w*?).*?(;.*?)/', '', $css);
0
+}
0
+
0
 #Do cache-control stuff but only if we are running Apache
0
 if(function_exists('getallheaders'))
0
 {

Comments

    No one has commented yet.