From ab0217fb89bc987bbfec407071a6ebb5a9b31a3b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 26 Aug 2021 02:08:41 +0200 Subject: [PATCH] cleanup index file --- index.php | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/index.php b/index.php index cf2e720..57c30fa 100644 --- a/index.php +++ b/index.php @@ -10,7 +10,9 @@ # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html # -- END LICENSE BLOCK ------------------------------------ -if (!defined('DC_CONTEXT_ADMIN')){return;} +if (!defined('DC_CONTEXT_ADMIN')) { + return; +} # Check user perms dcPage::check('admin'); @@ -26,45 +28,39 @@ $img_green = 'ok'; $img_red = 'fail'; $header = -dcPage::jsLoad('index.php?pf=kUtRL/js/main.js'). -'\n". +dcPage::jsLoad('index.php?pf=kUtRL/js/main.js') . +'\n" . ''; $footer = '

-'.__('Settings').' - -'.__('Services').' - -kUtRL - '.$core->plugins->moduleInfo('kUtRL','version').'  -'.__('kUtRL').' -

-

- kUtRL, '.__('Links shortener').' | http://kutrl.fr -

-'; +' . __('Settings') . ' - +' . __('Services') . ' - +kUtRL - ' . $core->plugins->moduleInfo('kUtRL','version') . '  +' . __('kUtRL') . ' +

'; # Messages $msg = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : ''; -$msg_list = array( +$msg_list = [ 'savesetting' => __('Configuration successfully saved'), 'saveservice' => __('Services successfully updated'), 'createlink' => __('Link successfully shorten'), 'deletelinks' => __('Links successfully deleted') -); +]; if (isset($msg_list[$msg])) { - $msg = sprintf('

%s

',$msg_list[$msg]); + $msg = sprintf('

%s

', $msg_list[$msg]); } # Pages $start_part = $s->kutrl_active ? 'links' : 'setting'; $default_part = isset($_REQUEST['part']) ? $_REQUEST['part'] : $start_part; -if (!file_exists(dirname(__FILE__).'/inc/index.'.$default_part.'.php')) { +if (!file_exists(dirname(__FILE__) . '/inc/index.' . $default_part . '.php')) { $default_part = 'setting'; } -include dirname(__FILE__).'/inc/index.'.$default_part.'.php'; - -?> \ No newline at end of file +include dirname(__FILE__) . '/inc/index.' . $default_part . '.php'; \ No newline at end of file