]> git.mxchange.org Git - friendica-addons.git/blob - jappixmini/jappix/php/read-design.php
Twitter: Fetch the contact relation
[friendica-addons.git] / jappixmini / jappix / php / read-design.php
1 <?php
2
3 /*
4
5 Jappix - An open social platform
6 This is the design configuration reader
7
8 -------------------------------------------------
9
10 License: AGPL
11 Author: Vanaryon
12 Last revision: 28/12/10
13
14 */
15
16 // Someone is trying to hack us?
17 if(!defined('JAPPIX_BASE'))
18         exit;
19
20 // Get the available backgrounds
21 $backgrounds = getBackgrounds();
22 $backgrounds_number = count($backgrounds);
23
24 // Read the background configuration
25 $background = readBackground();
26
27 // Backgrounds are missing?
28 if(!$backgrounds_number && ($background['type'] == 'image'))
29         $background['type'] = 'default';
30
31 switch($background['type']) {
32         // Simple notice input
33         case 'image':
34                 $background_image = ' checked=""';
35                 $background_default = '';
36                 
37                 break;
38         
39         // Advanced notice input
40         case 'color':
41                 $background_color = ' checked=""';
42                 $background_default = '';
43                 
44                 break;
45 }
46
47 switch($background['image_repeat']) {
48         // No repeat
49         case 'no-repeat':
50                 $background_image_repeat_no = ' selected=""';
51                 $background_image_repeat_x = '';
52                 
53                 break;
54                 
55         // Repeat
56         case 'repeat':
57                 $background_image_repeat_all = ' selected=""';
58                 $background_image_repeat_x = '';
59                 
60                 break;
61         
62         // Y repeat
63         case 'repeat-y':
64                 $background_image_repeat_y = ' selected=""';
65                 $background_image_repeat_x = '';
66                 
67                 break;
68 }
69
70 switch($background['image_horizontal']) {
71         // Left position
72         case 'left':
73                 $background_image_horizontal_left = ' selected=""';
74                 $background_image_horizontal_center = '';
75                 
76                 break;
77         
78         // Right position
79         case 'right':
80                 $background_image_horizontal_right = ' selected=""';
81                 $background_image_horizontal_center = '';
82                 
83                 break;
84 }
85
86 switch($background['image_vertical']) {
87         // Left position
88         case 'top':
89                 $background_image_vertical_top = ' selected=""';
90                 $background_image_vertical_center = '';
91                 
92                 break;
93         
94         // Right position
95         case 'bottom':
96                 $background_image_vertical_bottom = ' selected=""';
97                 $background_image_vertical_center = '';
98                 
99                 break;
100 }
101
102 if($background['image_adapt'] == 'on')
103         $background_image_adapt = ' checked=""';
104
105 // Read the notice configuration
106 $notice_conf = readNotice();
107 $notice_text = $notice_conf['notice'];
108
109 switch($notice_conf['type']) {
110         // Simple notice input
111         case 'simple':
112                 $notice_simple = ' checked=""';
113                 $notice_none = '';
114                 
115                 break;
116         
117         // Advanced notice input
118         case 'advanced':
119                 $notice_advanced = ' checked=""';
120                 $notice_none = '';
121                 
122                 break;
123 }
124
125 ?>