$body.='}';\r
$res[] = $body;\r
\r
+ // Header\r
+ $header = '#header{';\r
+ $header.='height:' . $this->theme->parametres->menuHeight . 'px;';\r
+ $header.='background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';\r
+ if ($this->theme->parametres->menuImage != '') {\r
+ copy($this->themeRoot . '/' . $this->theme->parametres->menuImage, $this->vdir . '/data/images/' . $this->theme->parametres->menuImage);\r
+ $header.='background-image:url(../data/images/' . $this->theme->parametres->menuImage . ');';\r
+ $header.='background-repeat:no-repeat;';\r
+ $header.='background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';\r
+ }\r
+ $header.='}';\r
+ $res[] = $header;\r
+\r
// Pages styles\r
foreach ($this->cssColor as $color => $index) {\r
$res[] = '.c' . $index . '{color:#' . $color . '}';\r
\r
}\r
\r
+ public static function colorToCSS($color) {\r
+ if (strlen($color) == 6) {\r
+ return '#' . $color;\r
+ } else {\r
+ $alpha = substr($color, 0, 2);\r
+ $red = substr($color, 2, 2);\r
+ $green = substr($color, 4, 2);\r
+ $blue = substr($color, 6, 2);\r
+\r
+ $components = array('alpha', 'red', 'green', 'blue');\r
+ foreach ($components as $k => $name) {\r
+ $$name = substr($color, $k * 2, 2);\r
+ $$name = intval('0x' . $$name);\r
+ }\r
+\r
+ if ($alpha == 0) {\r
+ return 'transparent';\r
+ }\r
+ $alpha/=256;\r
+ return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')';\r
+ }\r
+ }\r
+\r
}\r
\r
?>
\ No newline at end of file