]> _ Git - cubeextranet.git/commitdiff
fix #2212 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 5 Sep 2018 12:57:14 +0000 (12:57 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 5 Sep 2018 12:57:14 +0000 (12:57 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.seo.php

index af85cba9dad3927256e3f3cc24fb42b6a36baf3f..724f42c185b68de39b043b7c668d9d9435db0250 100644 (file)
@@ -127,6 +127,17 @@ class wsBookParametres extends wsParametres
                        'fieldsnames' => array('share', '|', 'email_title', 'email_body', 'email_editable', 'askAcknowledge', 'sendasfluidbook', 'email_mailto', '|',
                                'facebook_title', 'facebook_description', 'facebook_image', 'twitter_description', '|',
                                'friend', 'facebook', 'twitter', 'googleplus', 'linkedin', 'viadeo', '|', 'customSharer', '|', 'friendWidth', 'friendHeight'));
+//.
+               $this->fields['seoVersion'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Générer une version pour les moteurs de recherche'));
+               $this->fields['seoRobots'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Autoriser le parcours par les moteurs de recherche'));
+               $this->fields['seoDescription'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Meta tag Description'));
+               $this->fields['seoKeywords'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Meta tag Keywords'));
+               $this->fields['seoAdvanced'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Données SEO par page'), 'grade' => 5, 'fileFilter' => $seoFilter];
+               $this->fields['seoBaseURL'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('URL de base'), 'grade' => 5, 'hint' => __("Si l'authentification échoue, redirection vers cette adresse"));
+
+               $this->forms['seo'] = array('label' => __('Optimisation pour les moteurs de recherche'),
+                       'fieldsnames' => array('seoVersion', 'seoRobots', 'seoDescription', "seoKeywords", '|', 'seoBaseURL', 'seoAdvanced'));
+
                // .
                $this->fields['pages'] = array('type' => 'integer', 'default' => '', 'editable' => false, 'label' => __('Nombre de pages'));
                $this->fields['width'] = array('type' => 'float', 'default' => '', 'editable' => false, 'label' => __('Largeur'));
@@ -483,16 +494,6 @@ class wsBookParametres extends wsParametres
                $this->forms['secure'] = array('label' => __('Sécurisation'),
                        'fieldsnames' => array('secureURL', 'secureURLRedirect', '|', 'preventRightClick'));
 
-               $this->fields['seoVersion'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Générer une version pour les moteurs de recherche'));
-               $this->fields['seoRobots'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Autoriser le parcours par les moteurs de recherche'));
-               $this->fields['seoDescription'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Meta tag Description'));
-               $this->fields['seoKeywords'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Meta tag Keywords'));
-               $this->fields['seoAdvanced'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Données SEO par page'), 'grade' => 5, 'fileFilter' => $seoFilter];
-               $this->fields['seoBaseURL'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('URL de base'), 'grade' => 5, 'hint' => __("Si l'authentification échoue, redirection vers cette adresse"));
-
-               $this->forms['seo'] = array('label' => __('Optimisation pour les moteurs de recherche'),
-                       'fieldsnames' => array('seoVersion', 'seoRobots', 'seoDescription', "seoKeywords", '|', 'seoBaseURL', 'seoAdvanced'));
-
                $this->fields['home'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Accueil de l'interface multibrochure"), 'grade' => 5);
                $this->fields['multilang'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Langues'), 'hint' => __('Code langue') . ',' . __('Code pays') . ',' . __('URL'));
                $this->fields['country'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Pays de la brochure'));
index 4ecb5b1c48e175ec51a52151a963c4a89e8d0109..e60ebce3ee125acdeb835a71ced814012d6f3b74 100644 (file)
@@ -565,20 +565,20 @@ class wsHTML5Compiler
                        }
                        $script .= $iscript;
 
-                       $socialTitle = $this->book->parametres->facebook_title ? $this->book->parametres->facebook_title : $titre;
-                       $socialDescription = $this->book->parametres->seoDescription ? $this->book->parametres->seoDescription : $this->book->parametres->seoDescription;
+                       $socialTitle = html::escapeHTML($this->book->parametres->facebook_title ? $this->book->parametres->facebook_title : $titre);
+                       $socialDescription = html::escapeHTML($this->book->parametres->facebook_description ? $this->book->parametres->facebook_description : $this->book->parametres->seoDescription);
                        $socialImage = 'https://workshop.fluidbook.com/services/facebook_thumbnail?id=' . $this->book_id . '&j=' . TIME;
                        $dim = CubeIT_Image::getimagesize($socialImage);
                        $socialImageWidth = $dim[0];
                        $socialImageHeight = $dim[1];
 
-                       $twittercard = '<meta name="twitter:title" content="' . html::escapeHTML($socialTitle) . '">
-       <meta name="twitter:description" content="' . html::escapeHTML($socialDescription) . '">
+                       $twittercard = '<meta name="twitter:title" content="' . $socialTitle . '">
+       <meta name="twitter:description" content="' . $socialDescription . '">
        <meta name="twitter:image" content="' . $socialImage . '">
        <meta name="twitter:site" content="@Fluidbook">
        <meta name="twitter:card" content="summary_large_image">';
-                       $opengraph = '<meta property="og:title" content="' . html::escapeHTML($socialTitle) . '"/>
-       <meta property="og:description" content="' . html::escapeHTML($socialDescription) . '"/>
+                       $opengraph = '<meta property="og:title" content="' . $socialTitle . '"/>
+       <meta property="og:description" content="' . $socialDescription . '"/>
        <meta property="og:image" content="' . $socialImage . '"/>
        <meta property="og:image:width" content="' . $socialImageWidth . '"/>
        <meta property="og:image:height" content="' . $socialImageHeight . '"/>';
index d9cb36c68ef9d8a5a602bdbcf6d814de9d0df2f0..d46df167b493d4347b85cf51bf22e36fa63cc8b7 100644 (file)
@@ -22,6 +22,7 @@ class wsHTML5Seo
                        $p->title = ($page == 1) ? $this->compiler->book->parametres->title : $this->_getPageLabel($page);\r
                        $p->text = $this->getTextContent($infos);\r
                        $p->description = $this->compiler->book->parametres->seoDescription ? $this->compiler->book->parametres->seoDescription : $this->compiler->book->parametres->title . ' - Powered by Fluidbook';\r
+                       $p->socialDescription = $this->compiler->parametres->facebook_description || $this->compiler->book->parametres->seoDescription;\r
                        $p->keywords = $this->compiler->book->parametres->seoKeywords;\r
                        $p->robots = $this->compiler->book->parametres->seoRobots ? 'index,follow' : 'noindex,nofollow';\r
 \r