2 require_once('init.php');
3 require_once('lib/general.php');
5 $theme = $_SESSION['sys']['theme'];
7 $sql = sprintf("SELECT sys_theme_items.name,value FROM sys_theme_values " .
8 "JOIN sys_theme_items ON item = sys_theme_items.id WHERE theme = %d",
10 $sth = $db->query($sql);
12 if ($sth === false) exit;
15 while ($row = $sth->fetch()) {
16 switch ($row['name']) {
17 case 'box-background':
18 $styles['div.ricoContent']['background-color'] = $row['value'];
19 $styles['div.form']['background-color'] = $row['value'];
21 case 'box-title-background':
22 $styles['div.ricoTitle']['background-color'] = $row['value'];
23 $styles['div.form p.title']['background-color'] = $row['value'];
24 $styles['.ricoLG_table th']['background-color'] = $row['value'];
26 case 'box-title-bottom':
27 $styles['div.ricoTitle']['border-bottom'] = $row['value'];
28 $styles['div.form p.title']['border-bottom'] = $row['value'];
29 $styles['.ricoLG_table th']['border-bottom'] = $row['value'];
31 case 'box-title-foreground':
32 $styles['div.ricoTitle']['color'] = $row['value'];
33 $styles['div.form p.title']['color'] = $row['value'];
34 $styles['.ricoLG_table th']['color'] = $row['value'];
35 $styles['.ricoLG_table th a']['color'] = $row['value'];
37 case 'table-selection':
38 $styles['div.ricoLG_selection']['background-color'] = $row['value'];
40 case 'title1-background':
41 $styles['h3.title']['background-color'] = $row['value'];
44 $styles['h3.title']['border-bottom'] = $row['value'];
46 case 'title2-background':
47 $styles['h3.title2']['background-color'] = $row['value'];
50 $styles['h3.title2']['border-bottom'] = $row['value'];
52 case 'details-background':
53 $styles['div.box#details']['background-color'] = $row['value'];
55 case 'form-elem-background':
56 $styles['#form_edit input:focus']['background-color'] = $row['value'];
57 $styles['#form_edit select:focus']['background-color'] = $row['value'];
58 $styles['#form_edit textarea:focus']['background-color'] = $row['value'];
63 header('Content-type: text/css');
65 if (defined('PATH_CSS') && (($f = fopen(PATH_CSS,'r')) !== false)) {
70 foreach ($styles as $name => $data) {
71 printf("%s {\n", $name);
72 foreach ($data as $key => $value)
73 printf(" %s: %s;\n", $key, $value);