5 use Friendica\Core\Config;
6 use Friendica\Core\PConfig;
8 $uid = get_theme_uid();
10 $style = PConfig::get($uid, 'vier', 'style');
13 $style = Config::get('vier', 'style');
19 $stylecssfile = 'view/theme/vier/flat.css';
20 else if ($style == "netcolour")
21 $stylecssfile = 'view/theme/vier/netcolour.css';
22 else if ($style == "breathe")
23 $stylecssfile = 'view/theme/vier/breathe.css';
24 else if ($style == "plus")
25 $stylecssfile = 'view/theme/vier/plus.css';
26 else if ($style == "dark")
27 $stylecssfile = 'view/theme/vier/dark.css';
28 else if ($style == "plusminus")
29 $stylecssfile = 'view/theme/vier/plusminus.css';
31 if (file_exists($THEMEPATH."//style.css")) {
32 $stylecss = file_get_contents($THEMEPATH."//style.css")."\n";
33 $modified = filemtime($THEMEPATH."//style.css");
36 $stylemodified = filemtime($stylecssfile);
37 $stylecss .= file_get_contents($stylecssfile);
39 if ($stylemodified > $modified)
40 $modified = $stylemodified;
42 $modified = gmdate('r', $modified);
44 $etag = md5($stylecss);
46 // Only send the CSS file if it was changed
47 header('Cache-Control: public');
48 header('ETag: "'.$etag.'"');
49 header('Last-Modified: '.$modified);
51 if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
53 $cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
54 $cached_etag = str_replace(array('"', "-gzip"), array('', ''),
55 stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
57 if (($cached_modified == $modified) && ($cached_etag == $etag)) {
58 header('HTTP/1.1 304 Not Modified');