require_once('init.php');
require_once('lib/general.php');
-$theme = 2;
+$theme = $_SESSION['sys']['theme'];
-$sql = sprintf("SELECT sys_theme_keys.name,value FROM sys_theme_values " .
- "JOIN sys_theme_keys ON key = sys_theme_keys.id WHERE theme = %d",
+$sql = sprintf("SELECT sys_theme_items.name,value FROM sys_theme_values " .
+ "JOIN sys_theme_items ON item = sys_theme_items.id WHERE theme = %d",
$theme);
-$sth = pg_query($sql);
+$sth = $db->query($sql);
if ($sth === false) exit;
$styles = array();
-while ($row = pg_fetch_assoc($sth)) {
+while ($row = $sth->fetch()) {
switch ($row['name']) {
case 'box-background':
$styles['div.ricoContent']['background-color'] = $row['value'];
case 'title2-bottom':
$styles['h3.title2']['border-bottom'] = $row['value'];
break;
+ case 'details-background':
+ $styles['div.box#details']['background-color'] = $row['value'];
+ break;
+ case 'form-elem-background':
+ $styles['#form_edit input:focus']['background-color'] = $row['value'];
+ $styles['#form_edit select:focus']['background-color'] = $row['value'];
+ $styles['#form_edit textarea:focus']['background-color'] = $row['value'];
+ break;
}
}
-error_log(var_export($styles,true));
header('Content-type: text/css');
+if (defined('PATH_CSS') && (($f = fopen(PATH_CSS,'r')) !== false)) {
+ fpassthru($f);
+ fclose($f);
+}
+
foreach ($styles as $name => $data) {
printf("%s {\n", $name);
foreach ($data as $key => $value)