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