cleanup 2021

This commit is contained in:
Jean-Christian Denis 2021-08-27 21:01:19 +02:00
parent 74e25ff15b
commit 9899da09d1
11 changed files with 843 additions and 713 deletions

View file

@ -1,22 +0,0 @@
postInfoWidget 0.5.1 - 2015-04-23 - Pierre Van Glabeke
* modif url support
postInfoWidget 0.5 - 2015-01-29 - Pierre Van Glabeke
* ajout case hors ligne
* modif localisation
* fin de ligne unix (LF)
postInfoWidget 0.4 - 2013-11-12
* Switch to Dotclear 2.6
* Clean up code
* Add widget options
postInfoWidget 0.3 - 2010-06-21
* Fixed tags list
* Fixed nav links
postInfoWidget 0.2 - 2010-06-05
* Switched to DC 2.2
postInfoWidget 0.1 - 2010-05-24
* First lab release

26
CHANGELOG.md Normal file
View file

@ -0,0 +1,26 @@
postInfoWidget 0.6 - 2021.08.27
- cleanup (PSR2, short array, ...)
- update license
postInfoWidget 0.5.1 - 2015.04.23 - Pierre Van Glabeke
- modif url support
postInfoWidget 0.5 - 2015-01-29 - Pierre Van Glabeke
- ajout case hors ligne
- modif localisation
- fin de ligne unix (LF)
postInfoWidget 0.4 - 2013.11.12
- Switch to Dotclear 2.6
- Clean up code
- Add widget options
postInfoWidget 0.3 - 2010.06.21
- Fixed tags list
- Fixed nav links
postInfoWidget 0.2 - 2010.06.05
- Switched to DC 2.2
postInfoWidget 0.1 - 2010.05.24
- First lab release

View file

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/> Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found. the "copyright" line and a pointer to where the full notice is found.
{description} <one line to give the program's name and a brief idea of what it does.>
Copyright (C) {year} {fullname} Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -329,7 +329,7 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker. `Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989 <signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice Ty Coon, President of Vice
This General Public License does not permit incorporating your program into This General Public License does not permit incorporating your program into
@ -337,4 +337,3 @@ proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. Public License instead of this License.

View file

@ -20,3 +20,14 @@ First install postInfoWidget, manualy from a zip package or from
Dotaddict repository. (See Dotclear's documentation to know how do this) Dotaddict repository. (See Dotclear's documentation to know how do this)
Add and configure "Entry information list" from widgets manager. Add and configure "Entry information list" from widgets manager.
## MORE
* License : GNU GPL v2
* Source & contribution : [GitHub Page](https://github.com/JcDenis/postInfoWidget)
* Packages & details: [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/postInfoWidget)
## CONTRIBUTORS
* Jean-Chirstian Denis
* Pierre Van Glabeke

View file

@ -3,7 +3,7 @@
# #
# This file is part of postInfoWidget, a plugin for Dotclear 2. # This file is part of postInfoWidget, a plugin for Dotclear 2.
# #
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors # Copyright (c) 2009-2021 Jean-Christian Denis and contributors
# #
# Licensed under the GPL version 2.0 license. # Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at # A copy of this license is available in LICENSE file or at
@ -12,8 +12,7 @@
# -- END LICENSE BLOCK ------------------------------------ # -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return null; return null;
} }
require dirname(__FILE__).'/_widgets.php'; require dirname(__FILE__) . '/_widgets.php';

View file

@ -3,7 +3,7 @@
# #
# This file is part of postInfoWidget, a plugin for Dotclear 2. # This file is part of postInfoWidget, a plugin for Dotclear 2.
# #
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors # Copyright (c) 2009-2021 Jean-Christian Denis and contributors
# #
# Licensed under the GPL version 2.0 license. # Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at # A copy of this license is available in LICENSE file or at
@ -12,24 +12,20 @@
# -- END LICENSE BLOCK ------------------------------------ # -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }
$this->registerModule( $this->registerModule(
/* Name */ 'postInfoWidget',
"postInfoWidget", 'Show Entry informations on a widget',
/* Description*/ 'Jean-Christian Denis, Pierre Van Glabeke',
"Show Entry informations on a widget", '0.6',
/* Author */ [
"Jean-Christian Denis, Pierre Van Glabeke",
/* Version */
'0.5.1',
array(
'permissions' => 'usage,contentadmin', 'permissions' => 'usage,contentadmin',
'type' => 'plugin', 'type' => 'plugin',
'dc_min' => '2.7', 'dc_min' => '2.19',
'support' => 'http://forum.dotclear.org/viewtopic.php?pid=332974#p332974', 'support' => 'http://forum.dotclear.org/viewtopic.php?pid=332974#p332974',
'details' => 'http://plugins.dotaddict.org/dc2/details/postInfoWidget' 'details' => 'http://plugins.dotaddict.org/dc2/details/postInfoWidget',
) 'repository' => 'https://raw.githubusercontent.com/JcDenis/postInfoWidget/master/dcstore.xml'
]
); );

View file

@ -3,7 +3,7 @@
# #
# This file is part of postInfoWidget, a plugin for Dotclear 2. # This file is part of postInfoWidget, a plugin for Dotclear 2.
# #
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors # Copyright (c) 2009-2021 Jean-Christian Denis and contributors
# #
# Licensed under the GPL version 2.0 license. # Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at # A copy of this license is available in LICENSE file or at
@ -12,8 +12,7 @@
# -- END LICENSE BLOCK ------------------------------------ # -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }
require dirname(__FILE__).'/_widgets.php'; require dirname(__FILE__) . '/_widgets.php';

View file

@ -3,7 +3,7 @@
# #
# This file is part of postInfoWidget, a plugin for Dotclear 2. # This file is part of postInfoWidget, a plugin for Dotclear 2.
# #
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors # Copyright (c) 2009-2021 Jean-Christian Denis and contributors
# #
# Licensed under the GPL version 2.0 license. # Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at # A copy of this license is available in LICENSE file or at
@ -12,13 +12,12 @@
# -- END LICENSE BLOCK ------------------------------------ # -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }
$core->addBehavior( $core->addBehavior(
'initWidgets', 'initWidgets',
array('postInfoWidget', 'adminWidget') ['postInfoWidget', 'adminWidget']
); );
class postInfoWidget class postInfoWidget
@ -27,55 +26,52 @@ class postInfoWidget
{ {
global $core; global $core;
$w->create( $w
->create(
'postinfowidget', 'postinfowidget',
__('PostInfoWidget: entry information list'), __('PostInfoWidget: entry information list'),
array('postInfoWidget', 'publicWidget'), ['postInfoWidget', 'publicWidget'],
null, null,
__('Show Entry informations on a widget') __('Show Entry informations on a widget')
); )
$w->postinfowidget->setting( ->addTitle(__('About this entry'))
'title', ->setting(
__('Title:'),
__('About this entry'),
'text'
);
$w->postinfowidget->setting(
'dt_str', 'dt_str',
__('Publish date text:'), __('Publish date text:'),
__('Publish on %Y-%m-%d %H:%M'), __('Publish on %Y-%m-%d %H:%M'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'creadt_str', 'creadt_str',
__('Create date text:'), __('Create date text:'),
__('Create on %Y-%m-%d %H:%M'), __('Create on %Y-%m-%d %H:%M'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'upddt_str', 'upddt_str',
__('Update date text:'), __('Update date text:'),
__('Update on %Y-%m-%d %H:%M'), __('Update on %Y-%m-%d %H:%M'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'lang_str', 'lang_str',
__('Language (%T = name, %C = code, %F = flag):'), __('Language (%T = name, %C = code, %F = flag):'),
__('Language: %T %F'), __('Language: %T %F'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'author_str', 'author_str',
__('Author text (%T = author):'), __('Author text (%T = author):'),
__('Author: %T'), __('Author: %T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'category_str', 'category_str',
__('Category text (%T = category):'), __('Category text (%T = category):'),
__('Category: %T'), __('Category: %T'),
'text' 'text'
); );
if ($core->plugins->moduleExists('tags')) { if ($core->plugins->moduleExists('tags')) {
$w->postinfowidget->setting( $w->postinfowidget->setting(
'tag_str', 'tag_str',
@ -84,61 +80,63 @@ class postInfoWidget
'text' 'text'
); );
} }
$w->postinfowidget->setting(
$w->postinfowidget
->setting(
'attachment_str', 'attachment_str',
__('Attachments text (%T = text, %D = numeric):'), __('Attachments text (%T = text, %D = numeric):'),
__('Attachments: %T'), __('Attachments: %T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'comment_str', 'comment_str',
__('Comments text (%T = text, %D = numeric):'), __('Comments text (%T = text, %D = numeric):'),
__('Comments: %T'), __('Comments: %T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'trackback_str', 'trackback_str',
__('Trackbacks text (%T = text, %D = numeric):'), __('Trackbacks text (%T = text, %D = numeric):'),
__('Trackbacks: %T'), __('Trackbacks: %T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'permalink_str', 'permalink_str',
__('Permalink text (%T = text link, %F = full link):'), __('Permalink text (%T = text link, %F = full link):'),
__('%T'), __('%T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'feed', 'feed',
__('Show comment feed url'), __('Show comment feed url'),
1, 1,
'check' 'check'
); )
$w->postinfowidget->setting( ->setting(
'navprevpost', 'navprevpost',
__('Link to previous entry (%T = navigation text, %F = entry title):'), __('Link to previous entry (%T = navigation text, %F = entry title):'),
__('%T'), __('%T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'navnextpost', 'navnextpost',
__('Link to next entry (%T = navigation text, %F = entry title):'), __('Link to next entry (%T = navigation text, %F = entry title):'),
__('%T'), __('%T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'navprevcat', 'navprevcat',
__('Link to previous entry of this category (%T = navigation text, %F = entry title):'), __('Link to previous entry of this category (%T = navigation text, %F = entry title):'),
__('%T'), __('%T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'navnextcat', 'navnextcat',
__('Link to next entry of this category (%T = navigation text, %F = entry title):'), __('Link to next entry of this category (%T = navigation text, %F = entry title):'),
__('%T'), __('%T'),
'text' 'text'
); )
$w->postinfowidget->setting( ->setting(
'style', 'style',
__('Try to adapt style'), __('Try to adapt style'),
'small', 'small',
@ -149,59 +147,50 @@ class postInfoWidget
__('Normal icon') => 'normal' __('Normal icon') => 'normal'
) )
); );
$w->postinfowidget->setting( /*
$w->postinfowidget
->setting(
'rmvinfo', 'rmvinfo',
__('Try to remove entry information'), __('Try to remove entry information'),
1, 1,
'check' 'check'
); )
$w->postinfowidget->setting( ->setting(
'rmvtags', 'rmvtags',
__('Try to remove entry tags'), __('Try to remove entry tags'),
1, 1,
'check' 'check'
); )
$w->postinfowidget->setting( ->setting(
'rmvnav', 'rmvnav',
__('Try to remove entry navigation'), __('Try to remove entry navigation'),
1, 1,
'check' 'check'
); );
//*/
# --BEHAVIOR-- postInfoWidgetAdmin # --BEHAVIOR-- postInfoWidgetAdmin
$core->callBehavior('postInfoWidgetAdmin', $w); $core->callBehavior('postInfoWidgetAdmin', $w);
$w->postinfowidget->setting( $w->postinfowidget
'content_only', ->addContentOnly()
__('Content only'), ->addClass()
0, ->addOffline();
'check'
);
$w->postinfowidget->setting(
'class',
__('CSS class:'),
''
);
$w->postinfowidget->setting('offline',__('Offline'),0,'check');
} }
public static function publicWidget($w) public static function publicWidget($w)
{ {
global $core, $_ctx; global $core, $_ctx;
if ($w->offline) if ($w->offline) {
return; return null;
}
if ($core->url->type != 'post' if ($core->url->type != 'post'
|| !$_ctx->posts->post_id || !$_ctx->posts->post_id){
){
return null; return null;
} }
$link = '<a href="%s">%s</a>'; $link = '<a href="%s">%s</a>';
$title = (strlen($w->title) > 0) ?
'<h2>'.html::escapeHTML($w->title).'</h2>' : null;
$content = ''; $content = '';
if ($w->dt_str != '') { if ($w->dt_str != '') {
@ -249,21 +238,21 @@ class postInfoWidget
$ln[$lang_code] : $ln[$lang_code] :
$lang_code; $lang_code;
$lang_flag = file_exists( $lang_flag = file_exists(
dirname(__FILE__). dirname(__FILE__) .
'/img/flags/'. '/img/flags/' .
$lang_code.'.png' $lang_code . '.png'
) ? ) ?
'<img src="'.$core->blog->getQmarkURL(). '<img src="' . $core->blog->getQmarkURL() .
'pf=postInfoWidget/img/flags/'. 'pf=postInfoWidget/img/flags/' .
$lang_code.'.png" alt="'.$lang_name.'" />' : $lang_code . '.png" alt="' . $lang_name . '" />' :
''; '';
$content .= postInfoWidget::li( $content .= postInfoWidget::li(
$w, $w,
'lang', 'lang',
str_replace( str_replace(
array('%T', '%C', '%F'), ['%T', '%C', '%F'],
array($lang_name, $lang_code, $lang_flag), [$lang_name, $lang_code, $lang_flag],
html::escapeHTML($w->lang_str) html::escapeHTML($w->lang_str)
) )
); );
@ -298,16 +287,16 @@ class postInfoWidget
} }
if ($w->tag_str != '' && $core->plugins->moduleExists('tags')) { if ($w->tag_str != '' && $core->plugins->moduleExists('tags')) {
$meta = $core->meta->getMetadata(array( $meta = $core->meta->getMetadata([
'meta_type' => 'tag', 'meta_type' => 'tag',
'post_id' => $_ctx->posts->post_id 'post_id' => $_ctx->posts->post_id
)); ]);
$metas = array(); $metas = [];
while ($meta->fetch()) { while ($meta->fetch()) {
$metas[$meta->meta_id] = sprintf( $metas[$meta->meta_id] = sprintf(
$link, $link,
$core->blog->url. $core->blog->url .
$core->url->getBase('tag')."/". $core->url->getBase('tag') . "/" .
rawurlencode($meta->meta_id), rawurlencode($meta->meta_id),
$meta->meta_id $meta->meta_id
); );
@ -330,8 +319,7 @@ class postInfoWidget
if ($nb == 0) { if ($nb == 0) {
$attachment_numeric = 0; $attachment_numeric = 0;
$attachment_textual = __('no attachment'); $attachment_textual = __('no attachment');
} } elseif ($nb == 1) {
elseif ($nb == 1) {
$attachment_numeric = sprintf( $attachment_numeric = sprintf(
$link, $link,
'#attachment', '#attachment',
@ -342,8 +330,7 @@ class postInfoWidget
'#attachment', '#attachment',
__('one attachment') __('one attachment')
); );
} } else {
else {
$attachment_numeric = sprintf( $attachment_numeric = sprintf(
$link, $link,
'#attachment', '#attachment',
@ -360,8 +347,8 @@ class postInfoWidget
$w, $w,
'attachment', 'attachment',
str_replace( str_replace(
array('%T', '%D'), ['%T', '%D'],
array($attachment_textual, $attachment_numeric), [$attachment_textual, $attachment_numeric],
html::escapeHTML($w->attachment_str) html::escapeHTML($w->attachment_str)
) )
); );
@ -372,8 +359,7 @@ class postInfoWidget
if ($nb == 0) { if ($nb == 0) {
$comment_numeric = 0; $comment_numeric = 0;
$comment_textual = __('no comment'); $comment_textual = __('no comment');
} } elseif ($nb == 1) {
elseif ($nb == 1) {
$comment_numeric = sprintf( $comment_numeric = sprintf(
$link, $link,
'#comments', '#comments',
@ -384,8 +370,7 @@ class postInfoWidget
'#comments', '#comments',
__('one comment') __('one comment')
); );
} } else {
else {
$comment_numeric = sprintf( $comment_numeric = sprintf(
$link, $link,
'#comments', '#comments',
@ -402,8 +387,8 @@ class postInfoWidget
$w, $w,
'comment', 'comment',
str_replace( str_replace(
array('%T', '%D'), ['%T', '%D'],
array($comment_textual, $comment_numeric), [$comment_textual, $comment_numeric],
html::escapeHTML($w->comment_str) html::escapeHTML($w->comment_str)
) )
); );
@ -414,8 +399,7 @@ class postInfoWidget
if ($nb == 0) { if ($nb == 0) {
$trackback_numeric = 0; $trackback_numeric = 0;
$trackback_textual = __('no trackback'); $trackback_textual = __('no trackback');
} } elseif ($nb == 1) {
elseif ($nb == 1) {
$trackback_numeric = sprintf( $trackback_numeric = sprintf(
$link, $link,
'#pings', '#pings',
@ -426,8 +410,7 @@ class postInfoWidget
'#pings', '#pings',
__('one trackback') __('one trackback')
); );
} } else {
else {
$trackback_numeric = sprintf( $trackback_numeric = sprintf(
$link, $link,
'#pings', '#pings',
@ -444,7 +427,7 @@ class postInfoWidget
$w, $w,
'trackback', 'trackback',
str_replace( str_replace(
array('%T', '%D'), ['%T', '%D'],
array($trackback_textual, $trackback_numeric), array($trackback_textual, $trackback_numeric),
html::escapeHTML($w->trackback_str) html::escapeHTML($w->trackback_str)
) )
@ -456,14 +439,15 @@ class postInfoWidget
$w, $w,
'permalink', 'permalink',
str_replace( str_replace(
array('%T', '%F'), ['%T', '%F'],
array( [
sprintf( sprintf(
$link, $link,
$_ctx->posts->getURL(), $_ctx->posts->getURL(),
__('Permalink')), __('Permalink')
$_ctx->posts->getURL()
), ),
$_ctx->posts->getURL()
],
html::escapeHTML($w->permalink_str) html::escapeHTML($w->permalink_str)
) )
); );
@ -475,9 +459,9 @@ class postInfoWidget
'feed', 'feed',
sprintf( sprintf(
$link, $link,
$core->blog->url. $core->blog->url .
$core->url->getBase('feed'). $core->url->getBase('feed') .
'/atom/comments/'. '/atom/comments/' .
$_ctx->posts->post_id, $_ctx->posts->post_id,
__("This post's comments feed"), __("This post's comments feed"),
html::escapeHTML($w->tag_str) html::escapeHTML($w->tag_str)
@ -556,10 +540,9 @@ class postInfoWidget
$content .= $core->callBehavior('postInfoWidgetPublic', $w); $content .= $core->callBehavior('postInfoWidgetPublic', $w);
if (empty($content)) { if (empty($content)) {
return null; return null;
} }
/*
$rmv = ''; $rmv = '';
if ($w->rmvinfo || $w->rmvtags || $w->rmvnav) { if ($w->rmvinfo || $w->rmvtags || $w->rmvnav) {
$rmv .= $rmv .=
@ -584,24 +567,28 @@ class postInfoWidget
'});'."\n". '});'."\n".
"</script>\n"; "</script>\n";
} }
//*/
$rmv = return $w->renderDiv(
$w->content_only,
'postinfowidget ' . $w->class,
'',
($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : ''). ($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '').
'<ul>'.$content.'</ul>'; sprintf('<ul>%s</ul>', $content)
);
return $w->renderDiv($w->content_only,'postinfowidget '.$w->class,'',$rmv);
} }
public static function li($w, $i, $c) public static function li($w, $i, $c)
{ {
$s = ' style="padding-left:%spx;background: transparent url(\''.$GLOBALS['core']->blog->getQmarkURL().'pf=postInfoWidget/img/%s%s.png\') no-repeat left center;"'; global $core;
$s = ' style="padding-left:%spx;background: transparent url(\'' .
$core->blog->getQmarkURL() .
'pf=postInfoWidget/img/%s%s.png\') no-repeat left center;"';
if ($w->style == 'small') { if ($w->style == 'small') {
$s = sprintf($s, 16, $i, '-small'); $s = sprintf($s, 16, $i, '-small');
} } elseif($w->style == 'normal') {
elseif($w->style == 'normal') {
$s = sprintf($s, 20, $i, ''); $s = sprintf($s, 20, $i, '');
} } else {
else {
$s = ''; $s = '';
} }
$l = '<li class="postinfo-%s"%s>%s</li>'; $l = '<li class="postinfo-%s"%s>%s</li>';
@ -614,18 +601,17 @@ class postInfoWidget
global $core; global $core;
$rs = $core->blog->getNextPost($p, $d, $r); $rs = $core->blog->getNextPost($p, $d, $r);
if ($rs !== null) { if (is_null($rs)) {
return '';
}
$l = '<a href="%s" title="%s">%s</a>'; $l = '<a href="%s" title="%s">%s</a>';
$u = $rs->getURL(); $u = $rs->getURL();
$e = html::escapeHTML($rs->post_title); $e = html::escapeHTML($rs->post_title);
return str_replace( return str_replace(
array('%T', '%F'), ['%T', '%F'],
array(sprintf($l, $u, $e, $t), sprintf($l, $u, $t, $e)), [sprintf($l, $u, $e, $t), sprintf($l, $u, $t, $e)],
$c $c
); );
} }
return '';
}
} }

13
dcstore.xml Normal file
View file

@ -0,0 +1,13 @@
<modules xmlns:da="http://dotaddict.org/da/">
<module id="postInfoWidget">
<name>postInfoWidget</name>
<version>0.6</version>
<author>Jean-Christian Denis, Pierre Van Glabeke</author>
<desc>Show Entry informations on a widget</desc>
<file>https://github.com/JcDenis/postInfoWidget/releases/download/v0.6/plugin-postInfoWidget.zip</file>
<da:dcmin>2.19</da:dcmin>
<da:details>http://plugins.dotaddict.org/dc2/details/postInfoWidget</da:details>
<da:section></da:section>
<da:support>http://forum.dotclear.org/viewtopic.php?pid=332974#p332974</da:support>
</module>
</modules>

141
locales/fr/main.lang.php Normal file
View file

@ -0,0 +1,141 @@
<?php
// Language: Français
// Module: postInfoWidget - 0.6
// Date: 2021-08-27 18:59:52
// Translated with dcTranslater - 2021.08.18
#_widgets.php:32
$GLOBALS['__l10n']['PostInfoWidget: entry information list'] = 'PostInfoWidget : liste d\'information du billet';
#_widgets.php:35
$GLOBALS['__l10n']['Show Entry informations on a widget'] = 'Afficher les informations d\'un billet dans un widget';
#_widgets.php:37
$GLOBALS['__l10n']['About this entry'] = 'Á propos de ce billet';
#_widgets.php:40
$GLOBALS['__l10n']['Publish date text:'] = 'Texte pour la date de publication :';
#_widgets.php:41
$GLOBALS['__l10n']['Publish on %Y-%m-%d %H:%M'] = 'Publié le %d/%m/%Y à %H:%M';
#_widgets.php:46
$GLOBALS['__l10n']['Create date text:'] = 'Texte pour la date de création :';
#_widgets.php:47
$GLOBALS['__l10n']['Create on %Y-%m-%d %H:%M'] = 'Créé le %d/%m/%Y à %H:%M';
#_widgets.php:52
$GLOBALS['__l10n']['Update date text:'] = 'Texte pour la date de dernière mise à jour :';
#_widgets.php:53
$GLOBALS['__l10n']['Update on %Y-%m-%d %H:%M'] = 'Mis à jour le %d/%m/%Y à %H:%M';
#_widgets.php:58
$GLOBALS['__l10n']['Language (%T = name, %C = code, %F = flag):'] = 'Texte pour la langue (%T = nom, %C = code, %F = drapeau) :';
#_widgets.php:59
$GLOBALS['__l10n']['Language: %T %F'] = 'Langue : %T %F';
#_widgets.php:64
$GLOBALS['__l10n']['Author text (%T = author):'] = 'Texte pour l\'auteur (%T = auteur) :';
#_widgets.php:65
$GLOBALS['__l10n']['Author: %T'] = 'Auteur : %T';
#_widgets.php:70
$GLOBALS['__l10n']['Category text (%T = category):'] = 'Texte pour la catégorie (%T = catégorie) :';
#_widgets.php:71
$GLOBALS['__l10n']['Category: %T'] = 'Catégorie : %T';
#_widgets.php:78
$GLOBALS['__l10n']['Tags text (%T = tags list):'] = 'Texte pour les mots-clés (%T = liste des mots-clés) :';
#_widgets.php:79
$GLOBALS['__l10n']['Tags: %T'] = 'Mots-clés : %T';
#_widgets.php:87
$GLOBALS['__l10n']['Attachments text (%T = text, %D = numeric):'] = 'Texte pour le nombre d\'annexes (%T = texte, %D = nombre) :';
#_widgets.php:88
$GLOBALS['__l10n']['Attachments: %T'] = 'Annexes : %T';
#_widgets.php:93
$GLOBALS['__l10n']['Comments text (%T = text, %D = numeric):'] = 'Texte pour le nombre de commentaires (%T = texte, %D = nombre) :';
#_widgets.php:94
$GLOBALS['__l10n']['Comments: %T'] = 'Commentaires : %T';
#_widgets.php:99
$GLOBALS['__l10n']['Trackbacks text (%T = text, %D = numeric):'] = 'Texte pour le nombre de rétroliens (%T = texte, %D = nombre) :';
#_widgets.php:100
$GLOBALS['__l10n']['Trackbacks: %T'] = 'Rétroliens : %T';
#_widgets.php:105
$GLOBALS['__l10n']['Permalink text (%T = text link, %F = full link):'] = 'Texte pour le lien pemanent (%T = texte, %F = complet) :';
#_widgets.php:106
#_widgets.php:118
#_widgets.php:124
#_widgets.php:130
#_widgets.php:136
$GLOBALS['__l10n']['%T'] = '%T';
#_widgets.php:111
$GLOBALS['__l10n']['Show comment feed url'] = 'Afficher l\'URL du flux des commentaires';
#_widgets.php:117
$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) :';
#_widgets.php:123
$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) :';
#_widgets.php:129
$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) :';
#_widgets.php:135
$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) :';
#_widgets.php:145
$GLOBALS['__l10n']['No style'] = 'sans style';
#_widgets.php:146
$GLOBALS['__l10n']['Small icon'] = 'petite icône';
#_widgets.php:147
$GLOBALS['__l10n']['Normal icon'] = 'icône normale';
#_widgets.php:154
$GLOBALS['__l10n']['Try to remove entry information'] = 'Essayer de cacher les informations du billet';
#_widgets.php:160
$GLOBALS['__l10n']['Try to remove entry tags'] = 'Essayer de cacher la liste des mots-clés du billet';
#_widgets.php:166
$GLOBALS['__l10n']['Try to remove entry navigation'] = 'Essayer de cacher les liens de navigation';
#_widgets.php:321
$GLOBALS['__l10n']['no attachment'] = 'aucune annexe';
#_widgets.php:361
$GLOBALS['__l10n']['no comment'] = 'aucun commentaire';
#_widgets.php:401
$GLOBALS['__l10n']['no trackback'] = 'aucun rétrolien';
#_widgets.php:477
$GLOBALS['__l10n']['Previous entry'] = 'Billet précédent';
#_widgets.php:493
$GLOBALS['__l10n']['Next entry'] = 'Billet suivant';
#_widgets.php:510
$GLOBALS['__l10n']['Previous entry of this category'] = 'Billet précédent de cette catégorie';
#_widgets.php:527
$GLOBALS['__l10n']['Next entry of this category'] = 'Billet suivant de cette catégorie';
$GLOBALS['__l10n']['Try to adapt style:'] = 'Essayer d\'adapter le style :';

View file

@ -1,214 +1,196 @@
# Language: Français
# Module: postInfoWidget - 0.6
# Date: 2021-08-27 18:59:52
# Translated with translater 2021.08.18
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: postInfoWidget 0.5\n" "Project-Id-Version: postInfoWidget 0.6\n"
"POT-Creation-Date: \n" "POT-Creation-Date: \n"
"PO-Revision-Date: 2013-11-12T15:08:48+00:00\n" "PO-Revision-Date: 2021-08-27T18:59:52+00:00\n"
"Last-Translator: Jean-Christian Denis\n" "Last-Translator: Jean-Christian Denis\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: _widgets.php:31 #: _widgets.php:32
msgid "PostInfoWidget: entry information list" msgid "PostInfoWidget: entry information list"
msgstr "PostInfoWidget : liste d'information du billet" msgstr "PostInfoWidget : liste d'information du billet"
#: _widgets.php:34 #: _widgets.php:35
msgid "Show Entry informations on a widget" msgid "Show Entry informations on a widget"
msgstr "Afficher les informations d'un billet dans un widget" msgstr "Afficher les informations d'un billet dans un widget"
#: _widgets.php:39 #: _widgets.php:37
msgid "About this entry" msgid "About this entry"
msgstr "Á propos de ce billet" msgstr "Á propos de ce billet"
#: _widgets.php:44 #: _widgets.php:40
msgid "Publish date text:" msgid "Publish date text:"
msgstr "Texte pour la date de publication :" msgstr "Texte pour la date de publication :"
#: _widgets.php:45 #: _widgets.php:41
msgid "Publish on %Y-%m-%d %H:%M" msgid "Publish on %Y-%m-%d %H:%M"
msgstr "Publié le %d/%m/%Y à %H:%M" msgstr "Publié le %d/%m/%Y à %H:%M"
#: _widgets.php:50 #: _widgets.php:46
msgid "Create date text:" msgid "Create date text:"
msgstr "Texte pour la date de création :" msgstr "Texte pour la date de création :"
#: _widgets.php:51 #: _widgets.php:47
msgid "Create on %Y-%m-%d %H:%M" msgid "Create on %Y-%m-%d %H:%M"
msgstr "Créé le %d/%m/%Y à %H:%M" msgstr "Créé le %d/%m/%Y à %H:%M"
#: _widgets.php:56 #: _widgets.php:52
msgid "Update date text:" msgid "Update date text:"
msgstr "Texte pour la date de dernière mise à jour :" msgstr "Texte pour la date de dernière mise à jour :"
#: _widgets.php:57 #: _widgets.php:53
msgid "Update on %Y-%m-%d %H:%M" msgid "Update on %Y-%m-%d %H:%M"
msgstr "Mis à jour le %d/%m/%Y à %H:%M" msgstr "Mis à jour le %d/%m/%Y à %H:%M"
#: _widgets.php:62 #: _widgets.php:58
msgid "Language (%T = name, %C = code, %F = flag):" msgid "Language (%T = name, %C = code, %F = flag):"
msgstr "Texte pour la langue (%T = nom, %C = code, %F = drapeau) :" msgstr "Texte pour la langue (%T = nom, %C = code, %F = drapeau) :"
#: _widgets.php:63 #: _widgets.php:59
msgid "Language: %T %F" msgid "Language: %T %F"
msgstr "Langue : %T %F" msgstr "Langue : %T %F"
#: _widgets.php:68 #: _widgets.php:64
msgid "Author text (%T = author):" msgid "Author text (%T = author):"
msgstr "Texte pour l'auteur (%T = auteur) :" msgstr "Texte pour l'auteur (%T = auteur) :"
#: _widgets.php:69 #: _widgets.php:65
msgid "Author: %T" msgid "Author: %T"
msgstr "Auteur : %T" msgstr "Auteur : %T"
#: _widgets.php:74 #: _widgets.php:70
msgid "Category text (%T = category):" msgid "Category text (%T = category):"
msgstr "Texte pour la catégorie (%T = catégorie) :" msgstr "Texte pour la catégorie (%T = catégorie) :"
#: _widgets.php:75 #: _widgets.php:71
msgid "Category: %T" msgid "Category: %T"
msgstr "Catégorie : %T" msgstr "Catégorie : %T"
#: _widgets.php:81 #: _widgets.php:78
msgid "Tags text (%T = tags list):" msgid "Tags text (%T = tags list):"
msgstr "Texte pour les mots-clés (%T = liste des mots-clés) :" msgstr "Texte pour les mots-clés (%T = liste des mots-clés) :"
#: _widgets.php:82 #: _widgets.php:79
msgid "Tags: %T" msgid "Tags: %T"
msgstr "Mots-clés : %T" msgstr "Mots-clés : %T"
#: _widgets.php:88 #: _widgets.php:87
msgid "Attachments text (%T = text, %D = numeric):" msgid "Attachments text (%T = text, %D = numeric):"
msgstr "Texte pour le nombre d'annexes (%T = texte, %D = nombre) :" msgstr "Texte pour le nombre d'annexes (%T = texte, %D = nombre) :"
#: _widgets.php:89 #: _widgets.php:88
msgid "Attachments: %T" msgid "Attachments: %T"
msgstr "Annexes : %T" msgstr "Annexes : %T"
#: _widgets.php:94 #: _widgets.php:93
msgid "Comments text (%T = text, %D = numeric):" msgid "Comments text (%T = text, %D = numeric):"
msgstr "Texte pour le nombre de commentaires (%T = texte, %D = nombre) :" msgstr "Texte pour le nombre de commentaires (%T = texte, %D = nombre) :"
#: _widgets.php:95 #: _widgets.php:94
msgid "Comments: %T" msgid "Comments: %T"
msgstr "Commentaires : %T" msgstr "Commentaires : %T"
#: _widgets.php:100 #: _widgets.php:99
msgid "Trackbacks text (%T = text, %D = numeric):" msgid "Trackbacks text (%T = text, %D = numeric):"
msgstr "Texte pour le nombre de rétroliens (%T = texte, %D = nombre) :" msgstr "Texte pour le nombre de rétroliens (%T = texte, %D = nombre) :"
#: _widgets.php:101 #: _widgets.php:100
msgid "Trackbacks: %T" msgid "Trackbacks: %T"
msgstr "Rétroliens : %T" msgstr "Rétroliens : %T"
#: _widgets.php:106 #: _widgets.php:105
msgid "Permalink text (%T = text link, %F = full link):" msgid "Permalink text (%T = text link, %F = full link):"
msgstr "Texte pour le lien pemanent (%T = texte, %F = complet) :" msgstr "Texte pour le lien pemanent (%T = texte, %F = complet) :"
#: _widgets.php:107 #: _widgets.php:106
#: _widgets.php:119 #: _widgets.php:118
#: _widgets.php:125 #: _widgets.php:124
#: _widgets.php:131 #: _widgets.php:130
#: _widgets.php:137 #: _widgets.php:136
msgid "%T" msgid "%T"
msgstr "%T" msgstr "%T"
#: _widgets.php:112 #: _widgets.php:111
msgid "Show comment feed url" msgid "Show comment feed url"
msgstr "Afficher l'URL du flux des commentaires" msgstr "Afficher l'URL du flux des commentaires"
#: _widgets.php:118 #: _widgets.php:117
msgid "Link to previous entry (%T = navigation text, %F = entry title):" msgid "Link to previous entry (%T = navigation text, %F = entry title):"
msgstr "Lien vers le billet précédent (%T = texte de navigation, %F = titre du billet) :" msgstr "Lien vers le billet précédent (%T = texte de navigation, %F = titre du billet) :"
#: _widgets.php:124 #: _widgets.php:123
msgid "Link to next entry (%T = navigation text, %F = entry title):" msgid "Link to next entry (%T = navigation text, %F = entry title):"
msgstr "Lien vers le billet suivant (%T = texte de navigation, %F = titre du billet) :" msgstr "Lien vers le billet suivant (%T = texte de navigation, %F = titre du billet) :"
#: _widgets.php:130 #: _widgets.php:129
msgid "Link to previous entry of this category (%T = navigation text, %F = entry title):" msgid "Link to previous entry of this category (%T = navigation text, %F = entry title):"
msgstr "Lien vers le billet précédent de la catégorie (%T = texte de navigation, %F = titre du billet) :" msgstr "Lien vers le billet précédent de la catégorie (%T = texte de navigation, %F = titre du billet) :"
#: _widgets.php:136 #: _widgets.php:135
msgid "Link to next entry of this category (%T = navigation text, %F = entry title):" msgid "Link to next entry of this category (%T = navigation text, %F = entry title):"
msgstr "Lien vers le billet suivant de la catégorie (%T = texte de navigation, %F = titre du billet) :" msgstr "Lien vers le billet suivant de la catégorie (%T = texte de navigation, %F = titre du billet) :"
#: _widgets.php:142 #: _widgets.php:145
msgid "Try to adapt style:"
msgstr "Essayer d'adapter le style :"
#: _widgets.php:146
msgid "No style" msgid "No style"
msgstr "sans style" msgstr "sans style"
#: _widgets.php:147 #: _widgets.php:146
msgid "Small icon" msgid "Small icon"
msgstr "petite icône" msgstr "petite icône"
#: _widgets.php:148 #: _widgets.php:147
msgid "Normal icon" msgid "Normal icon"
msgstr "icône normale" msgstr "icône normale"
#: _widgets.php:153 #: _widgets.php:154
msgid "Try to remove entry information" msgid "Try to remove entry information"
msgstr "Essayer de cacher les informations du billet" msgstr "Essayer de cacher les informations du billet"
#: _widgets.php:159 #: _widgets.php:160
msgid "Try to remove entry tags" msgid "Try to remove entry tags"
msgstr "Essayer de cacher la liste des mots-clés du billet" msgstr "Essayer de cacher la liste des mots-clés du billet"
#: _widgets.php:165 #: _widgets.php:166
msgid "Try to remove entry navigation" msgid "Try to remove entry navigation"
msgstr "Essayer de cacher les liens de navigation" msgstr "Essayer de cacher les liens de navigation"
#: _widgets.php:333 #: _widgets.php:321
msgid "no attachment" msgid "no attachment"
msgstr "aucune annexe" msgstr "aucune annexe"
#: _widgets.php:344 #: _widgets.php:361
msgid "one attachment"
msgstr "une annexe"
#: _widgets.php:356
msgid "%d attachments"
msgstr "%d annexes"
#: _widgets.php:375
msgid "no comment" msgid "no comment"
msgstr "aucun commentaire" msgstr "aucun commentaire"
#: _widgets.php:386 #: _widgets.php:401
msgid "one comment"
msgstr "un commentaire"
#: _widgets.php:398
msgid "%d comments"
msgstr "%d commentaires"
#: _widgets.php:417
msgid "no trackback" msgid "no trackback"
msgstr "aucun rétrolien" msgstr "aucun rétrolien"
#: _widgets.php:428 #: _widgets.php:477
msgid "one trackback"
msgstr "un rétrolien"
#: _widgets.php:440
msgid "%d trackbacks"
msgstr "%d rétroliens"
#: _widgets.php:494
msgid "Previous entry" msgid "Previous entry"
msgstr "Billet précédent" msgstr "Billet précédent"
#: _widgets.php:510 #: _widgets.php:493
msgid "Next entry" msgid "Next entry"
msgstr "Billet suivant" msgstr "Billet suivant"
#: _widgets.php:527 #: _widgets.php:510
msgid "Previous entry of this category" msgid "Previous entry of this category"
msgstr "Billet précédent de cette catégorie" msgstr "Billet précédent de cette catégorie"
#: _widgets.php:544 #: _widgets.php:527
msgid "Next entry of this category" msgid "Next entry of this category"
msgstr "Billet suivant de cette catégorie" msgstr "Billet suivant de cette catégorie"
msgid "Try to adapt style:"
msgstr "Essayer d'adapter le style :"