From 189b62cc5877c1f71e7a1d629a382f2923c10a92 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 23 Jan 2013 16:18:06 +0000 Subject: [PATCH] --- ...share-facebook-.png => share-facebook.png} | Bin inc/config.inc.php | 2 +- inc/ws/Controlleur/class.ws.flash.php | 7 ++++++ inc/ws/Controlleur/class.ws.services.php | 17 ++++++++++++-- inc/ws/DAO/class.ws.dao.book.php | 5 ++++ inc/ws/Metier/class.ws.book.parametres.php | 22 +++++++++++------- inc/ws/Metier/class.ws.icone.php | 7 ++++-- inc/ws/Util/class.ws.secure.swf.php | 2 +- 8 files changed, 48 insertions(+), 14 deletions(-) rename fluidbook/icones/share/{share-facebook-.png => share-facebook.png} (100%) diff --git a/fluidbook/icones/share/share-facebook-.png b/fluidbook/icones/share/share-facebook.png similarity index 100% rename from fluidbook/icones/share/share-facebook-.png rename to fluidbook/icones/share/share-facebook.png diff --git a/inc/config.inc.php b/inc/config.inc.php index a74dd106a..a7a9d78ac 100644 --- a/inc/config.inc.php +++ b/inc/config.inc.php @@ -10,7 +10,7 @@ define('SITE_PATH', WEBROOT . '/'); define('FONT_PATH', ROOT . '/fluidbook/fonts/'); define('FTPROOT', '/home/extranet/ftp/'); define('WINDOWS', false); -define('CONVERTER_PATH', '/bin:/usr/bin:/usr/local/bin:/home/extranet/www/fluidbook/tools:/usr/local/flex:/usr/local/secureSWF:/usr/local/scour:/home/extranet/node_modules/uglify-js/bin:/usr/local/ImageMagick/bin'); +define('CONVERTER_PATH', '/home/extranet/www/fluidbook/tools:/usr/local/flex:/usr/local/scour'); define('MXMLC_PATH', '/usr/local/flex/bin/mxmlc'); define('MXMLC_PATH_3', '/usr/local/flex_sdk_3.6/bin/mxmlc'); define('AS3_SOURCES', '/home/as/sources/as/as3'); diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index ab79954a8..2c4e0be04 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -613,6 +613,13 @@ class wsFlash extends cubeFlashGateway { $res .= "\n"; $res .= ''.__('Dimensions') . ' : ' . "\n"; $res .= round($size[0], 3) . ' x ' . round($size[1], 3) . ' pts' . "\n"; + $res .= "\n"; + $res .= ''.__('Taille totale des pages') . ' : ' . "\n"; + $res .= $total . "\n"; + $res .= "\n"; + $res .= ''.__('Taille moyenne des pages') . ' : ' . "\n"; + $res .= $average . "\n"; + $res .= "\n"; $this->xml->addChild('infos', $res); } diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 450aee9cb..844cc6b51 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -95,8 +95,8 @@ class wsServices extends cubeFlashGateway { if ($total > 1) { $s = ' (' . ($i + 1) . '/' . $total . ')'; } - - + + // Send the email $mail = new cubeMail(); @@ -172,6 +172,19 @@ class wsServices extends cubeFlashGateway { exit; } + public function googleplusShare() { + http::redirect('https://plus.google.com/share?url=' . urlencode($this->args['url']) . "&sgp=1"); + exit; + } + + public function linkedinShare() { + http::redirect('https://www.linkedin.com/cws/share?url=' . urlencode($this->args['url']) . '&isFramed=true&_ts=' . microtime(true)); + } + + public function viadeoShare() { + http::redirect('http://www.viadeo.com/shareit/share/?url=' . urlencode($this->args['url'])); + } + public function twitterShare() { $url = $this->shortenURL($this->args['url'], $this->args['id']); diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 1b12c79a9..485a782ef 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -1158,6 +1158,11 @@ class wsDAOBook extends commonDAO { foreach (wsIcone::$files as $file) { $flex->addBitmap($iconsRoot . 'nav-' . $file . '.png', 'nav_' . $file); } + // Share icons + $iconsRoot = WS_ICONS . '/share/'; + foreach (wsIcone::$share as $file) { + $flex->addBitmap($iconsRoot . 'share-' . $file . '.png', 'share_' . $file); + } // Multilang if (trim($book->parametres->multilang) != '') { diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 998404424..36bc8713b 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -46,25 +46,31 @@ class wsBookParametres extends wsParametres { 'fieldsnames' => array('version', 'title', 'url_link', 'signature')); // . // . - $this->fields['friend'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Envoyer à un ami')); + $this->fields['email_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut')); $this->fields['email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut')); $this->fields['email_editable'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Permettre au lecteur de modifier le corps de l'email")); $this->fields['askAcknowledge'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Demander au destinataire un accusé de réception"), 'grade' => 3); - $this->fields['facebook'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Facebook')); - $this->fields['facebook_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre facebook"), 'hint' => __('Titre proposé sur la fonction de partage facebook (par défaut, titre de la publication)')); - $this->fields['facebook_description'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Description facebook"), 'grade' => 1, 'hint' => __('Description proposée sur la fonction de partage facebook (par défaut, vide)')); + + $this->fields['facebook_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre du contenu partagé"), 'hint' => __('Titre proposé sur les fonction de partage (par défaut, titre de la publication)')); + $this->fields['facebook_description'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Description du contenu partagé"), 'grade' => 1, 'hint' => __('Description proposée sur les fonctions de partage (par défaut, vide)')); + $this->fields['twitter_description'] = array('type' => 'textarea', 'default' => '%title% : %short%', 'editable' => true, 'label' => __("Contenu Partage court"), 'hint' => __('Contenu du partagé sur les partages courts')); $this->fields['facebook_image'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Miniature affichée'), 'fileFilter' => $imageFilter); + + $this->fields['friend'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('E-mail')); + $this->fields['facebook'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Facebook')); $this->fields['twitter'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Twitter')); - $this->fields['twitter_description'] = array('type' => 'textarea', 'default' => '%title% : %short%', 'editable' => true, 'label' => __("Contenu Twitter"), 'hint' => __('Contenu du Twit')); + $this->fields['googleplus'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Google +')); + $this->fields['linkedin'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('LinkedIn')); + $this->fields['viadeo'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Viadeo')); $this->fields['customSharer'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Classe personnalisée de partage"), 'grade' => 5); $this->fields['friendWidth'] = array('type' => 'integer', 'default' => 319, 'editable' => true, 'label' => __('Largeur du menu'), 'grade' => 5); $this->fields['friendHeight'] = array('type' => 'integer', 'default' => 500, 'editable' => true, 'label' => __('Largeur du menu'), 'grade' => 5); $this->forms['share'] = array('label' => __('Fonctions de partage'), - 'fieldsnames' => array('friend', 'email_title', 'email_body', 'email_editable', 'askAcknowledge', '|', - 'facebook', 'facebook_title', 'facebook_description', 'facebook_image', '|', - 'twitter', 'twitter_description', '|', 'customSharer', '|', 'friendWidth', 'friendHeight')); + 'fieldsnames' => array('email_title', 'email_body', 'email_editable', 'askAcknowledge', '|', + 'facebook_title', 'facebook_description', 'facebook_image', 'twitter_description', '|', + 'friend', 'facebook', 'twitter', 'googleplus', 'linkedin', 'viadeo', '|', 'customSharer', '|', 'friendWidth', 'friendHeight')); // . $this->fields['pages'] = array('type' => 'integer', 'default' => '', 'editable' => false, 'label' => __('Nombre de pages')); $this->fields['width'] = array('type' => 'float', 'default' => '', 'editable' => false, 'label' => __('Largeur')); diff --git a/inc/ws/Metier/class.ws.icone.php b/inc/ws/Metier/class.ws.icone.php index 6485c51ed..c8cabb9f9 100644 --- a/inc/ws/Metier/class.ws.icone.php +++ b/inc/ws/Metier/class.ws.icone.php @@ -5,7 +5,8 @@ class wsIcone extends cubeMetier { public $icone_id; public $nom; public $date; - public static $files = array('index', 'normal', 'sommaire', 'print', 'friend', 'bookmark', 'fullscreen', 'normalscreen', 'save', 'archives', 'help', '2d', '3d', 'soundon', 'soundoff', 'basket', 'previous', 'home', 'email', 'facebook', 'twitter'); + public static $files = array('index', 'normal', 'sommaire', 'print', 'friend', 'bookmark', 'fullscreen', 'normalscreen', 'save', 'archives', 'help', '2d', '3d', 'soundon', 'soundoff', 'basket', 'previous', 'home'); + public static $share = array('email', 'facebook', 'twitter', 'googleplus', 'linkedin', 'viadeo'); public static $display = array('index', 'sommaire', 'print', 'friend', 'bookmark', 'fullscreen', 'save', '3d', 'soundon', 'help'); public function makeImage() { @@ -37,7 +38,9 @@ class wsIcone extends cubeMetier { $height = $h; $im = imagecreatetruecolor($w, $h); - imagelayereffect($im, IMG_EFFECT_REPLACE); + if (function_exists('imagelayereffect')) { + imagelayereffect($im, IMG_EFFECT_REPLACE); + } $color = imagecolorallocatealpha($im, 255, 255, 255, 127); imagefill($im, 0, 0, $color); imagesavealpha($im, true); diff --git a/inc/ws/Util/class.ws.secure.swf.php b/inc/ws/Util/class.ws.secure.swf.php index e01891ff5..7478902cb 100644 --- a/inc/ws/Util/class.ws.secure.swf.php +++ b/inc/ws/Util/class.ws.secure.swf.php @@ -81,7 +81,7 @@ class wsSecureSWF { protected static function protectFiles() { - $secureSWF = new cubeCommandLine('secureSWF', null, true); + $secureSWF = new cubeCommandLine('sudo secureSWF', null, true); $secureSWF->setPath(CONVERTER_PATH); $secureSWF->setManualArg(self::$configLocal); $secureSWF->setManualArg(self::$protected); -- 2.39.5