\r
$daoTheme = new wsDAOTheme($this->con);\r
$theme = $daoTheme->getThemeOfBook($this->args['book_id'], true);\r
- $themeRoot = WS_THEMES . '/' . $theme->theme_id . '/';\r
- if ($theme->parametres->backgroundImage != '' && in_array($theme->parametres->repeat, array(2, 3))) {\r
- $dim = getimagesize($themeRoot . $theme->parametres->backgroundImage);\r
- $b = $this->xml->addChild('background');\r
- $b->addChild('width', $dim[0]);\r
- $b->addChild('height', $dim[1]);\r
- $b->addChild('url', 'http://' . $_SERVER['HTTP_HOST'] . WEBROOT . '/fluidbook/themes/' . $theme->theme_id . '/' . $theme->parametres->backgroundImage);\r
+\r
+ $specials = array('backgroundImage' => 'background', 'topBar' => 'topbar', 'afterSearch' => 'aftersearch');\r
+\r
+ foreach ($specials as $tparam => $sname) {\r
+ $this->_addSpecialInfos($theme, $tparam, $sname);\r
}\r
+ }\r
\r
- if ($theme->parametres->topBar != '') {\r
- $dim = getimagesize($themeRoot . $theme->parametres->topBar);\r
- $b = $this->xml->addChild('topbar');\r
+ protected function _addSpecialInfos($theme, $param, $specialName) {\r
+ if ($theme->parametres->$param != '') {\r
+ $themeRoot = WS_THEMES . '/' . $theme->theme_id . '/';\r
+ $dim = getimagesize($themeRoot . $theme->parametres->$param);\r
+ $b = $this->xml->addChild($specialName);\r
$b->addChild('width', $dim[0]);\r
$b->addChild('height', $dim[1]);\r
- $b->addChild('url', 'http://' . $_SERVER['HTTP_HOST'] . WEBROOT . '/fluidbook/themes/' . $theme->theme_id . '/' . $theme->parametres->topBar);\r
+ $b->addChild('url', 'http://' . $_SERVER['HTTP_HOST'] . WEBROOT . '/fluidbook/themes/' . $theme->theme_id . '/' . $theme->parametres->$param);\r
}\r
}\r
\r
if ($theme->parametres->logo != '') {\r
$flex->addBitmap($themeRoot . $theme->parametres->logo, 'logo');\r
}\r
+\r
+ if ($theme->parametres->afterSearch != '') {\r
+ $flex->addBitmap($themeRoot . $theme->parametres->afterSearch, 'aftersearch');\r
+ }\r
+\r
// Icons assets\r
$iconsRoot = WS_ICONS . '/' . $theme->parametres->iconSet . '/';\r
foreach (wsIcone::$files as $file) {\r