Changeset 3256
- Timestamp:
- 11/12/13 16:24:57 (9 years ago)
- Location:
- plugins/postInfoWidget
- Files:
-
- 2 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/postInfoWidget/_admin.php
r2254 r3256 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of postInfoWidget, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr http://jcd.lv 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 13 if (!defined('DC_CONTEXT_ADMIN')){return;} 15 if (!defined('DC_CONTEXT_ADMIN')) { 16 17 return null; 18 } 19 14 20 require dirname(__FILE__).'/_widgets.php'; 15 ?> -
plugins/postInfoWidget/_define.php
r2377 r3256 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of postInfoWidget, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr http://jcd.lv 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 13 if (!defined('DC_RC_PATH')){return;} 14 15 if (!defined('DC_RC_PATH')) { 16 17 return null; 18 } 19 15 20 $this->registerModule( 16 /* Name */ "Entry information list", 17 /* Description*/ "Show Entry informations on a widget", 18 /* Author */ "JC Denis", 19 /* Version */ '0.3' 21 /* Name */ 22 "Entry information list", 23 /* Description*/ 24 "Show Entry informations on a widget", 25 /* Author */ 26 "Jean-Christian Denis", 27 /* Version */ 28 '0.4', 29 array( 30 'permissions' => 'usage,contentadmin', 31 'type' => 'plugin', 32 'dc_min' => '2.6', 33 'support' => 'http://jcd.lv/q=postInfoWidget', 34 'details' => 'http://plugins.dotaddict.org/dc2/details/postInfoWidget' 35 ) 20 36 ); 21 /* date */ #2010062122 ?> -
plugins/postInfoWidget/_public.php
r2254 r3256 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of postInfoWidget, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr http://jcd.lv 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 13 if (!defined('DC_RC_PATH')){return;} 15 if (!defined('DC_RC_PATH')) { 16 17 return null; 18 } 19 14 20 require dirname(__FILE__).'/_widgets.php'; 15 ?> -
plugins/postInfoWidget/_widgets.php
r2377 r3256 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of postInfoWidget, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr http://jcd.lv 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 13 if (!defined('DC_RC_PATH')){return;} 14 15 $core->addBehavior('initWidgets',array('postInfoWidget','adminWidget')); 15 if (!defined('DC_RC_PATH')) { 16 17 return null; 18 } 19 20 $core->addBehavior( 21 'initWidgets', 22 array('postInfoWidget', 'adminWidget') 23 ); 16 24 17 25 class postInfoWidget … … 21 29 global $core; 22 30 23 $w->create('postinfowidget', 24 __('Entry information list'),array('postInfoWidget','publicWidget')); 25 $w->postinfowidget->setting('title', 31 $w->create( 32 'postinfowidget', 33 __('Entry information list'), 34 array('postInfoWidget', 'publicWidget'), 35 null, 36 __('Show Entry informations on a widget') 37 ); 38 $w->postinfowidget->setting( 39 'title', 26 40 __('Title:'), 27 __('About this entry'),'text'); 28 $w->postinfowidget->setting('dt_str', 41 __('About this entry'), 42 'text' 43 ); 44 $w->postinfowidget->setting( 45 'dt_str', 29 46 __('Publish date text:'), 30 __('Publish on %Y-%m-%d %H:%M'),'text'); 31 $w->postinfowidget->setting('creadt_str', 47 __('Publish on %Y-%m-%d %H:%M'), 48 'text' 49 ); 50 $w->postinfowidget->setting( 51 'creadt_str', 32 52 __('Create date text:'), 33 __('Create on %Y-%m-%d %H:%M'),'text'); 34 $w->postinfowidget->setting('upddt_str', 53 __('Create on %Y-%m-%d %H:%M'), 54 'text' 55 ); 56 $w->postinfowidget->setting( 57 'upddt_str', 35 58 __('Update date text:'), 36 __('Update on %Y-%m-%d %H:%M'),'text'); 37 $w->postinfowidget->setting('lang_str', 59 __('Update on %Y-%m-%d %H:%M'), 60 'text' 61 ); 62 $w->postinfowidget->setting( 63 'lang_str', 38 64 __('Language: (%T = name, %C = code, %F = flag)'), 39 __('Language: %T %F'),'text'); 40 $w->postinfowidget->setting('author_str', 65 __('Language: %T %F'), 66 'text' 67 ); 68 $w->postinfowidget->setting( 69 'author_str', 41 70 __('Author text: (%T = author)'), 42 __('Author: %T'),'text'); 43 $w->postinfowidget->setting('category_str', 71 __('Author: %T'), 72 'text' 73 ); 74 $w->postinfowidget->setting( 75 'category_str', 44 76 __('Category text: (%T = category)'), 45 __('Category: %T'),'text'); 77 __('Category: %T'), 78 'text' 79 ); 46 80 if ($core->plugins->moduleExists('tags')) { 47 $w->postinfowidget->setting('tag_str', 48 __('Tags text: (%T = tags list)'), 49 __('Tags: %T'),'text'); 50 } 51 $w->postinfowidget->setting('attachment_str', 81 $w->postinfowidget->setting( 82 'tag_str', 83 __('Tags text: (%T = tags list)'), 84 __('Tags: %T'), 85 'text' 86 ); 87 } 88 $w->postinfowidget->setting( 89 'attachment_str', 52 90 __('Attachments text: (%T = text, %D = numeric)'), 53 __('Attachments: %T'),'text'); 54 $w->postinfowidget->setting('comment_str', 91 __('Attachments: %T'), 92 'text' 93 ); 94 $w->postinfowidget->setting( 95 'comment_str', 55 96 __('Comments text: (%T = text, %D = numeric)'), 56 __('Comments: %T'),'text'); 57 $w->postinfowidget->setting('trackback_str', 97 __('Comments: %T'), 98 'text' 99 ); 100 $w->postinfowidget->setting( 101 'trackback_str', 58 102 __('Trackbacks text: (%T = text, %D = numeric)'), 59 __('Trackbacks: %T'),'text'); 60 $w->postinfowidget->setting('permalink_str', 103 __('Trackbacks: %T'), 104 'text' 105 ); 106 $w->postinfowidget->setting( 107 'permalink_str', 61 108 __('Permalink text: (%T = text link, %F = full link)'), 62 __('%T'),'text'); 63 $w->postinfowidget->setting('feed', 64 __('Show comment feed url'),1,'check'); 65 $w->postinfowidget->setting('navprevpost', 109 __('%T'), 110 'text' 111 ); 112 $w->postinfowidget->setting( 113 'feed', 114 __('Show comment feed url'), 115 1, 116 'check' 117 ); 118 $w->postinfowidget->setting( 119 'navprevpost', 66 120 __('Link to previous entry: (%T = navigation text, %F = entry title)'), 67 __('%T'),'text'); 68 $w->postinfowidget->setting('navnextpost', 121 __('%T'), 122 'text' 123 ); 124 $w->postinfowidget->setting( 125 'navnextpost', 69 126 __('Link to next entry: (%T = navigation text, %F = entry title)'), 70 __('%T'),'text'); 71 $w->postinfowidget->setting('navprevcat', 127 __('%T'), 128 'text' 129 ); 130 $w->postinfowidget->setting( 131 'navprevcat', 72 132 __('Link to previous entry of this category: (%T = navigation text, %F = entry title)'), 73 __('%T'),'text'); 74 $w->postinfowidget->setting('navnextcat', 133 __('%T'), 134 'text' 135 ); 136 $w->postinfowidget->setting( 137 'navnextcat', 75 138 __('Link to next entry of this category: (%T = navigation text, %F = entry title)'), 76 __('%T'),'text'); 77 $w->postinfowidget->setting('style', 78 __('Try to adapt style'),'small','combo',array( 139 __('%T'), 140 'text' 141 ); 142 $w->postinfowidget->setting( 143 'style', 144 __('Try to adapt style'), 145 'small', 146 'combo', 147 array( 79 148 __('No style') => '-', 80 149 __('Small icon') => 'small', 81 __('Normal icon') => 'normal')); 82 $w->postinfowidget->setting('rmvinfo', 83 __('Try to remove entry information'),1,'check'); 84 $w->postinfowidget->setting('rmvtags', 85 __('Try to remove entry tags'),1,'check'); 86 $w->postinfowidget->setting('rmvnav', 87 __('Try to remove entry navigation'),1,'check'); 150 __('Normal icon') => 'normal' 151 ) 152 ); 153 $w->postinfowidget->setting( 154 'rmvinfo', 155 __('Try to remove entry information'), 156 1, 157 'check' 158 ); 159 $w->postinfowidget->setting( 160 'rmvtags', 161 __('Try to remove entry tags'), 162 1, 163 'check' 164 ); 165 $w->postinfowidget->setting( 166 'rmvnav', 167 __('Try to remove entry navigation'), 168 1, 169 'check' 170 ); 88 171 89 172 # --BEHAVIOR-- postInfoWidgetAdmin 90 $core->callBehavior('postInfoWidgetAdmin',$w); 173 $core->callBehavior('postInfoWidgetAdmin', $w); 174 175 $w->postinfowidget->setting( 176 'content_only', 177 __('Content only'), 178 0, 179 'check' 180 ); 181 182 $w->postinfowidget->setting( 183 'class', 184 __('CSS class:'), 185 '' 186 ); 91 187 } 92 188 … … 95 191 global $core, $_ctx; 96 192 97 if ($core->url->type != 'post' || !$_ctx->posts->post_id){return;} 193 if ($core->url->type != 'post' 194 || !$_ctx->posts->post_id 195 ){ 196 return null; 197 } 98 198 99 199 $link = '<a href="%s">%s</a>'; … … 101 201 '<h2>'.html::escapeHTML($w->title).'</h2>' : null; 102 202 $content = ''; 103 104 if ($w->dt_str != '') 105 { 106 $content .= postInfoWidget::li($w,'date',dt::str( 107 $w->dt_str, 108 strtotime($_ctx->posts->post_dt), 109 $core->blog->settings->system->blog_timezone 203 204 if ($w->dt_str != '') { 205 $content .= postInfoWidget::li( 206 $w, 207 'date', 208 dt::str( 209 $w->dt_str, 210 strtotime($_ctx->posts->post_dt), 211 $core->blog->settings->system->blog_timezone 212 ) 213 ); 214 } 215 216 if ($w->creadt_str != '') { 217 $content .= postInfoWidget::li( 218 $w, 219 'create', 220 dt::str( 221 $w->creadt_str, 222 strtotime($_ctx->posts->post_creadt), 223 $core->blog->settings->system->blog_timezone 224 ) 225 ); 226 } 227 228 if ($w->upddt_str != '') { 229 $content .= postInfoWidget::li( 230 $w, 231 'update', 232 dt::str( 233 $w->upddt_str, 234 strtotime($_ctx->posts->post_upddt), 235 $core->blog->settings->system->blog_timezone 236 ) 237 ); 238 } 239 240 if ($w->lang_str != '') { 241 $ln = l10n::getISOcodes(); 242 $lang_code = $_ctx->posts->post_lang ? 243 $_ctx->posts->post_lang : 244 $core->blog->settings->system->lang; 245 $lang_name = isset($ln[$lang_code]) ? 246 $ln[$lang_code] : 247 $lang_code; 248 $lang_flag = file_exists( 249 dirname(__FILE__). 250 '/img/flags/'. 251 $lang_code.'.png' 252 ) ? 253 '<img src="'.$core->blog->getQmarkURL(). 254 'pf=postInfoWidget/img/flags/'. 255 $lang_code.'.png" alt="'.$lang_name.'" />' : 256 ''; 257 258 $content .= postInfoWidget::li( 259 $w, 260 'lang', 261 str_replace( 262 array('%T', '%C', '%F'), 263 array($lang_name, $lang_code, $lang_flag), 264 html::escapeHTML($w->lang_str) 265 ) 266 ); 267 } 268 269 if ($w->author_str != '') { 270 $content .= postInfoWidget::li( 271 $w, 272 'author', 273 str_replace( 274 '%T', 275 $_ctx->posts->getAuthorLink(), 276 html::escapeHTML($w->author_str) 277 ) 278 ); 279 } 280 281 if ($w->category_str != '' && $_ctx->posts->cat_id) { 282 $content .= postInfoWidget::li( 283 $w, 284 'category', 285 str_replace( 286 '%T', 287 sprintf( 288 $link, 289 $_ctx->posts->getCategoryURL(), 290 html::escapeHTML($_ctx->posts->cat_title) 291 ), 292 html::escapeHTML($w->category_str) 293 ) 294 ); 295 } 296 297 if ($w->tag_str != '' && $core->plugins->moduleExists('tags')) { 298 $meta = $core->meta->getMetadata(array( 299 'meta_type' => 'tag', 300 'post_id' => $_ctx->posts->post_id 110 301 )); 111 }112 if ($w->creadt_str != '')113 {114 $content .= postInfoWidget::li($w,'create',dt::str(115 $w->creadt_str,116 strtotime($_ctx->posts->post_creadt),117 $core->blog->settings->system->blog_timezone118 ));119 }120 if ($w->upddt_str != '')121 {122 $content .= postInfoWidget::li($w,'update',dt::str(123 $w->upddt_str,124 strtotime($_ctx->posts->post_upddt),125 $core->blog->settings->system->blog_timezone126 ));127 }128 if ($w->lang_str != '')129 {130 $ln = l10n::getISOcodes();131 $lang_code = $_ctx->posts->post_lang ? $_ctx->posts->post_lang : $core->blog->settings->system->lang;132 $lang_name = isset($ln[$lang_code]) ? $ln[$lang_code] : $lang_code;133 $lang_flag = file_exists(dirname(__FILE__).'/img/flags/'.$lang_code.'.png') ? '<img src="'.$core->blog->getQmarkURL().'pf=postInfoWidget/img/flags/'.$lang_code.'.png" alt="'.$lang_name.'" />' : '';134 135 $content .= postInfoWidget::li($w,'lang',str_replace(136 array('%T','%C','%F'),137 array($lang_name,$lang_code,$lang_flag),138 html::escapeHTML($w->lang_str))139 );140 }141 if ($w->author_str != '')142 {143 $content .= postInfoWidget::li($w,'author',str_replace(144 '%T',145 $_ctx->posts->getAuthorLink(),146 html::escapeHTML($w->author_str))147 );148 }149 if ($w->category_str != '' && $_ctx->posts->cat_id)150 {151 $content .= postInfoWidget::li($w,'category',str_replace(152 '%T',sprintf(153 $link,154 $_ctx->posts->getCategoryURL(),155 html::escapeHTML($_ctx->posts->cat_title)156 ),157 html::escapeHTML($w->category_str))158 );159 }160 if ($w->tag_str != '' && $core->plugins->moduleExists('tags'))161 {162 $meta = $core->meta->getMetadata(array('meta_type'=>'tag','post_id'=>$_ctx->posts->post_id));163 302 $metas = array(); 164 303 while ($meta->fetch()) { 165 304 $metas[$meta->meta_id] = sprintf( 166 305 $link, 167 $core->blog->url.$core->url->getBase('tag')."/". 168 rawurlencode($meta->meta_id),$meta->meta_id 306 $core->blog->url. 307 $core->url->getBase('tag')."/". 308 rawurlencode($meta->meta_id), 309 $meta->meta_id 169 310 ); 170 311 } 171 312 if (!empty($metas)) { 172 $content .= postInfoWidget::li($w,'tag',str_replace( 173 '%T',implode(', ',$metas),html::escapeHTML($w->tag_str)) 174 ); 175 } 176 } 177 if ($w->attachment_str != '') 178 { 313 $content .= postInfoWidget::li( 314 $w, 315 'tag', 316 str_replace( 317 '%T', 318 implode(', ', $metas), 319 html::escapeHTML($w->tag_str) 320 ) 321 ); 322 } 323 } 324 325 if ($w->attachment_str != '') { 179 326 $nb = $_ctx->posts->countMedia(); 180 327 if ($nb == 0) { 181 328 $attachment_numeric = 0; 182 329 $attachment_textual = __('no attachment'); 183 } elseif ($nb == 1) { 184 $attachment_numeric = sprintf($link,'#attachment',1); 185 $attachment_textual = sprintf($link,'#attachment',__('one attachment')); 186 } else { 187 $attachment_numeric = sprintf($link,'#attachment',$nb); 188 $attachment_textual = sprintf($link,'#attachment',sprintf(__('%d attachments'),$nb)); 189 } 190 191 $content .= postInfoWidget::li($w,'attachment',str_replace( 192 array('%T','%D'), 193 array($attachment_textual,$attachment_numeric), 194 html::escapeHTML($w->attachment_str)) 195 ); 196 } 197 if ($w->comment_str != '' && $_ctx->posts->commentsActive()) 198 { 330 } 331 elseif ($nb == 1) { 332 $attachment_numeric = sprintf( 333 $link, 334 '#attachment', 335 1 336 ); 337 $attachment_textual = sprintf( 338 $link, 339 '#attachment', 340 __('one attachment') 341 ); 342 } 343 else { 344 $attachment_numeric = sprintf( 345 $link, 346 '#attachment', 347 $nb 348 ); 349 $attachment_textual = sprintf( 350 $link, 351 '#attachment', 352 sprintf(__('%d attachments'), $nb) 353 ); 354 } 355 356 $content .= postInfoWidget::li( 357 $w, 358 'attachment', 359 str_replace( 360 array('%T', '%D'), 361 array($attachment_textual, $attachment_numeric), 362 html::escapeHTML($w->attachment_str) 363 ) 364 ); 365 } 366 367 if ($w->comment_str != '' && $_ctx->posts->commentsActive()) { 199 368 $nb = $_ctx->posts->nb_comment; 200 369 if ($nb == 0) { 201 370 $comment_numeric = 0; 202 371 $comment_textual = __('no comment'); 203 } elseif ($nb == 1) { 204 $comment_numeric = sprintf($link,'#comments',1); 205 $comment_textual = sprintf($link,'#comments',__('one comment')); 206 } else { 207 $comment_numeric = sprintf($link,'#comments',$nb); 208 $comment_textual = sprintf($link,'#comments',sprintf(__('%d comments'),$nb)); 209 } 210 211 $content .= postInfoWidget::li($w,'comment',str_replace( 212 array('%T','%D'), 213 array($comment_textual,$comment_numeric), 214 html::escapeHTML($w->comment_str)) 215 ); 216 } 217 if ($w->trackback_str != '' && $_ctx->posts->trackbacksActive()) 218 { 372 } 373 elseif ($nb == 1) { 374 $comment_numeric = sprintf( 375 $link, 376 '#comments', 377 1 378 ); 379 $comment_textual = sprintf( 380 $link, 381 '#comments', 382 __('one comment') 383 ); 384 } 385 else { 386 $comment_numeric = sprintf( 387 $link, 388 '#comments', 389 $nb 390 ); 391 $comment_textual = sprintf( 392 $link, 393 '#comments', 394 sprintf(__('%d comments'), $nb) 395 ); 396 } 397 398 $content .= postInfoWidget::li( 399 $w, 400 'comment', 401 str_replace( 402 array('%T', '%D'), 403 array($comment_textual, $comment_numeric), 404 html::escapeHTML($w->comment_str) 405 ) 406 ); 407 } 408 409 if ($w->trackback_str != '' && $_ctx->posts->trackbacksActive()) { 219 410 $nb = $_ctx->posts->nb_trackback; 220 411 if ($nb == 0) { 221 412 $trackback_numeric = 0; 222 413 $trackback_textual = __('no trackback'); 223 } elseif ($nb == 1) { 224 $trackback_numeric = sprintf($link,'#pings',1); 225 $trackback_textual = sprintf($link,'#pings',__('one trackback')); 226 } else { 227 $trackback_numeric = sprintf($link,'#pings',$nb); 228 $trackback_textual = sprintf($link,'#pings',sprintf(__('%d trackbacks'),$nb)); 229 } 230 231 $content .= postInfoWidget::li($w,'trackback',str_replace( 232 array('%T','%D'), 233 array($trackback_textual,$trackback_numeric), 234 html::escapeHTML($w->trackback_str)) 235 ); 236 } 237 if ($w->permalink_str) 238 { 239 $content .= postInfoWidget::li($w,'permalink',str_replace( 240 array('%T','%F'), 241 array(sprintf($link,$_ctx->posts->getURL(),__('Permalink')),$_ctx->posts->getURL()), 242 html::escapeHTML($w->permalink_str)) 243 ); 244 } 245 if ($w->feed && $_ctx->posts->commentsActive()) 246 { 247 $content .= postInfoWidget::li($w,'feed',sprintf( 248 $link, 249 $core->blog->url.$core->url->getBase('feed').'/atom/comments/'.$_ctx->posts->post_id, 250 __("This post's comments feed") 251 ,html::escapeHTML($w->tag_str)) 252 ); 253 } 254 if ($w->navprevpost) 255 { 256 $npp = postInfoWidget::nav($_ctx->posts,-1,false, 257 __('Previous entry'),$w->navprevpost 414 } 415 elseif ($nb == 1) { 416 $trackback_numeric = sprintf( 417 $link, 418 '#pings', 419 1 420 ); 421 $trackback_textual = sprintf( 422 $link, 423 '#pings', 424 __('one trackback') 425 ); 426 } 427 else { 428 $trackback_numeric = sprintf( 429 $link, 430 '#pings', 431 $nb 432 ); 433 $trackback_textual = sprintf( 434 $link, 435 '#pings', 436 sprintf(__('%d trackbacks'), $nb) 437 ); 438 } 439 440 $content .= postInfoWidget::li( 441 $w, 442 'trackback', 443 str_replace( 444 array('%T', '%D'), 445 array($trackback_textual, $trackback_numeric), 446 html::escapeHTML($w->trackback_str) 447 ) 448 ); 449 } 450 451 if ($w->permalink_str) { 452 $content .= postInfoWidget::li( 453 $w, 454 'permalink', 455 str_replace( 456 array('%T', '%F'), 457 array( 458 sprintf( 459 $link, 460 $_ctx->posts->getURL(), 461 __('Permalink')), 462 $_ctx->posts->getURL() 463 ), 464 html::escapeHTML($w->permalink_str) 465 ) 466 ); 467 } 468 469 if ($w->feed && $_ctx->posts->commentsActive()) { 470 $content .= postInfoWidget::li( 471 $w, 472 'feed', 473 sprintf( 474 $link, 475 $core->blog->url. 476 $core->url->getBase('feed'). 477 '/atom/comments/'. 478 $_ctx->posts->post_id, 479 __("This post's comments feed"), 480 html::escapeHTML($w->tag_str) 481 ) 482 ); 483 } 484 485 if ($w->navprevpost) { 486 $npp = postInfoWidget::nav( 487 $_ctx->posts, 488 -1, 489 false, 490 __('Previous entry'), 491 $w->navprevpost 258 492 ); 259 493 if ($npp) { 260 $content .= postInfoWidget::li($w,'previous',$npp); 261 } 262 } 263 if ($w->navnextpost) 264 { 265 $nnp = postInfoWidget::nav($_ctx->posts,1,false, 266 __('Next entry'),$w->navnextpost 494 $content .= postInfoWidget::li( 495 $w, 496 'previous', 497 $npp 498 ); 499 } 500 } 501 if ($w->navnextpost) { 502 $nnp = postInfoWidget::nav( 503 $_ctx->posts, 504 1, 505 false, 506 __('Next entry'), 507 $w->navnextpost 267 508 ); 268 509 if ($nnp) { 269 $content .= postInfoWidget::li($w,'next',$nnp); 270 } 271 } 272 if ($w->navprevcat) 273 { 274 $npc = postInfoWidget::nav($_ctx->posts,-1,true, 275 __('Previous entry of this category'),$w->navprevcat 510 $content .= postInfoWidget::li( 511 $w, 512 'next', 513 $nnp 514 ); 515 } 516 } 517 518 if ($w->navprevcat) { 519 $npc = postInfoWidget::nav( 520 $_ctx->posts, 521 -1, 522 true, 523 __('Previous entry of this category'), 524 $w->navprevcat 276 525 ); 277 526 if ($npc) { 278 $content .= postInfoWidget::li($w,'previous',$npc); 279 } 280 } 281 if ($w->navnextcat) 282 { 283 $nnc = postInfoWidget::nav($_ctx->posts,1,true, 284 __('Next entry of this category'),$w->navnextcat 527 $content .= postInfoWidget::li( 528 $w, 529 'previous', 530 $npc 531 ); 532 } 533 } 534 535 if ($w->navnextcat) { 536 $nnc = postInfoWidget::nav( 537 $_ctx->posts, 538 1, 539 true, 540 __('Next entry of this category'), 541 $w->navnextcat 285 542 ); 286 543 if ($nnc) { 287 $content .= postInfoWidget::li($w,'next',$nnc); 288 } 289 } 290 544 $content .= postInfoWidget::li( 545 $w, 546 'next', 547 $nnc 548 ); 549 } 550 } 551 291 552 # --BEHAVIOR-- postInfoWidgetPublic 292 $content .= $core->callBehavior('postInfoWidgetPublic',$w); 293 294 if (empty($content)) {return;} 295 553 $content .= $core->callBehavior('postInfoWidgetPublic', $w); 554 555 if (empty($content)) { 556 557 return null; 558 } 559 296 560 $rmv = ''; 297 561 if ($w->rmvinfo || $w->rmvtags || $w->rmvnav) { … … 318 582 "</script>\n"; 319 583 } 320 321 return $rmv.'<div class="postinfowidget">'.$title.'<ul>'.$content.'</ul></div>'; 584 585 return 586 $rmv. 587 ($w->content_only ? '' : '<div class="postinfowidget'. 588 ($w->class ? ' '.html::escapeHTML($w->class) : '').'"">'). 589 $title. 590 '<ul>'.$content.'</ul>'. 591 ($w->content_only ? '' : '</div>'); 322 592 } 323 593 324 public static function li($w, $i,$c)594 public static function li($w, $i, $c) 325 595 { 326 596 $s = ' style="padding-left:%spx;background: transparent url(\''.$GLOBALS['core']->blog->getQmarkURL().'pf=postInfoWidget/img/%s%s.png\') no-repeat left center;"'; 327 597 if ($w->style == 'small') { 328 $s = sprintf($s,16,$i,'-small'); 329 } elseif($w->style == 'normal') { 330 $s = sprintf($s,20,$i,''); 331 } else { 598 $s = sprintf($s, 16, $i, '-small'); 599 } 600 elseif($w->style == 'normal') { 601 $s = sprintf($s, 20, $i, ''); 602 } 603 else { 332 604 $s = ''; 333 605 } 334 606 $l = '<li class="postinfo-%s"%s>%s</li>'; 335 336 return sprintf($l, $i,$s,$c);607 608 return sprintf($l, $i, $s, $c); 337 609 } 338 339 public static function nav($p, $d,$r,$t,$c)610 611 public static function nav($p, $d, $r, $t, $c) 340 612 { 341 613 global $core; 342 343 $rs = $core->blog->getNextPost($p,$d,$r); 344 if ($rs !== null) 345 { 614 615 $rs = $core->blog->getNextPost($p, $d, $r); 616 if ($rs !== null) { 346 617 $l = '<a href="%s" title="%s">%s</a>'; 347 618 $u = $rs->getURL(); 348 619 $e = html::escapeHTML($rs->post_title); 349 620 350 621 return str_replace( 351 array('%T', '%F'),352 array(sprintf($l, $u,$e,$t),sprintf($l,$u,$t,$e)),622 array('%T', '%F'), 623 array(sprintf($l, $u, $e, $t), sprintf($l, $u, $t, $e)), 353 624 $c 354 625 ); 355 626 } 627 356 628 return ''; 357 629 } 358 630 } 359 ?> -
plugins/postInfoWidget/locales/fr/main.lang.php
r2254 r3256 1 1 <?php 2 // Language: français3 // Module: postInfoWidget - 0. 14 // Date: 201 0-05-23 23:46:225 // Translated with dcTranslater - 1.32 // Language: Français 3 // Module: postInfoWidget - 0.4 4 // Date: 2013-11-12 15:08:46 5 // Translated with dcTranslater - 2013.05.11 6 6 7 #_widgets.php: 247 #_widgets.php:31 8 8 $GLOBALS['__l10n']['Entry information list'] = 'Liste d\'information du billet'; 9 9 10 #_widgets.php:27 10 #_widgets.php:34 11 $GLOBALS['__l10n']['Show Entry informations on a widget'] = 'Afficher les informations d\'un billet dans un widget'; 12 13 #_widgets.php:39 11 14 $GLOBALS['__l10n']['About this entry'] = 'Á propos de ce billet'; 12 15 13 #_widgets.php: 2916 #_widgets.php:44 14 17 $GLOBALS['__l10n']['Publish date text:'] = 'Texte pour la date de publication :'; 15 18 16 #_widgets.php: 3019 #_widgets.php:45 17 20 $GLOBALS['__l10n']['Publish on %Y-%m-%d %H:%M'] = 'Publié le %d/%m/%Y à %H:%M'; 18 21 19 #_widgets.php: 3222 #_widgets.php:50 20 23 $GLOBALS['__l10n']['Create date text:'] = 'Texte pour la date de création :'; 21 24 22 #_widgets.php: 3325 #_widgets.php:51 23 26 $GLOBALS['__l10n']['Create on %Y-%m-%d %H:%M'] = 'Créé le %d/%m/%Y à %H:%M'; 24 27 25 #_widgets.php: 3528 #_widgets.php:56 26 29 $GLOBALS['__l10n']['Update date text:'] = 'Texte pour la date de dernière mise à jour :'; 27 30 28 #_widgets.php: 3631 #_widgets.php:57 29 32 $GLOBALS['__l10n']['Update on %Y-%m-%d %H:%M'] = 'Mis à jour le %d/%m/%Y à %H:%M'; 30 33 31 #_widgets.php: 3834 #_widgets.php:62 32 35 $GLOBALS['__l10n']['Language: (%T = name, %C = code, %F = flag)'] = 'Text pour la langue : (%T = nom, %C = code, %F = drapeau)'; 33 36 34 #_widgets.php: 3937 #_widgets.php:63 35 38 $GLOBALS['__l10n']['Language: %T %F'] = 'Langue : %T %F'; 36 39 37 #_widgets.php: 4140 #_widgets.php:68 38 41 $GLOBALS['__l10n']['Author text: (%T = author)'] = 'Texte pour l\'auteur : (%T = auteur)'; 39 42 40 #_widgets.php: 4243 #_widgets.php:69 41 44 $GLOBALS['__l10n']['Author: %T'] = 'Auteur : %T'; 42 45 43 #_widgets.php: 4446 #_widgets.php:74 44 47 $GLOBALS['__l10n']['Category text: (%T = category)'] = 'Texte pour la catégorie : (%T = catégorie)'; 45 48 46 #_widgets.php: 4549 #_widgets.php:75 47 50 $GLOBALS['__l10n']['Category: %T'] = 'Catégorie : %T'; 48 51 49 #_widgets.php: 4852 #_widgets.php:81 50 53 $GLOBALS['__l10n']['Tags text: (%T = tags list)'] = 'Text pour les tags : (%T = liste des tags)'; 51 54 52 #_widgets.php: 4955 #_widgets.php:82 53 56 $GLOBALS['__l10n']['Tags: %T'] = 'Tags : %T'; 54 57 55 #_widgets.php: 5258 #_widgets.php:88 56 59 $GLOBALS['__l10n']['Attachments text: (%T = text, %D = numeric)'] = 'Texte pour le nombre d\'annexes : (%T = texte, %D = nombre)'; 57 60 58 #_widgets.php: 5361 #_widgets.php:89 59 62 $GLOBALS['__l10n']['Attachments: %T'] = 'Annexes : %T'; 60 63 61 #_widgets.php: 5564 #_widgets.php:94 62 65 $GLOBALS['__l10n']['Comments text: (%T = text, %D = numeric)'] = 'Texte pour le nombre de commentaires : (%T = texte, %D = nombre)'; 63 66 64 #_widgets.php: 5667 #_widgets.php:95 65 68 $GLOBALS['__l10n']['Comments: %T'] = 'Commentaires : %T'; 66 69 67 #_widgets.php: 5870 #_widgets.php:100 68 71 $GLOBALS['__l10n']['Trackbacks text: (%T = text, %D = numeric)'] = 'Texte pour le nombre de rétroliens: (%T = texte, %D = nombre)'; 69 72 70 #_widgets.php: 5973 #_widgets.php:101 71 74 $GLOBALS['__l10n']['Trackbacks: %T'] = 'Rétroliens : %T'; 72 75 73 #_widgets.php: 6176 #_widgets.php:106 74 77 $GLOBALS['__l10n']['Permalink text: (%T = text link, %F = full link)'] = 'Texte pour le lien pemanent : (%T = texte, %F = complet)'; 75 78 76 #_widgets.php: 6277 #_widgets.php: 6778 #_widgets.php: 7079 #_widgets.php: 7380 #_widgets.php: 7679 #_widgets.php:107 80 #_widgets.php:119 81 #_widgets.php:125 82 #_widgets.php:131 83 #_widgets.php:137 81 84 $GLOBALS['__l10n']['%T'] = '%T'; 82 85 83 #_widgets.php: 6486 #_widgets.php:112 84 87 $GLOBALS['__l10n']['Show comment feed url'] = 'Afficher l\'URL du flux des commentaires'; 85 88 86 #_widgets.php: 6689 #_widgets.php:118 87 90 $GLOBALS['__l10n']['Link to previous entry: (%T = navigation text, %F = entry title)'] = 'Lien vers le billet précédent : (%T = texte de navigation, %F = titre du billet)'; 88 91 89 #_widgets.php: 6992 #_widgets.php:124 90 93 $GLOBALS['__l10n']['Link to next entry: (%T = navigation text, %F = entry title)'] = 'Lien vers le billet suivant : (%T = texte de navigation, %F = titre du billet)'; 91 94 92 #_widgets.php: 7295 #_widgets.php:130 93 96 $GLOBALS['__l10n']['Link to previous entry of this category: (%T = navigation text, %F = entry title)'] = 'Lien vers le billet précédent de la catégorie : (%T = texte de navigation, %F = titre du billet)'; 94 97 95 #_widgets.php: 7598 #_widgets.php:136 96 99 $GLOBALS['__l10n']['Link to next entry of this category: (%T = navigation text, %F = entry title)'] = 'Lien vers le billet suivant de la catégorie: (%T = texte de navigation, %F = titre du billet)'; 97 100 98 #_widgets.php: 78101 #_widgets.php:142 99 102 $GLOBALS['__l10n']['Try to adapt style'] = 'Essayer d\'adapter le style :'; 100 103 101 #_widgets.php: 79104 #_widgets.php:146 102 105 $GLOBALS['__l10n']['No style'] = 'sans style'; 103 106 104 #_widgets.php: 80107 #_widgets.php:147 105 108 $GLOBALS['__l10n']['Small icon'] = 'petite icône'; 106 109 107 #_widgets.php: 81110 #_widgets.php:148 108 111 $GLOBALS['__l10n']['Normal icon'] = 'icône normale'; 109 112 110 #_widgets.php: 83113 #_widgets.php:153 111 114 $GLOBALS['__l10n']['Try to remove entry information'] = 'Essayer de cacher les information du billet'; 112 115 113 #_widgets.php: 85116 #_widgets.php:159 114 117 $GLOBALS['__l10n']['Try to remove entry tags'] = 'Essayer de cacher la liste des tags du billet'; 115 118 116 #_widgets.php: 87119 #_widgets.php:165 117 120 $GLOBALS['__l10n']['Try to remove entry navigation'] = 'Essayer de cacher les liens de navigation'; 118 121 119 #_widgets.php:258 120 $GLOBALS['__l10n']['Previous entry'] = 'Billet précédent'; 121 122 #_widgets.php:267 123 $GLOBALS['__l10n']['Next entry'] = 'Billet suivant'; 124 125 #_widgets.php:276 122 #_widgets.php:521 126 123 $GLOBALS['__l10n']['Previous entry of this category'] = 'Billet précédent de cette catégorie'; 127 124 128 #_widgets.php: 285125 #_widgets.php:538 129 126 $GLOBALS['__l10n']['Next entry of this category'] = 'Billet suivant de cette catégorie'; 130 127 -
plugins/postInfoWidget/locales/fr/main.po
r2254 r3256 1 # Language: français2 # Module: postInfoWidget - 0. 13 # Date: 201 0-05-23 23:46:224 # Translated with translater 1.31 # Language: Français 2 # Module: postInfoWidget - 0.4 3 # Date: 2013-11-12 15:08:48 4 # Translated with translater 2013.05.11 5 5 6 6 msgid "" 7 7 msgstr "" 8 8 "Content-Type: text/plain; charset=UTF-8\n" 9 "Project-Id-Version: postInfoWidget 0. 1\n"9 "Project-Id-Version: postInfoWidget 0.4\n" 10 10 "POT-Creation-Date: \n" 11 "PO-Revision-Date: 201 0-05-23T23:46:22+00:00\n"12 "Last-Translator: J CDenis\n"11 "PO-Revision-Date: 2013-11-12T15:08:48+00:00\n" 12 "Last-Translator: Jean-Christian Denis\n" 13 13 "Language-Team: \n" 14 14 "MIME-Version: 1.0\n" 15 15 "Content-Transfer-Encoding: 8bit\n" 16 16 17 #: _widgets.php: 2417 #: _widgets.php:31 18 18 msgid "Entry information list" 19 19 msgstr "Liste d'information du billet" 20 20 21 #: _widgets.php:27 21 #: _widgets.php:34 22 msgid "Show Entry informations on a widget" 23 msgstr "Afficher les informations d'un billet dans un widget" 24 25 #: _widgets.php:39 22 26 msgid "About this entry" 23 27 msgstr "Á propos de ce billet" 24 28 25 #: _widgets.php: 2929 #: _widgets.php:44 26 30 msgid "Publish date text:" 27 31 msgstr "Texte pour la date de publication :" 28 32 29 #: _widgets.php: 3033 #: _widgets.php:45 30 34 msgid "Publish on %Y-%m-%d %H:%M" 31 35 msgstr "Publié le %d/%m/%Y à %H:%M" 32 36 33 #: _widgets.php: 3237 #: _widgets.php:50 34 38 msgid "Create date text:" 35 39 msgstr "Texte pour la date de création :" 36 40 37 #: _widgets.php: 3341 #: _widgets.php:51 38 42 msgid "Create on %Y-%m-%d %H:%M" 39 43 msgstr "Créé le %d/%m/%Y à %H:%M" 40 44 41 #: _widgets.php: 3545 #: _widgets.php:56 42 46 msgid "Update date text:" 43 47 msgstr "Texte pour la date de dernière mise à jour :" 44 48 45 #: _widgets.php: 3649 #: _widgets.php:57 46 50 msgid "Update on %Y-%m-%d %H:%M" 47 51 msgstr "Mis à jour le %d/%m/%Y à %H:%M" 48 52 49 #: _widgets.php: 3853 #: _widgets.php:62 50 54 msgid "Language: (%T = name, %C = code, %F = flag)" 51 55 msgstr "Text pour la langue : (%T = nom, %C = code, %F = drapeau)" 52 56 53 #: _widgets.php: 3957 #: _widgets.php:63 54 58 msgid "Language: %T %F" 55 59 msgstr "Langue : %T %F" 56 60 57 #: _widgets.php: 4161 #: _widgets.php:68 58 62 msgid "Author text: (%T = author)" 59 63 msgstr "Texte pour l'auteur : (%T = auteur)" 60 64 61 #: _widgets.php: 4265 #: _widgets.php:69 62 66 msgid "Author: %T" 63 67 msgstr "Auteur : %T" 64 68 65 #: _widgets.php: 4469 #: _widgets.php:74 66 70 msgid "Category text: (%T = category)" 67 71 msgstr "Texte pour la catégorie : (%T = catégorie)" 68 72 69 #: _widgets.php: 4573 #: _widgets.php:75 70 74 msgid "Category: %T" 71 75 msgstr "Catégorie : %T" 72 76 73 #: _widgets.php: 4877 #: _widgets.php:81 74 78 msgid "Tags text: (%T = tags list)" 75 79 msgstr "Text pour les tags : (%T = liste des tags)" 76 80 77 #: _widgets.php: 4981 #: _widgets.php:82 78 82 msgid "Tags: %T" 79 83 msgstr "Tags : %T" 80 84 81 #: _widgets.php: 5285 #: _widgets.php:88 82 86 msgid "Attachments text: (%T = text, %D = numeric)" 83 87 msgstr "Texte pour le nombre d'annexes : (%T = texte, %D = nombre)" 84 88 85 #: _widgets.php: 5389 #: _widgets.php:89 86 90 msgid "Attachments: %T" 87 91 msgstr "Annexes : %T" 88 92 89 #: _widgets.php: 5593 #: _widgets.php:94 90 94 msgid "Comments text: (%T = text, %D = numeric)" 91 95 msgstr "Texte pour le nombre de commentaires : (%T = texte, %D = nombre)" 92 96 93 #: _widgets.php: 5697 #: _widgets.php:95 94 98 msgid "Comments: %T" 95 99 msgstr "Commentaires : %T" 96 100 97 #: _widgets.php: 58101 #: _widgets.php:100 98 102 msgid "Trackbacks text: (%T = text, %D = numeric)" 99 103 msgstr "Texte pour le nombre de rétroliens: (%T = texte, %D = nombre)" 100 104 101 #: _widgets.php: 59105 #: _widgets.php:101 102 106 msgid "Trackbacks: %T" 103 107 msgstr "Rétroliens : %T" 104 108 105 #: _widgets.php: 61109 #: _widgets.php:106 106 110 msgid "Permalink text: (%T = text link, %F = full link)" 107 111 msgstr "Texte pour le lien pemanent : (%T = texte, %F = complet)" 108 112 109 #: _widgets.php: 62110 #: _widgets.php: 67111 #: _widgets.php: 70112 #: _widgets.php: 73113 #: _widgets.php: 76113 #: _widgets.php:107 114 #: _widgets.php:119 115 #: _widgets.php:125 116 #: _widgets.php:131 117 #: _widgets.php:137 114 118 msgid "%T" 115 119 msgstr "%T" 116 120 117 #: _widgets.php: 64121 #: _widgets.php:112 118 122 msgid "Show comment feed url" 119 123 msgstr "Afficher l'URL du flux des commentaires" 120 124 121 #: _widgets.php: 66125 #: _widgets.php:118 122 126 msgid "Link to previous entry: (%T = navigation text, %F = entry title)" 123 127 msgstr "Lien vers le billet précédent : (%T = texte de navigation, %F = titre du billet)" 124 128 125 #: _widgets.php: 69129 #: _widgets.php:124 126 130 msgid "Link to next entry: (%T = navigation text, %F = entry title)" 127 131 msgstr "Lien vers le billet suivant : (%T = texte de navigation, %F = titre du billet)" 128 132 129 #: _widgets.php: 72133 #: _widgets.php:130 130 134 msgid "Link to previous entry of this category: (%T = navigation text, %F = entry title)" 131 135 msgstr "Lien vers le billet précédent de la catégorie : (%T = texte de navigation, %F = titre du billet)" 132 136 133 #: _widgets.php: 75137 #: _widgets.php:136 134 138 msgid "Link to next entry of this category: (%T = navigation text, %F = entry title)" 135 139 msgstr "Lien vers le billet suivant de la catégorie: (%T = texte de navigation, %F = titre du billet)" 136 140 137 #: _widgets.php: 78141 #: _widgets.php:142 138 142 msgid "Try to adapt style" 139 143 msgstr "Essayer d'adapter le style :" 140 144 141 #: _widgets.php: 79145 #: _widgets.php:146 142 146 msgid "No style" 143 147 msgstr "sans style" 144 148 145 #: _widgets.php: 80149 #: _widgets.php:147 146 150 msgid "Small icon" 147 151 msgstr "petite icône" 148 152 149 #: _widgets.php: 81153 #: _widgets.php:148 150 154 msgid "Normal icon" 151 155 msgstr "icône normale" 152 156 153 #: _widgets.php: 83157 #: _widgets.php:153 154 158 msgid "Try to remove entry information" 155 159 msgstr "Essayer de cacher les information du billet" 156 160 157 #: _widgets.php: 85161 #: _widgets.php:159 158 162 msgid "Try to remove entry tags" 159 163 msgstr "Essayer de cacher la liste des tags du billet" 160 164 161 #: _widgets.php: 87165 #: _widgets.php:165 162 166 msgid "Try to remove entry navigation" 163 167 msgstr "Essayer de cacher les liens de navigation" 164 168 165 #: _widgets.php:258 166 msgid "Previous entry" 167 msgstr "Billet précédent" 168 169 #: _widgets.php:267 170 msgid "Next entry" 171 msgstr "Billet suivant" 172 173 #: _widgets.php:276 169 #: _widgets.php:521 174 170 msgid "Previous entry of this category" 175 171 msgstr "Billet précédent de cette catégorie" 176 172 177 #: _widgets.php: 285173 #: _widgets.php:538 178 174 msgid "Next entry of this category" 179 175 msgstr "Billet suivant de cette catégorie"
Note: See TracChangeset
for help on using the changeset viewer.