'video_loop' => __('Video : boucle'), 'video_auto_start' => __('Video : démarrage automatique'), 'video_controls' => __('Vidéo : afficher les contrôles'), 'video_sound_on' => __('Vidéo : activer le son'),\r
'inline' => __('Vidéo : afficher dans la page'), 'video_width' => __('Vidéo : Largeur du popup'), 'video_height' => __('Vidéo : Hauteur du popup'),\r
'interactive' => __('Interactivité'), 'video_service' => __('Webvideo : service'),\r
- 'display_area'=>__('Afficher le lien au rollover')\r
+ 'display_area' => __('Afficher le lien au rollover')\r
);\r
\r
$xls = new PHPExcel();\r
if ($l[$id] == 'false') {\r
$l[$id] = 'physical';\r
}\r
- }else if($id=='display_area'){\r
- if($l[$id]==''){\r
- $l[$id]='1';\r
+ } else if ($id == 'display_area') {\r
+ if ($l[$id] == '') {\r
+ $l[$id] = '1';\r
}\r
}\r
$value = $l[$id];\r
}\r
- \r
+\r
$s->setCellValueByColumnAndRow($i, $j, $value);\r
$s->getStyleByColumnAndRow($i, $j)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\r
$i++;\r
$dao->updateFromObject($doc);\r
}\r
\r
- public static function getParamsHelp() {\r
+ public static function getParamsHelp($args) {\r
commonDroits::min(5);\r
+ global $core;\r
\r
$res = '';\r
\r
- $theme = new wsThemeParametres(new wsTheme());\r
- $res .= self::formatHelp($theme->getHelp());\r
+ if (isset($args[1]) && $args[1] != '') {\r
+ $dao = new wsDAOBook($core->con);\r
+ $b = $dao->selectById($args[1]);\r
\r
- $book = new wsBookParametres(new wsBook());\r
- $res .= self::formatHelp($book->getHelp());\r
+ $daoTheme = new wsDAOTheme($core->con);\r
+ $t = $daoTheme->getThemeOfBook($args[1], true);\r
\r
- header('Content-type: text/plain; charset=UTF-8');\r
- ob_clean();\r
- echo $res;\r
- exit;\r
+ $book = $b->parametres;\r
+ $theme = $t->parametres;\r
+ } else {\r
+ $theme = new wsThemeParametres(new wsTheme());\r
+ $book = new wsBookParametres(new wsBook());\r
+ }\r
+\r
+ $res = commonPage::barre();\r
+ $res .= commonPage::tMain();\r
+ $res.=commonPage::bh();\r
+ $res.='<table class="liste">';\r
+ $res.= self::formatHelp($theme->getHelp());\r
+ $res.='</table>';\r
+ $res.=commonPage::bf();\r
+ $res.=commonPage::bh();\r
+ $res.='<table class="liste">';\r
+ $res.= self::formatHelp($book->getHelp());\r
+ $res.='</table>';\r
+ $res.=commonPage::bf();\r
+ $res .= commonPage::bMain();\r
+\r
+ return $res;\r
}\r
\r
public static function formatHelp($rubriques) {\r
\r
$res = '';\r
foreach ($rubriques as $label => $fields) {\r
- $res .= "\n" . '-------------------------' . "\n";\r
- $res .= $label . "\n";\r
- $res .= '-------------------------' . "\n\n";\r
- foreach ($fields as $name => $label) {\r
- if ($label == '|') {\r
- $res .= '--' . "\n";\r
+ $res.='<tr class="odd"><th colspan="5">' . $label . '</th></tr>';\r
+ foreach ($fields as $name => $t) {\r
+ if (is_string($t) && $t == '|') {\r
+ $res .= '<tr class="odd"><th></th></tr>';\r
} else {\r
- $res .= $name . str_repeat("\t", 4 - floor(strlen($name) / 8)) . ': ' . $label . "\n";\r
+ $res.= '<tr>';\r
+ foreach ($t as $tt) {\r
+ $res.='<td>' . $tt . '</td>';\r
+ }\r
+ $res.='</tr>';\r
}\r
}\r
}\r
<?php\r
+\r
class wsParametres extends cubeMetier implements Iterator {\r
+\r
protected $datas;\r
protected $fields;\r
protected $forms;\r
protected $parent;\r
+\r
// Magic functions\r
- public function __construct($parent)\r
- {\r
+ public function __construct($parent) {\r
$this->parent = $parent;\r
$this->initFields();\r
$this->datas = array();\r
}\r
\r
- public function isEmpty()\r
- {\r
+ public function isEmpty() {\r
return count($this->datas) == 0;\r
}\r
\r
- public function setParent($parent)\r
- {\r
+ public function setParent($parent) {\r
$this->parent = $parent;\r
$this->initFields();\r
}\r
\r
- public function __set($varname, $value)\r
- {\r
- if(empty($varname)){\r
+ public function __set($varname, $value) {\r
+ if (empty($varname)) {\r
return;\r
}\r
$this->set($varname, $value);\r
}\r
\r
- public function __unset($varname)\r
- {\r
+ public function __unset($varname) {\r
$this->set($varname, null);\r
}\r
\r
- public function __get($varname)\r
- {\r
+ public function __get($varname) {\r
return $this->get($varname);\r
}\r
\r
- public function __isset($varname)\r
- {\r
+ public function __isset($varname) {\r
return $this->_isset($varname);\r
}\r
\r
- public function __sleep()\r
- {\r
+ public function __sleep() {\r
return array('datas');\r
}\r
\r
- public function __wakeup()\r
- {\r
+ public function __wakeup() {\r
$this->initFields();\r
}\r
+\r
// Iterator functions\r
- public function rewind()\r
- {\r
+ public function rewind() {\r
reset($this->fields);\r
}\r
\r
- public function current()\r
- {\r
+ public function current() {\r
return $this->get($this->key());\r
}\r
\r
- public function key()\r
- {\r
+ public function key() {\r
return key($this->fields);\r
}\r
\r
- public function next()\r
- {\r
+ public function next() {\r
return next($this->fields);\r
}\r
\r
- public function valid()\r
- {\r
+ public function valid() {\r
return $this->_isset($this->key());\r
}\r
\r
- protected function initFields()\r
- {\r
+ protected function initFields() {\r
$this->fields = array();\r
$this->forms = array();\r
}\r
\r
- protected function set($varname, $value)\r
- {\r
+ protected function set($varname, $value) {\r
if (!$this->_isset($varname)) {\r
throw new Exception('You are setting an attribute (' . get_class($this) . '::' . $varname . ') which not exists');\r
}\r
break;\r
case 'boolean':\r
if (!is_bool($value)) {\r
- $value = ($value == '' || $value == '0' || $value == 'false')?false:true;\r
+ $value = ($value == '' || $value == '0' || $value == 'false') ? false : true;\r
}\r
break;\r
case 'color':\r
case 'couleur':\r
$value = cubeMath::fill(ltrim($value, '#'), 6);\r
- fb($value);\r
break;\r
+ case 'couleurAlpha':\r
+ $value = cubeMath::fill(ltrim($value, '#'), 6);\r
+ $value=cubeMath::fill($value,8,'f');\r
case 'date':\r
if (!is_int($value)) {\r
$value = intval($value);\r
$value = array_pop($e);\r
break;\r
default:\r
- $value = (string)$value;\r
+ $value = (string) $value;\r
break;\r
} // switch\r
$this->datas[$varname] = $value;\r
}\r
\r
- protected function _isset($varname)\r
- {\r
+ protected function _isset($varname) {\r
return isset($this->fields[$varname]) && isset($this->fields[$varname]['default']);\r
}\r
\r
- protected function get($varname)\r
- {\r
+ protected function get($varname) {\r
if (is_null($varname)) {\r
return false;\r
}\r
throw new Exception('You are getting an attribute (' . get_class($this) . '::' . $varname . ') which not exists');\r
}\r
if (!isset($this->datas[$varname]) || is_null($this->datas[$varname])) {\r
- if (substr($this->fields[$varname]['default'], 0, 1) == '$') {\r
- return $this->get(substr($this->fields[$varname]['default'], 1));\r
- } else {\r
- return $this->fields[$varname]['default'];\r
- }\r
+ return $this->getDefault($varname);\r
}\r
return $this->datas[$varname];\r
}\r
\r
- public function getForm($name)\r
- {\r
+ protected function getDefault($varname) {\r
+ if (substr($this->fields[$varname]['default'], 0, 1) == '$') {\r
+ return $this->get(substr($this->fields[$varname]['default'], 1));\r
+ } else {\r
+ return $this->fields[$varname]['default'];\r
+ }\r
+ }\r
+\r
+ public function getForm($name) {\r
$f = $this->forms[$name];\r
$f['fields'] = array();\r
- foreach($f['fieldsnames'] as $n) {\r
+ foreach ($f['fieldsnames'] as $n) {\r
if ($n == '|') {\r
$f['fields'][] = '|';\r
} else {\r
return $f;\r
}\r
\r
- public function getForms()\r
- {\r
+ public function getForms() {\r
return array_keys($this->forms);\r
}\r
\r
- public function fromRecord($r)\r
- {\r
+ public function fromRecord($r) {\r
$c = array_flip($r->columns());\r
- foreach($this->fields as $n => $f) {\r
+ foreach ($this->fields as $n => $f) {\r
if (isset($c[$n]) && !is_null($r->$n)) {\r
$this->set($n, $r->$n);\r
}\r
}\r
}\r
\r
- public function fromXML($xml)\r
- {\r
- foreach($this->fields as $n => $f) {\r
+ public function fromXML($xml) {\r
+ foreach ($this->fields as $n => $f) {\r
$xp = $xml->$n;\r
if (!$xp || !count($xp)) {\r
continue;\r
}\r
- foreach($xp as $x) {\r
+ foreach ($xp as $x) {\r
$this->set($n, $x);\r
}\r
}\r
}\r
\r
- public function toStandardObject()\r
- {\r
+ public function toStandardObject() {\r
$res = new stdClass();\r
- foreach($this as $k => $v) {\r
+ foreach ($this as $k => $v) {\r
$res->$k = $v;\r
}\r
return $res;\r
}\r
\r
- public function getHelp()\r
- {\r
+ public function getHelp() {\r
$rubriques = array();\r
- foreach($this->forms as $name => $form) {\r
+ foreach ($this->forms as $name => $form) {\r
$rub = array();\r
- foreach($form['fieldsnames'] as $f) {\r
+ foreach ($form['fieldsnames'] as $f) {\r
if ($f == '|') {\r
$rub[] = '|';\r
} else {\r
+\r
+ $d = self::formatValueForHelp($this->getDefault($f));\r
+ $v = self::formatValueForHelp($this->get($f));\r
+ if ($d != $v) {\r
+ $v = '<strong>' . $v . '</strong>';\r
+ }\r
+\r
+\r
$field = $this->fields[$f];\r
- $rub[$f] = '(' . $field['type'] . ')' . str_repeat("\t", 2 - floor((strlen($field['type']) + 2) / 12)) . $field['label'];\r
+ $t = array();\r
+ $t[] = $f;\r
+ $t[] = $field['type'];\r
+ $t[] = $field['label'];\r
+ $t[] = $d;\r
+ $t[] = $v;\r
+ $rub[$f] = $t;\r
}\r
}\r
$rubriques[$form['label']] = $rub;\r
}\r
return $rubriques;\r
}\r
+\r
+ public static function formatValueForHelp($v) {\r
+ if (is_bool($v)) {\r
+ $v = ($v) ? 'true' : 'false';\r
+ }\r
+ return $v;\r
+ }\r
+\r
}\r
\r
?>
\ No newline at end of file
\r
parent::initFields();\r
/* Navigation */\r
- $this->fields['couleurA'] = array('type' => 'couleurAlpha', 'default' => '', 'editable' => true,\r
+ $this->fields['couleurA'] = array('type' => 'couleurAlpha', 'default' => 'ff000000', 'editable' => true,\r
'label' => __("Couleur de fond"));\r
$this->fields['arrowsColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
'label' => __('Couleur des flèches'));\r
\r
$imagesize = getimagesize(WS_DOCS . '/' . $this->pages[1]['document_id'] . '/html/h72-' . $this->pages[1]['document_page'] . '.jpg');\r
$this->pdf2htmlRatio = $imagesize[0] / $this->layouts[1]['width'];\r
- $this->scale = 1;\r
+ $this->scale = 4;\r
$this->multiply = $this->pdf2htmlRatio * $this->scale;\r
\r
$this->createHTML();\r
$this->div[$page][] = $this->addLine($line, $document_id);\r
}\r
}\r
-\r
- mkdir($this->vdir . '/style', 0777, true);\r
- mkdir($this->vdir . '/contents', 0777, true);\r
- mkdir($this->vdir . '/images', 0777, true);\r
mkdir($this->vdir . '/data/images', 0777, true);\r
+ mkdir($this->vdir . '/data/contents', 0777, true);\r
+ mkdir($this->vdir . '/data/background', 0777, true);\r
+ mkdir($this->vdir . '/data/style', 0777, true);\r
\r
foreach ($this->div as $n => $page) {\r
- file_put_contents($this->vdir . '/contents/p' . $n . '.html', $this->writePage($page));\r
+ file_put_contents($this->vdir . '/data/contents/p' . $n . '.html', $this->writePage($page));\r
}\r
$this->writeFonts();\r
$this->writeImages();\r
$this->writeTheme();\r
- file_put_contents($this->vdir . '/style/style.css', $this->writeCSS());\r
+ file_put_contents($this->vdir . '/data/style/style.css', $this->writeCSS());\r
\r
file_put_contents($this->vdir . '/data/datas.js', $this->writeConfig());\r
}\r
foreach ($this->cssFont as $font => $index) {\r
list($font, $document_id) = explode('//', $font);\r
foreach ($fext as $ext) {\r
- copy(WS_DOCS . '/' . $document_id . "/fonts/web/" . $font . '.' . $ext, $this->vdir . '/style/F' . $index . '.' . $ext);\r
+ copy(WS_DOCS . '/' . $document_id . "/fonts/web/" . $font . '.' . $ext, $this->vdir . '/data/style/F' . $index . '.' . $ext);\r
}\r
}\r
}\r
protected function writeImages() {\r
\r
foreach (self::$resolutions as $r) {\r
- mkdir($this->vdir . '/images/' . $r, 0777);\r
+ mkdir($this->vdir . '/data/background/' . $r, 0777);\r
}\r
foreach ($this->pages as $page => $infos) {\r
foreach (self::$resolutions as $r) {\r
- copy(WS_DOCS . '/' . $infos['document_id'] . '/html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/images/' . $r . '/p' . $page . '.jpg');\r
+ copy(WS_DOCS . '/' . $infos['document_id'] . '/html/h' . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/p' . $page . '.jpg');\r
}\r
}\r
}\r
\r
\r
// General theme\r
- $h = $this->t->parametres->height . 'px';\r
+ $h = $this->book->parametres->height . 'px';\r
$w2 = ($this->book->parametres->width * 2) . 'px';\r
$w = $this->book->parametres->width . 'px';\r
\r
$navTop = ($this->book->parametres->height - 40 - 100) / 2;\r
$res[] = '.portrait #pages,.portrait .doublePage.page,.texts,.page,.background{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';\r
- $res[] = '.background{background-size:' . $w . 'px ' . $h . 'px;}';\r
+ $res[] = '.background{background-size:' . $w . ' ' . $h . ';}';\r
$res[] = '.doublePage,#pages{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';\r
$res[] = '.page.right{left:' . $w . '}';\r
\r
// Theme\r
// Background\r
- $body = 'body{';\r
+ $body = '#main{';\r
$body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';\r
switch ($this->theme->parametres->repeat) {\r
case wsTheme::REPEAT:\r
}\r
if ($this->theme->parametres->backgroundImage != '') {\r
copy($this->themeRoot . '/' . $this->theme->parametres->backgroundImage, $this->vdir . '/data/images/' . $this->theme->parametres->backgroundImage);\r
- $body.='background-image:url(../data/images/' . $this->theme->parametres->backgroundImage . ');';\r
+ $body.='background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';\r
$body.='background-position:';\r
\r
\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-image:url(../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
+ // Logo\r
+ $logo = '#logo{';\r
+\r
+ $logo.='}';\r
+\r
+ // Credits\r
+ $res[] = '#credits,#credits a{color:' . self::colorToCSS($this->theme->parametres->creditsColor) . ';}';\r
+\r
+ // Arrows\r
+ $res[] = '#next,#previous{background-color:' . self::colorToCSS($this->theme->parametres->couleurA) . ';}';\r
+ // Book shadow\r
+ $shadowColor = self::colorToCSS($this->theme->parametres->bookShadeColor);\r
+ if ($shadowColor != 'transparent') {\r
+ $res[] = '#pages{' . $this->writeCSSUA('box-shadow', '0 0 20px ' . $shadowColor) . '}';\r
+ }\r
+\r
// Pages styles\r
foreach ($this->cssColor as $color => $index) {\r
$res[] = '.c' . $index . '{color:#' . $color . '}';\r
}\r
\r
protected function getCSSSize(&$size) {\r
- $size = $this->normalizeFloatValue($size, 1);\r
+ $size = $this->normalizeFloatValue($size*$this->multiply, 3);\r
$sizer = $size;\r
return $this->getIndex($sizer, $this->cssSize);\r
}\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
+ $hex = substr($color, $k * 2, 2);\r
+ $$name = intval($hex, 16);\r
+ fb($hex . '->' . $$name, $name);\r
}\r
-\r
+ $alpha/=255;\r
if ($alpha == 0) {\r
return 'transparent';\r
+ } elseif ($alpha == 1) {\r
+ return '#' . substr($color, 2, 6);\r
}\r
- $alpha/=256;\r
return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')';\r
}\r
}\r