Changeset 1019
- Timestamp:
- 03/10/07 19:43:27 (2 years ago)
- Files:
-
- devel/_templates/css.php (modified) (1 diff)
- devel/htaccess-dist (modified) (1 diff)
- devel/lib/elgglib.php (modified) (2 diffs)
- devel/lib/templates.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/_templates/css.php
r296 r1019 5 5 header("Content-type: text/css; charset=utf-8"); 6 6 7 $template_id = optional_param('template' ,0,PARAM_INT);7 $template_id = optional_param('template'); 8 8 9 echo templates_draw(array( 9 // templates_draw() uses the global $template_name, not the 'template' array param, to choose a template 10 $template_name = $template_id; 11 12 $css = templates_draw(array( 10 13 'template' => $template_id, 11 14 'context' => 'css' 12 15 ) 13 16 ); 14 17 18 $etag = md5($css); 19 20 header('Cache-Control: public'); 21 header('Pragma: '); 22 23 //header('Expires: '. gmdate('D, d M Y H:i:s', 0) .'GMT'); 24 header('ETag: ' . $etag . ''); 25 26 // Send 304s where possible, rather than spitting out the file each time 27 if (array_key_exists('HTTP_IF_NONE_MATCH',$_SERVER)) { 28 $if_none_match = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_NONE_MATCH']); 29 if ($if_none_match == $etag) { 30 header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified"); 31 exit; 32 } 33 } 34 35 echo $css; 36 15 37 ?> devel/htaccess-dist
r1018 r1019 49 49 #RewriteBase / 50 50 51 RewriteRule ^ ([0-9\-]+)\.css$ _templates/css.php?template=$151 RewriteRule ^_templates/css/(.+)$ _templates/css.php?template=$1 52 52 53 53 RewriteRule ^(.+)\/rssstyles.xsl$ _rss/styles.php?rssurl=$1&url=$1 devel/lib/elgglib.php
r992 r1019 292 292 293 293 global $CFG; 294 if ($plugin == 'mod') { 295 $plugin = $CFG->dirroot . $plugin; 296 } 294 297 static $plugincache = array(); 295 298 $plugincachename = $plugin . "_" . $exclude; … … 299 302 } else { 300 303 $plugins = array(); 301 $basedir = opendir($CFG->dirroot . $plugin); 302 while (false !== ($dir = readdir($basedir))) { 303 $firstchar = substr($dir, 0, 1); 304 if ($firstchar == '.' or $dir == 'CVS' or $dir == '_vti_cnf' or $dir == $exclude) { 305 continue; 304 if ($basedir = opendir($plugin)) { 305 while (false !== ($dir = readdir($basedir))) { 306 $firstchar = substr($dir, 0, 1); 307 if ($firstchar == '.' or $dir == 'CVS' or $dir == '_vti_cnf' or $dir == $exclude) { 308 continue; 309 } 310 if (filetype($plugin .'/'. $dir) != 'dir') { 311 continue; 312 } 313 $plugins[] = $dir; 306 314 } 307 if (filetype($CFG->dirroot . $plugin .'/'. $dir) != 'dir') {308 continue;309 }310 $plugins[] = $dir;311 315 } 312 316 if ($plugins) { devel/lib/templates.php
r1017 r1019 1318 1318 1319 1319 case "metatags": 1320 // $run_result = "<link href=\"/".$template_variable.".css\" rel=\"stylesheet\" type=\"text/css\" />";1321 $result ="<style type=\"text/css\">\n"1322 . templates_draw(array(1323 'template' => $template_name,1324 'context' => 'css'1325 )1326 )1327 . "\n</style>\n"1320 $run_result = '<link href="' . $CFG->wwwroot . '_templates/css/' . $template_name. '" rel="stylesheet" type="text/css" />' 1321 // $result = $template_name . "<style type=\"text/css\">\n" 1322 // . templates_draw(array( 1323 // 'template' => $template_name, 1324 // 'context' => 'css' 1325 // ) 1326 // ) 1327 // . "\n</style>\n" 1328 1328 . $metatags; 1329 1329 break;
