class Depth extends SelectFromArray
{
protected $_ajax = false;
- protected $_allowNull=false;
+ protected $_allowNull = false;
- protected $_default=-1;
+ protected $_default = -1;
public function getOptions()
{
return [
-1 => __('Par défaut'),
- 0 => '0 - ' . __('Sous le fond des pages (invisible)'),
- 10 => '1 - ' . __('Sous le texte'),
- 20 => '2 - ' . __('Sous le texte'),
- 30 => '3 - ' . __('Sur la couche de texte'),
- 40 => '4 - ' . __('Sur la couche de texte'),
- 50 => '5 - ' . __('Couche multimedia interactive'),
- 60 => '6 - ' . __('Couche interactive'),
- 70 => '7 - ' . __('Couche interactive'),
- 80 => '8 - ' . __('Couche interactive'),
+ 0 => '0.0 - ' . __('Sous le fond des pages (invisible)'),
+ 10 => '1.0 - ' . __('Sous le texte'),
+ 20 => '2.0 - ' . __('Sous le texte'),
+ 30 => '3.0 - ' . __('Sur le texte'),
+ 32 => '3.2 - ' . __('Sur le texte'),
+ 34 => '3.4 - ' . __('Sur le texte'),
+ 36 => '3.6 - ' . __('Sur le texte'),
+ 38 => '3.8 - ' . __('Sur le texte'),
+ 40 => '4.0 - ' . __('Sur le texte'),
+ 42 => '4.2 - ' . __('Sur le texte'),
+ 44 => '4.4 - ' . __('Sur le texte'),
+ 46 => '4.6 - ' . __('Sur le texte'),
+ 48 => '4.8 - ' . __('Sur le texte'),
+ 50 => '5.0 - ' . __('Couche multimedia interactive'),
+ 60 => '6.0 - ' . __('Couche interactive'),
+ 70 => '7.0 - ' . __('Couche interactive'),
+ 80 => '8.0 - ' . __('Couche interactive'),
//90=>'9 - '.__('Au dessus de l\'ombre de la page'),
];
}
return !$this->isSinglePage();
}
- /**
- * @param $e \Exception
- * @param $link Link
- * @return void
- * @throws \Exception
- */
- protected function triggerLinkError($e, $link)
- {
- Log::error($e);
- /*$c = explode('\\', get_class($link));
- $type = array_pop($c);
- $type = str_replace('Link', '', $type);
-
- throw new \Exception('Error on the ' . $type . ' link to ' . $link->to . ' on page ' . $link->page . ' with message : ' . $e->getMessage());*/
- }
-
- protected function _htmlLinkList($list)
- {
- if (!count($list)) {
- return [];
- }
- $res = [];
- foreach ($list as $blendmode => $l) {
- usort($l, [$this, '_sortLinksByDepth']);
- $res[$blendmode] = [];
- foreach ($l as $item) {
- $res[$blendmode][] = $item->getHTMLContainer();
- }
-
- }
- return $res;
-
- }
public function getBookSurface()
{
return $this->width * $this->height;
}
- protected function _sortLinksByDepth($a, $b)
- {
- $c = $a->getDepth() - $b->getDepth();
- if ($c === 0) {
- $c = $b->getSurface() - $a->getSurface();
- }
- if ($c === 0) {
- $c = $b->getInitialOrder() - $a->getInitialOrder();
- }
- return $c;
- }
public function addSlideshowLibrary($inline = true)
{
use Cubist\Util\Text;
use Fluidbook\Tools\Links\AnchorLink;
use Fluidbook\Tools\Links\ContentLink;
+use Illuminate\Support\Facades\Log;
trait Links
{
}
$lta->setInitialOrder($i);
- if (!isset($$v[$lta->page][$lta->blendmode])) {
- $$v[$lta->page][$lta->blendmode] = [];
- }
+// if (!isset($$v[$lta->page][$lta->blendmode])) {
+// $$v[$lta->page][$lta->blendmode] = [];
+// }
- array_push($$v[$lta->page][$lta->blendmode], $lta);
+ // array_push($$v[$lta->page][$lta->blendmode], $lta);
+ array_push($$v[$lta->page]['normal'], $lta);
$i++;
} catch (\Exception $e) {
$this->triggerLinkError($e, $lta);
}
}
+
+ /**
+ * @param $e \Exception
+ * @param $link Link
+ * @return void
+ * @throws \Exception
+ */
+ protected function triggerLinkError($e, $link)
+ {
+ Log::error($e);
+
+ /*$c = explode('\\', get_class($link));
+ $type = array_pop($c);
+ $type = str_replace('Link', '', $type);
+
+ throw new \Exception('Error on the ' . $type . ' link to ' . $link->to . ' on page ' . $link->page . ' with message : ' . $e->getMessage());*/
+ }
+
+ protected function _htmlLinkList($list)
+ {
+ if (!count($list)) {
+ return [];
+ }
+ $res = [];
+ foreach ($list as $blendmode => $l) {
+ usort($l, [$this, '_sortLinksByDepth']);
+ $res[$blendmode] = [];
+ foreach ($l as $item) {
+ $res[$blendmode][] = $item->getHTMLContainer();
+ }
+
+ }
+ return $res;
+
+ }
+
+ protected function _sortLinksByDepth($a, $b)
+ {
+ $c = $a->getDepth() - $b->getDepth();
+ if ($c === 0) {
+ $c = $b->getSurface() - $a->getSurface();
+ }
+ if ($c === 0) {
+ $c = $b->getInitialOrder() - $a->getInitialOrder();
+ }
+
+ return $c;
+ }
}
if (!$this->isOnePage()) {
$w = $this->getPageWidth();
foreach ($links as $k => $link) {
- if ($link['left'] > $w && $link['page'] % 2 == 0) {
+ if ($link['left'] > $w && is_numeric($link['page']) && $link['page'] % 2 == 0) {
$links[$k]['left'] -= $w;
$links[$k]['page']++;
}