From de2becbe4e80619b66d5c6407f811d23fe2c262e Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 27 Mar 2023 23:47:12 +0200 Subject: [PATCH] use Dotclear Helper --- src/Manage.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Manage.php b/src/Manage.php index 75615c5..73a17b2 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -18,10 +18,10 @@ use dcAuth; use dcCore; use dcNsProcess; use dcPage; +use Dotclear\Helper\Html\Form\Input; +use Dotclear\Helper\Html\Html; +use Dotclear\Helper\Text; use Exception; -use form; -use html; -use text; /** * Manage contributions list @@ -31,7 +31,7 @@ class Manage extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && dcCore:app()->auth->check( + && dcCore::app()->auth->check( dcCore::app()->auth->makePermissions([ dcAuth::PERMISSION_CONTENT_ADMIN, ]), dcCore::app()->blog->id @@ -51,19 +51,19 @@ class Manage extends dcNsProcess if (!empty($_POST['handlers']) && is_array($_POST['handlers'])) { foreach ($_POST['handlers'] as $name => $url) { - $url = text::tidyURL($url); + $url = Text::tidyURL($url); if (empty($handlers[$name])) { throw new Exception(sprintf( __('Uknown handler "%s".'), - html::escapeHTML($name) + Html::escapeHTML($name) )); } if (empty($url)) { throw new Exception(sprintf( __('Invalid URL for handler "%s".'), - html::escapeHTML($name) + Html::escapeHTML($name) )); } @@ -127,7 +127,7 @@ class Manage extends dcNsProcess echo dcPage::breadcrumb( [ - html::escapeHTML(dcCore::app()->blog->name) => '', + Html::escapeHTML(dcCore::app()->blog->name) => '', My::name() => '', ] ) . @@ -153,9 +153,9 @@ class Manage extends dcNsProcess foreach ($handlers as $name => $url) { echo '' . - '' . html::escapeHTML($name) . '' . + '' . Html::escapeHTML($name) . '' . '' . - form::field(['handlers[' . $name . ']'], 20, 255, html::escapeHTML($url)) . + (new Input(['handlers[' . $name . ']']))->size(20)->maxlenght(255)->value(Html::escapeHTML($url))->render() . '' . ''; }