Changeset 2825
- Timestamp:
- 01/03/11 16:05:18 (13 years ago)
- Location:
- plugins/joliprint
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/joliprint/_admin.php
r2807 r2825 3 3 # This file is part of joliprint, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 20 10JC Denis and contributors5 # Copyright (c) 2009-2011 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # -
plugins/joliprint/_define.php
r2807 r2825 3 3 # This file is part of joliprint, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 20 10JC Denis and contributors5 # Copyright (c) 2009-2011 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 17 17 /* Description*/ "Add button to turn articles into pdf", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0. 1',19 /* Version */ '0.2', 20 20 /* Permissions */ 'admin' 21 21 ); 22 /* date */ #201 0121922 /* date */ #20110103 23 23 ?> -
plugins/joliprint/_prepend.php
r2807 r2825 3 3 # This file is part of joliprint, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 20 10JC Denis and contributors5 # Copyright (c) 2009-2011 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 13 13 if (!defined('DC_RC_PATH')){return;} 14 14 15 global $__autoload ;15 global $__autoload, $core; 16 16 17 17 $__autoload['joliprint'] = dirname(__FILE__).'/inc/class.joliprint.php'; 18 19 $core->url->register('joliprint','joliprint','^joliprint/(.+)$',array('joliprintUrl','joliprint')); 18 20 ?> -
plugins/joliprint/_public.php
r2807 r2825 3 3 # This file is part of joliprint, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 20 10JC Denis and contributors5 # Copyright (c) 2009-2011 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 20 20 21 21 # behaviors 22 $core->addBehavior('publicHeadContent',array('joliprint Public','publicheadContent'));23 $core->addBehavior('publicEntryBeforeContent',array('joliprint Public','publicEntryBeforeContent'));24 $core->addBehavior('publicEntryAfterContent',array('joliprint Public','publicEntryAfterContent'));22 $core->addBehavior('publicHeadContent',array('joliprintBhv','publicheadContent')); 23 $core->addBehavior('publicEntryBeforeContent',array('joliprintBhv','publicEntryBeforeContent')); 24 $core->addBehavior('publicEntryAfterContent',array('joliprintBhv','publicEntryAfterContent')); 25 25 26 26 # Template 27 27 $core->tpl->addValue('joliprintButton',array('joliprintTpl','joliprintButton')); 28 28 29 class joliprintPublic 29 # Tpl 30 $core->tpl->setPath($core->tpl->getPath(),dirname(__FILE__).'/default-templates'); 31 32 class joliprintBhv 30 33 { 31 34 public static function publicHeadContent($core) … … 84 87 # Params 85 88 $params = array(); 86 $params['url'] = $_ctx->posts->getURL(); 89 if ($s->btn_cleanpost) { 90 $params['url'] = $core->blog->url.$core->url->getBase('joliprint').'/'.$core->getPostPublicURL($_ctx->posts->post_type,html::sanitizeURL($_ctx->posts->post_url)); 91 } 92 else { 93 $params['url'] = $_ctx->posts->getURL(); 94 } 87 95 $params['server'] = (string) $s->btn_server; 88 96 $params['button'] = (string) $s->btn_button; … … 97 105 } 98 106 107 class joliprintUrl extends dcUrlHandlers 108 { 109 public static function joliprint($args) 110 { 111 if ($args == '') { 112 # No entry was specified. 113 self::p404(); 114 } 115 elseif (!preg_match('#^([^/]+)/(.*)$#',$args,$m)) 116 { 117 self::p404(); 118 } 119 else 120 { 121 $_ctx =& $GLOBALS['_ctx']; 122 $core =& $GLOBALS['core']; 123 124 $core->blog->withoutPassword(false); 125 126 $params = new ArrayObject(); 127 $params['post_type'] = $m[1]; 128 $params['post_url'] = $m[2]; 129 130 $_ctx->posts = $core->blog->getPosts($params); 131 132 $_ctx->comment_preview = new ArrayObject(); 133 $_ctx->comment_preview['content'] = ''; 134 $_ctx->comment_preview['rawcontent'] = ''; 135 $_ctx->comment_preview['name'] = ''; 136 $_ctx->comment_preview['mail'] = ''; 137 $_ctx->comment_preview['site'] = ''; 138 $_ctx->comment_preview['preview'] = false; 139 $_ctx->comment_preview['remember'] = false; 140 141 $core->blog->withoutPassword(true); 142 143 if ($_ctx->posts->isEmpty()) 144 { 145 # The specified entry does not exist. 146 self::p404(); 147 } 148 else 149 { 150 $post_id = $_ctx->posts->post_id; 151 $post_password = $_ctx->posts->post_password; 152 153 # Password protected entry 154 if ($post_password != '' && !$_ctx->preview) 155 { 156 # Get passwords cookie 157 if (isset($_COOKIE['dc_passwd'])) { 158 $pwd_cookie = unserialize($_COOKIE['dc_passwd']); 159 } else { 160 $pwd_cookie = array(); 161 } 162 163 # Check for match 164 if ((!empty($_POST['password']) && $_POST['password'] == $post_password) 165 || (isset($pwd_cookie[$post_id]) && $pwd_cookie[$post_id] == $post_password)) 166 { 167 $pwd_cookie[$post_id] = $post_password; 168 setcookie('dc_passwd',serialize($pwd_cookie),0,'/'); 169 } 170 else 171 { 172 self::serveDocument('password-form.html','text/html',false); 173 return; 174 } 175 } 176 177 # The entry 178 self::serveDocument('joliprint.html'); 179 } 180 } 181 } 182 } 183 99 184 class joliprintTpl 100 185 { … … 112 197 } 113 198 elseif ($_ctx->exists('posts')) { 114 $res .= "\$joliprint_params['url'] = \$_ctx->posts->getURL(); \n"; 199 $res .= "\$joliprint_params['url'] = \$core->blog->settings->joliprint->btn_cleanpost ? \n"; 200 $res .= " \$core->blog->url.\$core->url->getBase('joliprint').'/'.\$core->getPostPublicURL(\$_ctx->posts->post_type,html::sanitizeURL(\$_ctx->posts->post_url)) : \n"; 201 $res .= " \$_ctx->posts->getURL(); } \n"; 115 202 } 116 203 else { -
plugins/joliprint/_widgets.php
r2807 r2825 3 3 # This file is part of joliprint, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 20 10JC Denis and contributors5 # Copyright (c) 2009-2011 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 44 44 if (!$s->active) { return; } 45 45 46 if ('post.html' != $_ctx->current_tpl) { return; } 47 $params['url'] = $_ctx->posts->getURL(); 46 if (!$_ctx->exists('posts')) { return; } 47 48 $params['url'] = $s->btn_cleanpost ? 49 $core->blog->url.$core->url->getBase('joliprint').'/'.$core->getPostPublicURL($_ctx->posts->post_type,html::sanitizeURL($_ctx->posts->post_url)) : 50 $_ctx->posts->getURL(); 48 51 49 52 $params['button'] = $w->button; -
plugins/joliprint/inc/class.joliprint.php
r2807 r2825 3 3 # This file is part of joliprint, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 20 10JC Denis and contributors5 # Copyright (c) 2009-2011 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 18 18 public static $api_path = 'api/rest/url/'; 19 19 # URL path of joliprint buttons 20 public static $api_res = ' res/joliprint/img/buttons/default/';20 public static $api_res = 'buttons/'; 21 21 22 22 # Available button pictures … … 24 24 { 25 25 return array( 26 __('Big') => 'joliprint-button-big.png', 26 27 __('Button') => 'joliprint-button.png', 27 __('Button big') => 'joliprint-button-big.png',28 28 __('Icon') => 'joliprint-icon.png', 29 __('Icon small') => 'joliprint-icon-small.png', 30 __('Icon pdf') => 'pdf-icone.gif' 29 __('Share button') => 'joliprint-share-button.png', 30 __('Share style') => 'joliprint-share-style.png', 31 __('Colored icon') => 'joliprint-button-both.png', 32 __('Black icon') => 'joliprint-icon-small.png', 33 __('PDF icon') => 'pdf-icone.gif' 31 34 ); 32 35 } -
plugins/joliprint/index.php
r2807 r2825 3 3 # This file is part of joliprint, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 20 10JC Denis and contributors5 # Copyright (c) 2009-2011 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 52 52 53 53 $active = (boolean) $s->active; 54 $btn_cleanpost = (boolean) $s->btn_cleanpost; 54 55 $btn_place = (string) $s->btn_place; 55 56 if (!in_array($btn_place,$places)) $btn_place = 'after'; … … 71 72 { 72 73 $active = !empty($_POST['active']); 74 $btn_cleanpost = !empty($_POST['btn_cleanpost']); 73 75 $btn_place = (string) $_POST['btn_place']; 74 76 $btn_button = (string) $_POST['btn_button']; … … 79 81 80 82 $s->put('active',$active); 83 $s->put('btn_cleanpost',$btn_cleanpost); 81 84 $s->put('btn_place',$btn_place); 82 85 $s->put('btn_button',$btn_button); … … 169 172 form::textarea(array('btn_css'),164,10,$btn_css,'maximal').'</label></p> 170 173 <p class="form-note">'.__('This button is placed in HTML tag "div" of class "postjoliprint".').'</p> 174 <h4>'.__('Compatibility:').'</h4> 175 <p><label class="classic">'. 176 form::checkbox(array('btn_cleanpost'),'1',$btn_cleanpost). 177 __('Enable usage of a clean version of post').'</label></p> 178 <p class="form-note">'.__('This can help if some extensions are not correctly transcribed in PDF.').'</p> 171 179 </fieldset> 172 180 -
plugins/joliprint/js/joliprint.js
r2807 r2825 2 2 * This file is part of joliprint, a plugin for Dotclear 2. 3 3 * 4 * Copyright (c) 20 10JC Denis and contributors4 * Copyright (c) 2009-2011 JC Denis and contributors 5 5 * jcdenis@gdwd.com 6 6 * -
plugins/joliprint/locales/en/help/help.html
r2807 r2825 41 41 <p>L'extension doit être activée dans la page d'administration du plugin.</p> 42 42 43 <h3>Compatibilité</h3> 44 <p>Certaines extensions de Dotclear sont mal retranscrites par le service Joliprint, si vous activez le mode de compatibilité, 45 Joliprint utilisera une version d'un article dépourvue de tous les plugins.</p> 46 43 47 <h3>Support</h3> 44 48 <p>Si vous souhaitez plus d'aide ou apporter votre contribution à cette extension, voici quelques liens utiles.</p> -
plugins/joliprint/locales/fr/help/help.html
r2807 r2825 41 41 <p>L'extension doit être activée dans la page d'administration du plugin.</p> 42 42 43 <h3>Compatibilité</h3> 44 <p>Certaines extensions de Dotclear sont mal retranscrites par le service Joliprint, si vous activez le mode de compatibilité, 45 Joliprint utilisera une version d'un article dépourvue de tous les plugins.</p> 46 43 47 <h3>Support</h3> 44 48 <p>Si vous souhaitez plus d'aide ou apporter votre contribution à cette extension, voici quelques liens utiles.</p> -
plugins/joliprint/locales/fr/main.lang.php
r2807 r2825 1 1 <?php 2 2 // Language: Français 3 // Module: joliprint - 0. 14 // Date: 201 0-12-19 12:25:263 // Module: joliprint - 0.2 4 // Date: 2011-01-03 14:55:21 5 5 // Translated with dcTranslater - 1.5 6 6 7 7 #_widgets.php:28 8 #index.php:13 18 #index.php:134 9 9 $GLOBALS['__l10n']['Picture:'] = 'Image :'; 10 10 11 11 #_widgets.php:34 12 #index.php:14 612 #index.php:149 13 13 $GLOBALS['__l10n']['Country:'] = 'Province :'; 14 14 15 15 #inc/class.joliprint.php:26 16 #index.php:130 17 $GLOBALS['__l10n']['Button'] = 'Bouton'; 16 $GLOBALS['__l10n']['Big'] = 'Grand'; 18 17 19 18 #inc/class.joliprint.php:27 20 $GLOBALS['__l10n']['Button big'] = 'Gros bouton'; 19 #index.php:133 20 $GLOBALS['__l10n']['Button'] = 'Bouton'; 21 21 22 22 #inc/class.joliprint.php:28 … … 24 24 25 25 #inc/class.joliprint.php:29 26 $GLOBALS['__l10n'][' Icon small'] = 'Petite icône';26 $GLOBALS['__l10n']['Share button'] = 'Bouton de partage'; 27 27 28 28 #inc/class.joliprint.php:30 29 $GLOBALS['__l10n'][' Icon pdf'] = 'Icône PDF';29 $GLOBALS['__l10n']['Share style'] = 'Style partage'; 30 30 31 #inc/class.joliprint.php:81 32 #inc/class.joliprint.php:118 31 #inc/class.joliprint.php:31 32 $GLOBALS['__l10n']['Colored icon'] = 'Icône colorée'; 33 34 #inc/class.joliprint.php:32 35 $GLOBALS['__l10n']['Black icon'] = 'Icône noire'; 36 37 #inc/class.joliprint.php:33 38 $GLOBALS['__l10n']['PDF icon'] = 'Icône PDF'; 39 40 #inc/class.joliprint.php:84 41 #inc/class.joliprint.php:121 33 42 $GLOBALS['__l10n']['print with Joliprint'] = 'Imprimer avec Joliprint'; 34 43 … … 63 72 $GLOBALS['__l10n']['Both'] = 'Les deux'; 64 73 65 #index.php:10 074 #index.php:103 66 75 $GLOBALS['__l10n']['Configuration successfully saved'] = 'Configuration sauvegardée avec succès'; 67 76 68 #index.php:1 0977 #index.php:112 69 78 $GLOBALS['__l10n']['Please wait'] = 'Veuillez patienter'; 70 79 71 #index.php:12 480 #index.php:127 72 81 $GLOBALS['__l10n']['Plugin activation'] = 'Activation de l\'extension'; 73 82 74 #index.php:1 2783 #index.php:130 75 84 $GLOBALS['__l10n']['Enable extension'] = 'Activer l\'extension'; 76 85 77 #index.php:14 586 #index.php:148 78 87 $GLOBALS['__l10n']['This text is placed after icon only and on mouseover.'] = 'Ce text est placé après l\'icône seulement et au survole.'; 79 88 80 #index.php:15 389 #index.php:156 81 90 $GLOBALS['__l10n']['Show on posts from:'] = 'Afficher sur les billets de :'; 82 91 83 #index.php:16 392 #index.php:166 84 93 $GLOBALS['__l10n']['Place:'] = 'Emplacement :'; 85 94 86 #index.php:1 6795 #index.php:170 87 96 $GLOBALS['__l10n']['Additionnal style sheet:'] = 'Feuille de style additionnelle :'; 88 97 89 #index.php:17 098 #index.php:173 90 99 $GLOBALS['__l10n']['This button is placed in HTML tag "div" of class "postjoliprint".'] = 'Ce bouton est placé dans une balise HTML "div" de classe "postjoliprint"'; 91 100 101 #index.php:174 102 $GLOBALS['__l10n']['Compatibility:'] = 'Compatibilité :'; 103 104 #index.php:177 105 $GLOBALS['__l10n']['Enable usage of a clean version of post'] = 'Utiliser la version allégée d\'un billet'; 106 107 #index.php:178 108 $GLOBALS['__l10n']['This can help if some extensions are not correctly transcribed in PDF.'] = 'Ceci peut aider si des extensions ne sont pas correctement transcrites en PDF.'; 109 92 110 ?> -
plugins/joliprint/locales/fr/main.po
r2807 r2825 1 1 # Language: Français 2 # Module: joliprint - 0. 13 # Date: 201 0-12-19 12:25:262 # Module: joliprint - 0.2 3 # Date: 2011-01-03 14:55:21 4 4 # Translated with translater 1.5 5 5 … … 7 7 msgstr "" 8 8 "Content-Type: text/plain; charset=UTF-8\n" 9 "Project-Id-Version: joliprint 0. 1\n"9 "Project-Id-Version: joliprint 0.2\n" 10 10 "POT-Creation-Date: \n" 11 "PO-Revision-Date: 201 0-12-19T12:25:26+00:00\n"11 "PO-Revision-Date: 2011-01-03T14:55:21+00:00\n" 12 12 "Last-Translator: JC Denis\n" 13 13 "Language-Team: \n" … … 16 16 17 17 #: _widgets.php:28 18 #: index.php:13 118 #: index.php:134 19 19 msgid "Picture:" 20 20 msgstr "Image :" 21 21 22 22 #: _widgets.php:34 23 #: index.php:14 623 #: index.php:149 24 24 msgid "Country:" 25 25 msgstr "Province :" 26 26 27 27 #: inc/class.joliprint.php:26 28 #: index.php:130 28 msgid "Big" 29 msgstr "Grand" 30 31 #: inc/class.joliprint.php:27 32 #: index.php:133 29 33 msgid "Button" 30 34 msgstr "Bouton" 31 32 #: inc/class.joliprint.php:2733 msgid "Button big"34 msgstr "Gros bouton"35 35 36 36 #: inc/class.joliprint.php:28 … … 39 39 40 40 #: inc/class.joliprint.php:29 41 msgid " Icon small"42 msgstr " Petite icône"41 msgid "Share button" 42 msgstr "Bouton de partage" 43 43 44 44 #: inc/class.joliprint.php:30 45 msgid "Icon pdf" 45 msgid "Share style" 46 msgstr "Style partage" 47 48 #: inc/class.joliprint.php:31 49 msgid "Colored icon" 50 msgstr "Icône colorée" 51 52 #: inc/class.joliprint.php:32 53 msgid "Black icon" 54 msgstr "Icône noire" 55 56 #: inc/class.joliprint.php:33 57 msgid "PDF icon" 46 58 msgstr "Icône PDF" 47 59 48 #: inc/class.joliprint.php:8 149 #: inc/class.joliprint.php:1 1860 #: inc/class.joliprint.php:84 61 #: inc/class.joliprint.php:121 50 62 msgid "print with Joliprint" 51 63 msgstr "Imprimer avec Joliprint" … … 91 103 msgstr "Les deux" 92 104 93 #: index.php:10 0105 #: index.php:103 94 106 msgid "Configuration successfully saved" 95 107 msgstr "Configuration sauvegardée avec succès" 96 108 97 #: index.php:1 09109 #: index.php:112 98 110 msgid "Please wait" 99 111 msgstr "Veuillez patienter" 100 112 101 #: index.php:12 4113 #: index.php:127 102 114 msgid "Plugin activation" 103 115 msgstr "Activation de l'extension" 104 116 105 #: index.php:1 27117 #: index.php:130 106 118 msgid "Enable extension" 107 119 msgstr "Activer l'extension" 108 120 109 #: index.php:14 5121 #: index.php:148 110 122 msgid "This text is placed after icon only and on mouseover." 111 123 msgstr "Ce text est placé après l'icône seulement et au survole." 112 124 113 #: index.php:15 3125 #: index.php:156 114 126 msgid "Show on posts from:" 115 127 msgstr "Afficher sur les billets de :" 116 128 117 #: index.php:16 3129 #: index.php:166 118 130 msgid "Place:" 119 131 msgstr "Emplacement :" 120 132 121 #: index.php:1 67133 #: index.php:170 122 134 msgid "Additionnal style sheet:" 123 135 msgstr "Feuille de style additionnelle :" 124 136 125 #: index.php:17 0137 #: index.php:173 126 138 msgid "This button is placed in HTML tag \"div\" of class \"postjoliprint\"." 127 139 msgstr "Ce bouton est placé dans une balise HTML \"div\" de classe \"postjoliprint\"" 128 140 141 #: index.php:174 142 msgid "Compatibility:" 143 msgstr "Compatibilité :" 144 145 #: index.php:177 146 msgid "Enable usage of a clean version of post" 147 msgstr "Utiliser la version allégée d'un billet" 148 149 #: index.php:178 150 msgid "This can help if some extensions are not correctly transcribed in PDF." 151 msgstr "Ceci peut aider si des extensions ne sont pas correctement transcrites en PDF." 152 -
plugins/joliprint/release.txt
r2807 r2825 1 0.2 20110103 2 * Changed pictures path and added some buttons style 3 * Enable widget on all posts context 4 * Added public page to clean post before parse to PDF 5 1 6 0.1 20101219 2 7 * First public release (closes #620)
Note: See TracChangeset
for help on using the changeset viewer.