💄 (admin): rework plugin pages

This commit is contained in:
Kazhnuz 2025-01-18 16:28:15 +01:00
parent 466afdbbf4
commit 2688148d1e
4 changed files with 50 additions and 38 deletions

View file

@ -2,25 +2,29 @@
<?php echo Bootstrap::formOpen(array('id'=>'jsform', 'class'=>'plugin-form')); ?>
<div class="align-middle">
<div class="d-flex justify-content-between mb-2">
<?php echo Bootstrap::pageTitle(array('title'=>$plugin->name(), 'icon'=>'cog')); ?>
<?php if ($plugin->formButtons()): ?>
<div class="float-right mt-1">
<button type="submit" class="btn btn-primary btn-sm" name="save"><?php $L->p('Save') ?></button>
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>" role="button"><?php $L->p('Cancel') ?></a>
<div>
<button type="submit" class="btn btn-primary" name="save"><?php $L->p('Save') ?></button>
<a class="btn btn-secondary" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>" role="button"><?php $L->p('Cancel') ?></a>
</div>
<?php endif; ?>
<?php echo Bootstrap::pageTitle(array('title'=>$plugin->name(), 'icon'=>'cog')); ?>
</div>
<?php
// Token CSRF
echo Bootstrap::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$security->getTokenCSRF()
));
<div class="card">
<div class="card-body">
<?php
// Token CSRF
echo Bootstrap::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$security->getTokenCSRF()
));
// Print the plugin form
echo $plugin->form();
?>
// Print the plugin form
echo $plugin->form();
?>
<?php echo Bootstrap::formClose(); ?>
<?php echo Bootstrap::formClose(); ?>
</div>
</div>

View file

@ -201,7 +201,7 @@ echo Bootstrap::formInputHidden(array(
echo '
<div class="form-group">
<a href="' . HTML_PATH_ADMIN_ROOT . 'user-password/' . $user->username() . '" class="btn btn-primary mr-2">' . $L->g('Change password') . '</a>
<a href="' . HTML_PATH_ADMIN_ROOT . 'user-password/' . $user->username() . '" class="btn btn-primary me-2">' . $L->g('Change password') . '</a>
</div>
';

View file

@ -2,12 +2,12 @@
<?php echo Bootstrap::formOpen(array('id'=>'jsform', 'class'=>'tab-content')); ?>
<div class="align-middle">
<div class="float-right mt-1">
<button type="button" class="btn btn-primary btn-sm jsbuttonSave" name="save"><?php $L->p('Save') ?></button>
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>" role="button"><?php $L->p('Cancel') ?></a>
<div class="d-flex justify-content-between mb-2">
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Plugins position'), 'icon'=>'tags')); ?>
<div>
<button type="button" class="btn btn-primary jsbuttonSave" name="save"><?php $L->p('Save') ?></button>
<a class="btn btn-secondary" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>" role="button"><?php $L->p('Cancel') ?></a>
</div>
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Plugins position'), 'icon'=>'tags')); ?>
</div>
<div class="alert alert-primary"><?php $L->p('Drag and Drop to sort the plugins') ?></div>

View file

@ -1,18 +1,25 @@
<?php
echo "<div class='d-flex justify-content-between align-content-center'>";
echo Bootstrap::pageTitle(array('title' => $L->g('Plugins'), 'icon' => 'puzzle-piece'));
echo "<div>";
echo Bootstrap::link(array(
'title' => $L->g('Change the position of the plugins'),
'href' => HTML_PATH_ADMIN_ROOT . 'plugins-position',
'icon' => 'arrows'
'icon' => 'arrows',
'class' => 'btn btn-outline-secondary'
));
echo "</div></div>";
echo Bootstrap::formTitle(array('title' => $L->g('Search plugins')));
?>
<input type="text" dir="auto" class="form-control" id="search" placeholder="<?php $L->p('Search') ?>">
<input type="text" dir="auto" class="form-control mb-3" id="search" placeholder="<?php $L->p('Search') ?>">
<script>
$(document).ready(function() {
$("#search").on("keyup", function() {
@ -33,11 +40,10 @@ echo Bootstrap::formTitle(array('title' => $L->g('Search plugins')));
<?php
echo Bootstrap::formTitle(array('title' => $L->g('Enabled plugins')));
echo '
<table class="table">
<tbody>
echo '<div class="card mb-3"><h6 class="card-header">';
echo $L->g('Enabled plugins');
echo ' </h6><table class="table m-0">
<tbody>
';
// Show installed plugins
@ -48,13 +54,13 @@ foreach ($pluginsInstalled as $plugin) {
continue;
}
echo '<tr id="' . $plugin->className() . '" class="bg-light searchItem">';
echo '<tr id="' . $plugin->className() . '" class="searchItem card-tablebody">';
echo '<td class="align-middle pt-3 pb-3 w-25">
<div class="searchText">' . $plugin->name() . '</div>
<div class="mt-1">';
if (method_exists($plugin, 'form')) {
echo '<a class="mr-3" href="' . HTML_PATH_ADMIN_ROOT . 'configure-plugin/' . $plugin->className() . '">' . $L->g('Settings') . '</a>';
echo '<a class="me-3" href="' . HTML_PATH_ADMIN_ROOT . 'configure-plugin/' . $plugin->className() . '">' . $L->g('Settings') . '</a>';
}
echo '<a href="' . HTML_PATH_ADMIN_ROOT . 'uninstall-plugin/' . $plugin->className() . '">' . $L->g('Deactivate') . '</a>';
echo '</div>';
@ -76,15 +82,16 @@ foreach ($pluginsInstalled as $plugin) {
}
echo '
</tbody>
</table>
</tbody>
</table>
</div>
';
echo Bootstrap::formTitle(array('title' => $L->g('Disabled plugins')));
echo '
<table class="table">
<tbody>
echo '<div class="card mb-3"><h6 class="card-header">';
echo $L->g('Disabled plugins');
echo ' </h6><table class="table m-0">
<tbody>
';
// Plugins not installed
@ -120,6 +127,7 @@ foreach ($pluginsNotInstalled as $plugin) {
}
echo '
</tbody>
</table>
</tbody>
</table>
</div>
';