3 * @file view/theme/vier/style.php
5 use Friendica\Core\Config;
6 use Friendica\Core\PConfig;
7 use Friendica\Model\Profile;
9 $uid = Profile::getThemeUid();
11 $style = PConfig::get($uid, 'vier', 'style');
14 $style = Config::get('vier', 'style');
21 if ($style == "flat") {
22 $stylecssfile = 'view/theme/vier/flat.css';
23 } else if ($style == "netcolour") {
24 $stylecssfile = 'view/theme/vier/netcolour.css';
25 } else if ($style == "breathe") {
26 $stylecssfile = 'view/theme/vier/breathe.css';
27 } else if ($style == "plus") {
28 $stylecssfile = 'view/theme/vier/plus.css';
29 } else if ($style == "dark") {
30 $stylecssfile = 'view/theme/vier/dark.css';
31 } else if ($style == "plusminus") {
32 $stylecssfile = 'view/theme/vier/plusminus.css';
35 if (file_exists($THEMEPATH."//style.css")) {
36 $stylecss = file_get_contents($THEMEPATH."//style.css")."\n";
37 $modified = filemtime($THEMEPATH."//style.css");
40 $stylemodified = filemtime($stylecssfile);
41 $stylecss .= file_get_contents($stylecssfile);
43 if ($stylemodified > $modified) {
44 $modified = $stylemodified;
47 $modified = gmdate('r', $modified);
49 $etag = md5($stylecss);
51 // Only send the CSS file if it was changed
52 header('Cache-Control: public');
53 header('ETag: "'.$etag.'"');
54 header('Last-Modified: '.$modified);
56 if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
58 $cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
59 $cached_etag = str_replace(array('"', "-gzip"), array('', ''),
60 stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
62 if (($cached_modified == $modified) && ($cached_etag == $etag)) {
63 header('HTTP/1.1 304 Not Modified');