cleanup index file

master
Jean-Christian Paul Denis 2021-08-26 02:08:41 +02:00
parent 0afc3db3d5
commit ab0217fb89
1 changed files with 17 additions and 21 deletions

View File

@ -10,7 +10,9 @@
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ # -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')){return;} if (!defined('DC_CONTEXT_ADMIN')) {
return;
}
# Check user perms # Check user perms
dcPage::check('admin'); dcPage::check('admin');
@ -26,45 +28,39 @@ $img_green = '<img src="images/check-on.png" alt="ok" />';
$img_red = '<img src="images/check-off.png" alt="fail" />'; $img_red = '<img src="images/check-off.png" alt="fail" />';
$header = $header =
dcPage::jsLoad('index.php?pf=kUtRL/js/main.js'). dcPage::jsLoad('index.php?pf=kUtRL/js/main.js') .
'<script type="text/javascript">'."\n//<![CDATA[\n". '<script type="text/javascript">' . "\n//<![CDATA[\n" .
"jcToolsBox.prototype.text_wait = '".html::escapeJS(__('Please wait'))."';\n". "jcToolsBox.prototype.text_wait = '" . html::escapeJS(__('Please wait')) . "';\n" .
"\n//]]>\n</script>\n". "\n//]]>\n</script>\n" .
'<style type="text/css"> '<style type="text/css">
.titleKutrl { margin: -20px; text-align:center; } .titleKutrl { margin: -20px; text-align:center; }
.titleKutrl a { border:none; text-decoration: none; } .titleKutrl a { border:none; text-decoration: none; }
</style>'; </style>';
$footer = '<hr class="clear"/><p class="right"> $footer = '<hr class="clear"/><p class="right">
<a class="button" href="'.$p_url.'&amp;part=setting" title="'.__('Configure extension').'">'.__('Settings').'</a> - <a class="button" href="' . $p_url . '&amp;part=setting" title="' . __('Configure extension') . '">' . __('Settings') . '</a> -
<a class="button" href="'.$p_url.'&amp;part=service" title="'.__('Configure services').'">'.__('Services').'</a> - <a class="button" href="' . $p_url . '&amp;part=service" title="' . __('Configure services') . '">' . __('Services') . '</a> -
kUtRL - '.$core->plugins->moduleInfo('kUtRL','version').'&nbsp; kUtRL - ' . $core->plugins->moduleInfo('kUtRL','version') . '&nbsp;
<img alt="'.__('kUtRL').'" src="index.php?pf=kUtRL/icon.png" /> <img alt="' . __('kUtRL') . '" src="index.php?pf=kUtRL/icon.png" />
</p> </p>';
<h2 class="titleKutrl"><a title="kUtRL, '.__('Links shortener').' | http://kutrl.fr" href="http://kutrl.fr">
<img alt="kUtRL, '.__('Links shortener').' | http://kutrl.fr" src="index.php?pf=kUtRL/inc/img/kutrl_logo.png" />
</a></h2>
';
# Messages # Messages
$msg = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : ''; $msg = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : '';
$msg_list = array( $msg_list = [
'savesetting' => __('Configuration successfully saved'), 'savesetting' => __('Configuration successfully saved'),
'saveservice' => __('Services successfully updated'), 'saveservice' => __('Services successfully updated'),
'createlink' => __('Link successfully shorten'), 'createlink' => __('Link successfully shorten'),
'deletelinks' => __('Links successfully deleted') 'deletelinks' => __('Links successfully deleted')
); ];
if (isset($msg_list[$msg])) { if (isset($msg_list[$msg])) {
$msg = sprintf('<p class="message">%s</p>',$msg_list[$msg]); $msg = sprintf('<p class="message">%s</p>', $msg_list[$msg]);
} }
# Pages # Pages
$start_part = $s->kutrl_active ? 'links' : 'setting'; $start_part = $s->kutrl_active ? 'links' : 'setting';
$default_part = isset($_REQUEST['part']) ? $_REQUEST['part'] : $start_part; $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'; $default_part = 'setting';
} }
include dirname(__FILE__).'/inc/index.'.$default_part.'.php'; include dirname(__FILE__) . '/inc/index.' . $default_part . '.php';
?>