diff --git a/CHANGELOG.md b/CHANGELOG.md index 37a884f..90fc32b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +dcLog 1.7.1 - 2023.10.11 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Code review + dcLog 1.7 - 2023.10.07 =========================================================== * Require Dotclear 2.28 diff --git a/README.md b/README.md index 77cf56e..3c653da 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,6 @@ Once it's done you can manage your logs from menu ## CONTRIBUTORS * Tomtom (author) -* Jean-Christian Denis +* Jean-Christian Denis (latest) You are welcome to contribute to this code. diff --git a/_define.php b/_define.php index 94b33b0..ea65cbd 100644 --- a/_define.php +++ b/_define.php @@ -1,29 +1,26 @@ registerModule( "Dotclear's logs", 'Displays Dotclear logs', 'Tomtom and Contributors', - '1.7', + '1.7.1', [ - 'requires' => [ - ['php', '8.1'], - ['core', '2.28'], - ], + 'requires' => [['core', '2.28']], 'permissions' => null, 'type' => 'plugin', 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', diff --git a/dcstore.xml b/dcstore.xml index a70d579..ca758ec 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Dotclear's logs - 1.7 + 1.7.1 Tomtom and Contributors Displays Dotclear logs - https://git.dotclear.watch/JcDenis/dcLog/releases/download/v1.7/plugin-dcLog.zip + https://git.dotclear.watch/JcDenis/dcLog/releases/download/v1.7.1/plugin-dcLog.zip 2.28 https://git.dotclear.watch/JcDenis/dcLog/src/branch/master/README.md https://git.dotclear.watch/JcDenis/dcLog/issues diff --git a/src/Backend.php b/src/Backend.php index 1b82dfe..92dc585 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -1,15 +1,5 @@ menus::MENU_SYSTEM); App::behavior()->addBehaviors([ // backend user preference for logs list columns diff --git a/src/BackendList.php b/src/BackendList.php index 06e013a..72afa7d 100644 --- a/src/BackendList.php +++ b/src/BackendList.php @@ -1,15 +1,5 @@ rs_count, $nb_per_page, 10); + $pager = new Pager($page, (int) $this->rs_count, $nb_per_page, 10); $cols = new ArrayObject([ 'date' => (new Text('th', __('Date'))) @@ -74,7 +69,7 @@ class BackendList extends Listing $lines = []; while ($this->rs->fetch()) { - $lines[] = $this->line(isset($_POST['entries']) && in_array($this->rs->log_id, $_POST['entries'])); + $lines[] = $this->line(isset($_POST['entries']) && in_array($this->rs->f('log_id'), $_POST['entries'])); } echo @@ -115,25 +110,25 @@ class BackendList extends Listing ->class('nowrap minimal') ->items([ (new Checkbox(['entries[]'], $checked)) - ->value($this->rs->log_id), + ->value($this->rs->f('log_id')), ]), - 'date' => (new Text('td', Html::escapeHTML(Date::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->log_dt)))) + 'date' => (new Text('td', Html::escapeHTML(Date::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->f('log_dt'))))) ->class('nowrap minimal'), - 'msg' => (new Text('td', nl2br(Html::escapeHTML($this->rs->log_msg)))) + 'msg' => (new Text('td', nl2br(Html::escapeHTML($this->rs->f('log_msg'))))) ->class('maximal'), - 'blog' => (new Text('td', Html::escapeHTML($this->rs->blog_id))) + 'blog' => (new Text('td', Html::escapeHTML($this->rs->f('blog_id')))) ->class('nowrap minimal'), - 'table' => (new Text('td', Html::escapeHTML($this->rs->log_table))) + 'table' => (new Text('td', Html::escapeHTML($this->rs->f('log_table')))) ->class('nowrap minimal'), 'user' => (new Text('td', Html::escapeHTML($this->rs->getUserCN()))) ->class('nowrap minimal'), - 'ip' => (new Text('td', Html::escapeHTML($this->rs->log_ip))) + 'ip' => (new Text('td', Html::escapeHTML($this->rs->f('log_ip')))) ->class('nowrap minimal'), ]); $this->userColumns(My::BACKEND_LIST_ID, $cols); return - (new Para('p' . $this->rs->log_id, 'tr')) + (new Para('p' . $this->rs->f('log_id'), 'tr')) ->class('line') ->items(iterator_to_array($cols)); } diff --git a/src/Manage.php b/src/Manage.php index 88a9bdd..355d2cf 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -31,7 +31,12 @@ use Dotclear\Helper\Html\Form\{ use Exception; /** - * Manage logs list + * @brief dcLog manage class. + * @ingroup dcLog + * + * @author Tomtom (author) + * @author Jean-Christian Denis (latest) + * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ class Manage extends Process { diff --git a/src/ManageVars.php b/src/ManageVars.php index dbac9a2..08ab411 100644 --- a/src/ManageVars.php +++ b/src/ManageVars.php @@ -1,15 +1,5 @@ $entries The post form selected entries */ + /** + * The post form selected entries. + * + * @var array $entries + */ public readonly array $entries; - /** @var bool $selected_logs The post form action */ + /** + * The post form action. + * + * @var bool $selected_logs + */ public readonly bool $selected_logs; - /** @var bool $all_logs The post form action */ + /** + * The post form action. + * + * @var bool $all_logs + */ public readonly bool $all_logs; /** diff --git a/src/My.php b/src/My.php index 7719a3a..39e92c0 100644 --- a/src/My.php +++ b/src/My.php @@ -1,15 +1,5 @@ isSuperAdmin(); } }