From: vincent@cubedesigners.com Date: Thu, 14 Jan 2021 17:18:05 +0000 (+0000) Subject: wip #4188 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2fa3c78c2c1576293a187c4ed353427c7ec05d20;p=cubeextranet.git wip #4188 @0.5 --- diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 9ccc1159a..1dbf7266d 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -2705,6 +2705,7 @@ class wsHTML5Compiler $x = simplexml_load_string(file_get_contents($f)); $prevurl = ''; foreach ($x->xpath('/articles/article') as $k => $a) { + $dir = isset($a['dir']) ? (string)$a['dir'] : null; $url = (string)$a['url']; $id = (string)$a['id']; $color = (string)$a['color']; @@ -2715,7 +2716,11 @@ class wsHTML5Compiler $specificStyles = '## h3, ## figure figcaption{background-color:' . $color . '}'; $specificStyles .= '## .chapo, ## blockquote, ## a{color:' . $color . ';}'; - $inner = '
'; + $inner = '
'; $inner .= '
'; if ($this->book->parametres->articlesShare && $this->book->parametres->share) { @@ -2739,7 +2744,7 @@ class wsHTML5Compiler $inner .= '

 

'; } } - $inner .= $this->_articleToHTML($child, $title, $lead, $image); + $inner .= $this->_articleToHTML($child, $title, $lead, $image, $dir); } $inner .= '
'; @@ -2807,7 +2812,7 @@ class wsHTML5Compiler * @return string|void * @throws Zend_Filter_Exception */ - protected function _articleToHTML($child, &$title, &$lead, &$image) + protected function _articleToHTML($child, &$title, &$lead, &$image, $dir = null) { $markupMap = ['category' => 'h3', 'subtitle' => 'h2', @@ -2825,12 +2830,21 @@ class wsHTML5Compiler $attrsmap = ['a' => ['link' => 'href']]; + $dirattr = ''; + if (isset($child['dir'])) { + $d = (string)$child['dir']; + if ($d !== $dir) { + $dirattr = ' dir="' . $d . '"'; + $dir = $d; + } + } + $res = ''; $tag = $child->getName(); if ($tag === 'encadre') { - $res .= ''; } else if ($tag === 'youtube') { @@ -2858,7 +2872,7 @@ class wsHTML5Compiler } else { $dim = [0 => 1024, 1 => 10]; } - $res .= '
' . $legend . '' . $caption . '
'; + $res .= '' . $legend . '' . $caption . ''; } else { $c = trim($this->SimpleXMLElement_innerXML($child)); if (!$c) { @@ -2873,7 +2887,7 @@ class wsHTML5Compiler $m = $markupMap[$tag] ?? $tag; $e = explode('.', $m); $markup = $e[0]; - $attrs = ''; + $attrs = $dirattr; if (count($e) === 2) { $attrs .= ' class="' . $e[1] . '"'; }