]> _ Git - cubeextranet.git/commitdiff
wip #4779 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 12 Oct 2021 14:08:56 +0000 (14:08 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 12 Oct 2021 14:08:56 +0000 (14:08 +0000)
inc/ws/Controlleur/class.ws.maintenance.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Metier/class.ws.theme.parametres.php

index 33470b80d3bdfbe64efece845f0961343dae2f32..564793e85bb16b9729d4bf435d7c572688e76682 100644 (file)
@@ -1558,6 +1558,122 @@ class wsMaintenance
         $dao = new wsDAOTheme($core->con);
         print_r($dao->selectById('3641'));
     }
+
+    public static function getAdditionalSettingsMap(): array
+    {
+        return ['book_id' => 'book_id', 'lang' => 'lang', 'theme' => 'theme', 'status' => 'status', 'proprietaire_id' => 'owner', 'date' => 'date', 'changedate' => 'changedate', 'wslink' => 'wslink', 'hosting' => 'hosting', 'exportdatas' => 'exportdata'];
+    }
+
+    public static function getReadonlySettings()
+    {
+        return ['book_id', 'date', 'changedate', 'wslink', 'hosting', 'exportdatas'];
+    }
+
+
+    public static function exportPublicationSettings($books = null, $title = 'Settings')
+    {
+
+        set_time_limit(0);
+        if (null === $books || !count($books)) {
+            wsDroits::admin(true);
+            global $core;
+            $dao = new wsDAOBook($core->con);
+            $books = $dao->getListe('book_id', 'DESC');
+        }
+
+        $p = new wsBookParametres(new wsBook());
+
+        $xls = new PHPExcel();
+        $sheet = $xls->getActiveSheet();
+        $sheet->freezePane('B2');
+        $standardSettings = self::getAdditionalSettingsMap();
+        $readonlyList = self::getReadonlySettings();
+        $j = 0;
+        foreach ($standardSettings as $column => $label) {
+            if ($label !== 'exportdata') {
+                $sheet->getColumnDimensionByColumn($j)->setAutoSize(true);
+            }
+
+            if (in_array($column, $readonlyList, true)) {
+                self::_readonlyStyle($sheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($j)));
+            }
+            $sheet->setCellValueByColumnAndRow($j, 1, $label);
+            $j++;
+        }
+        $paramCols = [];
+        foreach ($p->getForms() as $form) {
+            $form = $p->getForm($form, true);
+            foreach ($form['fields'] as $k => $field) {
+                $readonly = false;
+                if (!$field['editable']) {
+                    $readonly = true;
+                }
+
+                if ($readonly) {
+                    self::_readonlyStyle($sheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($j)));
+                }
+                $sheet->getCommentByColumnAndRow($j, 1)->getText()->createTextRun($field['label']);
+                $sheet->getColumnDimensionByColumn($j)->setAutoSize(true);
+                $sheet->setCellValueByColumnAndRow($j, 1, $k);
+
+                $paramCols[] = $k;
+                $j++;
+            }
+        }
+
+        $i = 2;
+        foreach ($books as $id => $book) {
+            $j = 0;
+            foreach ($standardSettings as $column => $label) {
+                $url = false;
+                if ($column === 'hosting') {
+                    $export = json_decode($book->exportdatas, true);
+                    if (isset($export['install_hosting']['online']['dir']) && $export['install_hosting']['online']['dir']) {
+                        $val = 'https://hosting.fluidbook.com/' . $export['install_hosting']['online']['dir'];
+                        $url = $val;
+                    } else {
+                        $val = '-';
+                    }
+                } else if ($column === 'wslink') {
+                    $val = 'https://workshop.fluidbook.com/viewerh/' . $id . '_' . $book->hash . '/';
+                } else {
+                    $val = $book->$column;
+                }
+                if (strpos($column, 'date') !== false) {
+                    $val = date('Y-m-d', $val);
+                }
+                $sheet->setCellValueByColumnAndRow($j, $i, $val);
+                if ($url) {
+                    $sheet->getCellByColumnAndRow($j, $i)->getHyperlink()->setUrl($url);
+                }
+
+                $j++;
+            }
+            foreach ($paramCols as $col) {
+                $sheet->setCellValueByColumnAndRow($j, $i, $book->parametres->$col);
+                $j++;
+            }
+            $i++;
+        }
+        ob_end_clean();
+        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+        header('Content-Disposition: attachment; filename="' . CubeIT_Text::str2URL($title) . '.xlsx"');
+        $writer = new PHPExcel_Writer_Excel2007($xls);
+        $writer->save('php://output');
+        exit;
+    }
+
+
+    /**
+     * @param $style PHPExcel_Style
+     */
+    protected static function _readonlyStyle($style)
+    {
+        $style->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setRGB('DDDDDD');
+        $style->getFont()->getColor()->setRGB('666666');
+    }
+
+
 }
 
 
index d00c59575b9db55c8437ad8047a023e4eab8502e..a9e77ba8497d758710dfccaf872e212642fbd993 100644 (file)
@@ -2005,16 +2005,6 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
         header('Location: https://www.orpi.com/');
     }
 
-    public static function getAdditionalSettingsMap(): array
-    {
-        return ['book_id' => 'book_id', 'lang' => 'lang', 'theme' => 'theme', 'status' => 'status', 'proprietaire_id' => 'owner', 'date' => 'date', 'changedate' => 'changedate', 'wslink' => 'wslink', 'hosting' => 'hosting', 'exportdatas' => 'exportdata'];
-    }
-
-    public static function getReadonlySettings()
-    {
-        return ['book_id', 'date', 'changedate', 'wslink', 'hosting', 'exportdatas'];
-    }
-
     public static function exportPublicationSettings($args)
     {
         global $core;
@@ -2024,94 +2014,7 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
             $books = wsUrl::listeBooks($r->dashboard_id, commonUrl::getDashboardSettings($r->settings), true);
         }
 
-        $p = new wsBookParametres(new wsBook());
-
-        $xls = new PHPExcel();
-        $sheet = $xls->getActiveSheet();
-        $sheet->freezePane('B2');
-        $standardSettings = self::getAdditionalSettingsMap();
-        $readonlyList = self::getReadonlySettings();
-        $j = 0;
-        foreach ($standardSettings as $column => $label) {
-            if ($label !== 'exportdata') {
-                $sheet->getColumnDimensionByColumn($j)->setAutoSize(true);
-            }
-
-            if (in_array($column, $readonlyList, true)) {
-                self::_readonlyStyle($sheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($j)));
-            }
-            $sheet->setCellValueByColumnAndRow($j, 1, $label);
-            $j++;
-        }
-        $paramCols = [];
-        foreach ($p->getForms() as $form) {
-            $form = $p->getForm($form, true);
-            foreach ($form['fields'] as $k => $field) {
-                $readonly = false;
-                if (!$field['editable']) {
-                    $readonly = true;
-                }
-
-                if ($readonly) {
-                    self::_readonlyStyle($sheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($j)));
-                }
-                $sheet->getCommentByColumnAndRow($j, 1)->getText()->createTextRun($field['label']);
-                $sheet->getColumnDimensionByColumn($j)->setAutoSize(true);
-                $sheet->setCellValueByColumnAndRow($j, 1, $k);
-
-                $paramCols[] = $k;
-                $j++;
-            }
-        }
-
-        $i = 2;
-        foreach ($books as $id => $book) {
-            $j = 0;
-            foreach ($standardSettings as $column => $label) {
-                $url = false;
-                if ($column === 'hosting') {
-                    $export = json_decode($book->exportdatas, true);
-                    if (isset($export['install_hosting']['online']['dir']) && $export['install_hosting']['online']['dir']) {
-                        $val = 'https://hosting.fluidbook.com/' . $export['install_hosting']['online']['dir'];
-                        $url = $val;
-                    } else {
-                        $val = '-';
-                    }
-                } else if ($column === 'wslink') {
-                    $val = 'https://workshop.fluidbook.com/viewerh/' . $id . '_' . $book->hash . '/';
-                } else {
-                    $val = $book->$column;
-                }
-                if (strpos($column, 'date') !== false) {
-                    $val = date('Y-m-d', $val);
-                }
-                $sheet->setCellValueByColumnAndRow($j, $i, $val);
-                if ($url) {
-                    $sheet->getCellByColumnAndRow($j, $i)->getHyperlink()->setUrl($url);
-                }
-
-                $j++;
-            }
-            foreach ($paramCols as $col) {
-                $sheet->setCellValueByColumnAndRow($j, $i, $book->parametres->$col);
-                $j++;
-            }
-            $i++;
-        }
-        ob_end_clean();
-        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
-        header('Content-Disposition: attachment; filename="' . CubeIT_Text::str2URL($title) . '.xlsx"');
-        $writer = new PHPExcel_Writer_Excel2007($xls);
-        $writer->save('php://output');
-        exit;
+        wsMaintenance::exportPublicationSettings($books,$title);
     }
 
-    /**
-     * @param $style PHPExcel_Style
-     */
-    protected static function _readonlyStyle($style)
-    {
-        $style->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setRGB('DDDDDD');
-        $style->getFont()->getColor()->setRGB('666666');
-    }
-}
+}
\ No newline at end of file
index 53cee12f3cf99805a6853d3806cfb808f100c932..14d50f6b9d594639b2a87525178229e64ffd78ef 100644 (file)
@@ -637,6 +637,11 @@ class wsBookParametres extends wsParametres
             'fieldsnames' => ['audiodescriptionTexts', 'audiodescriptionVoice']
         ];
 
+        // Tooltip
+
+
+        // Splashscreen
+
         $this->fields['splashImage'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Image'), 'grade' => 3, 'fileFilter' => $imageFilter];
         $this->fields['splashURL'] = ['type' => 'text', 'default' => '', 'editable' => true, 'label' => __('URL'), 'grade' => 3];
         $this->fields['splashTarget'] = ['type' => 'combo', 'datas' => $target, 'default' => '_self', 'editable' => true, 'label' => __('Ouvrir le lien'), 'grade' => 3];
index 996a6a8b21669842be611d1c97d3ad75d5a8a550..3b938243881f0752bae4e896271e6adca550f107 100644 (file)
@@ -97,6 +97,8 @@ class wsThemeParametres extends wsParametres
             'label' => __("Couleur du texte des infobulles"));\r
         $this->fields['tooltipTextSize'] = array('type' => 'integer', 'default' => 100, 'editable' => true,\r
             'label' => __('Taille du texte des infobulles'));\r
+        $this->fields['tooltipPaddingSize'] = array('type' => 'integer', 'default' => 20, 'editable' => true,\r
+            'label' => __('Marge intérieure des infobulles'));\r
         $this->fields['bookmarkBackgroundColor'] = array('type' => 'couleurAlpha', 'default' => 'ffadadad', 'editable' => true,\r
             'label' => __("Couleur de fond des marques-pages"));\r
         $this->fields['bookmarkStarDisabledColor'] = array('type' => 'couleurAlpha', 'default' => '00ffffff', 'editable' => true,\r
@@ -109,7 +111,7 @@ class wsThemeParametres extends wsParametres
                 '|', 'bookShadeColor', '|', 'usePageEdges',\r
                 '|', 'displayPageNumber', 'colorPageNumber',\r
                 '|', 'linksColor', 'videoBackgroundColor',\r
-                '|', 'tooltipBackColor', 'tooltipTextColor', 'tooltipTextSize',\r
+                '|', 'tooltipBackColor', 'tooltipTextColor', 'tooltipTextSize','tooltipPaddingSize',\r
                 '|', 'bookmarkBackgroundColor', 'bookmarkStarDisabledColor', 'bookmarkStarEnabledColor'));\r
         /* Credits */\r
         $this->fields['creditsColor'] = array('type' => 'couleurAlpha', 'default' => '80ffffff', 'editable' => true,\r