]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5799 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 Mar 2023 17:25:52 +0000 (18:25 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 Mar 2023 17:25:52 +0000 (18:25 +0100)
app/Jobs/FluidbookCompiler.php

index e5ea82c0fa5d125466810c76474f21b7b75f9b74..0c813fe1629f2bb03f9c8d6437fb5589bb5e9089 100644 (file)
@@ -2385,15 +2385,18 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             }
 
             $linksToAdd = [$link];
-            if ($link->overlapDoublePage() && !$this->_fluidbook->isOnePage()) {
+            if ($link->overlapDoublePage() && !$this->isOnePage()) {
                 $linksToAdd[] = $link->getRightClone();
             }
 
+
             foreach ($linksToAdd as $lta) {
                 try {
                     /** @var $lta Link */
                     // Keep this line because some properties of the link (like blend mode) are parsed with this function
                     $c = $lta->getHTMLContainer();
+
+
                     $css[] = $lta->getCSSContainer();
                     if (!isset($pages[$lta->page])) {
                         $pages[$lta->page] = ['normal' => []];
@@ -2422,6 +2425,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
                     $this->triggerLinkError($e, $lta);
                 }
             }
+
+
             // Make old "aftersearch" link compatible with new "extra" menu option by extracting link URL
             if ($link->page == 'aftersearch') {
                 $this->config->afterSearchLink = $link->to;
@@ -2443,7 +2448,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             }
         }
 
-
         $allpages = range(0, $this->getFluidbook()->getPagesNumber() + 1);
         if ($this->fluidbookSettings->themeEnableAfterSearch) {
             $allpages[] = 'aftersearch';
@@ -2469,6 +2473,14 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         return $css;
     }
 
+    /**
+     * @return bool
+     */
+    public function isOnePage(): bool
+    {
+        return $this->_fluidbook->isOnePage();
+    }
+
     /**
      * @param $e \Exception
      * @param $link Link
@@ -2767,6 +2779,11 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         $this->vdir->copyDirectory($this->assets . '/js/libs/polyfills', 'js/libs/polyfills');
     }
 
+    public function getCacheDir($path): string
+    {
+        return Files::mkdir(protected_path('fluidbookpublication/cache/' . $path));
+    }
+
     public function writeTexts()
     {
         $cache = sha1($this->fluidbookSettings->highlightResults . '/--/' . $this->fluidbookSettings->searchWordSelectionAlgorithm . '///' . $this->fluidbookSettings->textExtraction . '|--|' . $this->fluidbookSettings->ignoreSearchSeparators . '|||' . $this->getFluidbook()->getCompositionUpdate() . '()()()' . FWSTK::lastUpdate());
@@ -3869,7 +3886,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
      * @param $lead
      * @param $image
      * @return string|void
-     * @throws Zend_Filter_Exception
      */
     protected function _articleToHTML($child, &$title, &$lead, &$image, $dir = null)
     {