From f4e8e597a5136b9c8c97e54f8079c6a8983cce32 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 20 Dec 2022 22:27:28 +0100 Subject: [PATCH] use abstract plugin name --- _define.php | 8 ++++---- index.php | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/_define.php b/_define.php index 07210e5..e840311 100644 --- a/_define.php +++ b/_define.php @@ -18,13 +18,13 @@ $this->registerModule( 'dcLog', 'Displays Dotclear logs', 'Tomtom (http://blog.zenstyle.fr) and Contributors', - '1.1', + '1.1.1', [ 'requires' => [['core', '2.24']], 'permissions' => null, 'type' => 'plugin', - 'support' => 'https://github.com/JcDenis/dcLog', - 'details' => 'https://plugins.dotaddict.org/dc2/details/dcLog', - 'repository' => 'https://raw.githubusercontent.com/JcDenis/dcLog/master/dcstore.xml', + 'support' => 'https://github.com/JcDenis/' . basename(__DIR__), + 'details' => 'https://plugins.dotaddict.org/dc2/details/' . basename(__DIR__), + 'repository' => 'https://raw.githubusercontent.com/JcDenis/' . basename(__DIR__) . '/master/dcstore.xml', ] ); diff --git a/index.php b/index.php index 46f5976..9641c7c 100644 --- a/index.php +++ b/index.php @@ -30,7 +30,7 @@ if (isset($_POST['del_logs']) || isset($_POST['del_all_logs'])) { __('All logs have been successfully deleted') : __('Selected logs have been successfully deleted') ); - dcCore::app()->adminurl->redirect('admin.plugin.dcLog'); + dcCore::app()->adminurl->redirect('admin.plugin.' . basename(__DIR__)); } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } @@ -58,12 +58,12 @@ dcPage::jsJson('dclog_list', [ 'confirm_delete_selected_log' => __('Are you sure you want to delete selected logs?'), 'confirm_delete_all_log' => __('Are you sure you want to delete all logs?'), ]) . -$filter->js(dcCore::app()->adminurl->get('admin.plugin.dcLog')) . -dcPage::jsLoad(dcPage::getPF('dcLog/js/dclog.js')) . +$filter->js(dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__))) . +dcPage::jsLoad(dcPage::getPF(basename(__DIR__) . '/js/dclog.js')) . '' . dcPage::breadcrumb([ __('System') => '', - __('Log') => dcCore::app()->adminurl->get('admin.plugin.dcLog'), + __('Log') => dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), ]) . dcPage::notices(); @@ -72,13 +72,13 @@ if (isset($logs) && isset($logs_list)) { echo '

' . __('There are no logs') . '

'; } else { $filter->display( - 'admin.plugin.dcLog', - form::hidden('p', 'dcLog') + 'admin.plugin.' . basename(__DIR__), + form::hidden('p', basename(__DIR__)) ); $logs_list->display( $filter->__get('page'), $filter->__get('nb'), - '
' . + '' . '%s' . @@ -90,7 +90,7 @@ if (isset($logs) && isset($logs_list)) { '' . '

' . - dcCore::app()->adminurl->getHiddenFormFields('admin.plugin.dcLog', $filter->values()) . + dcCore::app()->adminurl->getHiddenFormFields('admin.plugin.' . basename(__DIR__), $filter->values()) . dcCore::app()->formNonce() . '' . '
',