]> git.mxchange.org Git - friendica.git/blob - view/theme/quattro/style.php
Make style.php require query parameter puid for specific stylesheets
[friendica.git] / view / theme / quattro / style.php
1 <?php
2 /**
3  * @file view/theme/quattro/style.php
4  */
5 use Friendica\Core\Config;
6 use Friendica\Core\PConfig;
7 use Friendica\Model\Profile;
8
9 $uid = defaults($_REQUEST, 'puid', 0);
10
11 $color = false;
12 $quattro_align = false;
13 $site_color = Config::get("quattro", "color", "dark");
14 $site_quattro_align = Config::get("quattro", "align", false);
15
16 if ($uid) {
17         $color = PConfig::get($uid, "quattro", "color", false);
18         $quattro_align = PConfig::get($uid, 'quattro', 'align', false);
19 }
20
21 if ($color === false) {
22         $color = $site_color;
23 }
24
25 if ($quattro_align === false) {
26         $quattro_align = $site_quattro_align;
27 }
28
29 if (file_exists("$THEMEPATH/$color/style.css")) {
30         echo file_get_contents("$THEMEPATH/$color/style.css");
31 }
32
33
34 if ($quattro_align == "center") {
35         echo "
36                 html { width: 100%; margin:0px; padding:0px; }
37                 body {
38                         margin: 50px auto;
39                         width: 900px;
40                 }
41         ";
42 }
43
44
45 $textarea_font_size = false;
46 $post_font_size = false;
47
48 $site_textarea_font_size = Config::get("quattro", "tfs", "20");
49 $site_post_font_size = Config::get("quattro", "pfs", "12");
50
51 if ($uid) {
52         $textarea_font_size = PConfig::get($uid, "quattro", "tfs", false);
53         $post_font_size = PConfig::get($uid, "quattro", "pfs", false);
54 }
55
56 if ($textarea_font_size === false) {
57         $textarea_font_size = $site_textarea_font_size;
58 }
59 if ($post_font_size === false) {
60         $post_font_size = $site_post_font_size;
61 }
62
63 echo "
64         textarea { font-size: ${textarea_font_size}px; }
65         .wall-item-comment-wrapper .comment-edit-text-full { font-size: ${textarea_font_size}px; }
66         #jot .profile-jot-text:focus { font-size: ${textarea_font_size}px; }
67         .wall-item-container .wall-item-content  { font-size: ${post_font_size}px; }
68 ";