use Dotclear Helper

This commit is contained in:
Jean-Christian Paul Denis 2023-04-08 14:21:15 +02:00
parent 39f9f4bc0c
commit e0256214fd
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -16,9 +16,9 @@ namespace Dotclear\Plugin\myBlogNumbers;
use dcCore; use dcCore;
use dcMeta; use dcMeta;
use Dotclear\Helper\Html\Html;
use Dotclear\Plugin\widgets\WidgetsStack; use Dotclear\Plugin\widgets\WidgetsStack;
use Dotclear\Plugin\widgets\WidgetsElement; use Dotclear\Plugin\widgets\WidgetsElement;
use html;
class Widgets class Widgets
{ {
@ -150,7 +150,7 @@ class Widgets
# Entry # Entry
if ($w->entry_show) { if ($w->entry_show) {
$title = $w->entry_title ? $title = $w->entry_title ?
sprintf($s_title, html::escapeHTML($w->entry_title)) : ''; sprintf($s_title, Html::escapeHTML($w->entry_title)) : '';
$count = (int) dcCore::app()->blog->getPosts([], true)->f(0); $count = (int) dcCore::app()->blog->getPosts([], true)->f(0);
@ -164,7 +164,7 @@ class Widgets
# Cat # Cat
if ($w->cat_show) { if ($w->cat_show) {
$title = $w->cat_title ? $title = $w->cat_title ?
sprintf($s_title, html::escapeHTML($w->cat_title)) : ''; sprintf($s_title, Html::escapeHTML($w->cat_title)) : '';
$count = dcCore::app()->blog->getCategories([])->count(); $count = dcCore::app()->blog->getCategories([])->count();
@ -178,7 +178,7 @@ class Widgets
# Comment # Comment
if ($w->comment_show) { if ($w->comment_show) {
$title = $w->comment_title ? $title = $w->comment_title ?
sprintf($s_title, html::escapeHTML($w->comment_title)) : ''; sprintf($s_title, Html::escapeHTML($w->comment_title)) : '';
$params = [ $params = [
'post_type' => 'post', 'post_type' => 'post',
@ -197,7 +197,7 @@ class Widgets
# Trackback # Trackback
if ($w->trackback_show) { if ($w->trackback_show) {
$title = $w->trackback_title ? $title = $w->trackback_title ?
sprintf($s_title, html::escapeHTML($w->trackback_title)) : ''; sprintf($s_title, Html::escapeHTML($w->trackback_title)) : '';
$params = [ $params = [
'post_type' => 'post', 'post_type' => 'post',
@ -216,7 +216,7 @@ class Widgets
# Tag # Tag
if (dcCore::app()->plugins->moduleExists('tags') && $w->tag_show) { if (dcCore::app()->plugins->moduleExists('tags') && $w->tag_show) {
$title = $w->tag_title ? $title = $w->tag_title ?
sprintf($s_title, html::escapeHTML($w->tag_title)) : ''; sprintf($s_title, Html::escapeHTML($w->tag_title)) : '';
$count = (int) dcCore::app()->con->select( $count = (int) dcCore::app()->con->select(
'SELECT count(M.meta_id) AS count ' . 'SELECT count(M.meta_id) AS count ' .
@ -236,7 +236,7 @@ class Widgets
# User (that post) # User (that post)
if ($w->user_show) { if ($w->user_show) {
$title = $w->user_title ? $title = $w->user_title ?
sprintf($s_title, html::escapeHTML($w->user_title)) : ''; sprintf($s_title, Html::escapeHTML($w->user_title)) : '';
$count = dcCore::app()->blog->getPostsUsers('post')->count(); $count = dcCore::app()->blog->getPostsUsers('post')->count();
@ -260,7 +260,7 @@ class Widgets
(bool) $w->content_only, (bool) $w->content_only,
'myblognumbers ' . $w->class, 'myblognumbers ' . $w->class,
'', '',
($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '') . ($w->title ? $w->renderTitle(Html::escapeHTML($w->title)) : '') .
sprintf('<ul>%s</ul>', $content . $addons) sprintf('<ul>%s</ul>', $content . $addons)
); );
} }