public function writeCartConfig()
{
- if($this->book->parametres->cartLinkAppearance=='overlay'){
- $this->svgfiles[]=$this->assets . '/images/symbols/cart-overlay.svg';
- }
+ if ($this->book->parametres->cartLinkAppearance == 'overlay') {
+ $this->svgfiles[] = $this->assets . '/images/symbols/cart-overlay.svg';
+ }
if ($this->config->basket) {
$this->addJsLib('cart', 'js/libs/fluidbook/fluidbook.cart.js');
foreach ($linksCopy as $k => $linkData) {
if ($linkData['type'] == 26 || $linkData == 40) {
+ $linkData['to']=anchorLink::normalizeAnchor($linkData['to']);
$anchorExists[$linkData['to']] = $linkData;
}
if ($linkData['type'] == 35 || $linkData['type'] == 15 || $linkData['type'] == 39) {
if ($this->book->parametres->anchorsAliases && file_exists($this->book->parametres->anchorsAliases)) {
$aliases = [];
$anchors = [];
- $lines = CubeIT_Util_Text::explodeNewLines(file_get_contents($this->book->parametres->anchorsAliases));
- foreach ($lines as $line) {
- $e = explode("\t", $line);
- $from = trim($e[0]);
- $to = trim($e[1]);
- $aliases[$from] = $to;
- if (is_numeric($to) && !isset($anchorExists[$from])) {
- $anchor = [
- 'page' => $to,
- 'top' => 0,
- 'left' => 0,
- 'width' => 100,
- 'height' => 100,
- 'type' => 26,
- 'to' => $from,
- 'uid' => wsHTML5Link::generateUID()
- ];
- $anchorExists[$from] = $anchor;
- $links[] = $anchor;
- } else {
- if (!isset($anchorExists[$from]) && isset($anchorExists[$to])) {
- $anchor = $anchorExists[$to];
- $anchor['to'] = $from;
- $anchor['uid'] = wsHTML5Link::generateUID();
+ for ($i = 0; $i <= 2; $i++) {
+ $lines = CubeIT_Util_Text::explodeNewLines(file_get_contents($this->book->parametres->anchorsAliases));
+ foreach ($lines as $line) {
+ $e = explode("\t", $line);
+ $from = anchorLink::normalizeAnchor($e[0]);
+ $to = anchorLink::normalizeAnchor($e[1]);
+ $aliases[$from] = $to;
+ if (is_numeric($to) && !isset($anchorExists[$from])) {
+ $anchor = [
+ 'page' => $to,
+ 'top' => 0,
+ 'left' => 0,
+ 'width' => 100,
+ 'height' => 100,
+ 'type' => 26,
+ 'to' => $from,
+ 'uid' => wsHTML5Link::generateUID()
+ ];
$anchorExists[$from] = $anchor;
$links[] = $anchor;
+ } else {
+ if (!isset($anchorExists[$from]) && isset($anchorExists[$to])) {
+ $anchor = $anchorExists[$to];
+ $anchor['to'] = $from;
+ $anchor['uid'] = wsHTML5Link::generateUID();
+ $anchorExists[$from] = $anchor;
+ $links[] = $anchor;
+ }
}
}
}