use table sorter

This commit is contained in:
Uwe Steinmann 2025-11-25 15:35:50 +01:00
parent a05196b876
commit 75a2f0c9b5
3 changed files with 29 additions and 12 deletions

View File

@ -11,6 +11,8 @@
- use table for list of caches
- propper error msgs when saving extension configuration
- creating backup archives has been removed
- add javascript table sorter
- use table sorter on clear cache page and conversion services page
--------------------------------------------------------------------------------
Changes in version 5.1.42

View File

@ -13,11 +13,6 @@
* @version Release: @package_version@
*/
/**
* Include parent class
*/
//require_once("class.Bootstrap.php");
/**
* Class which outputs the html page for ClearCache view
*
@ -31,11 +26,18 @@
*/
class SeedDMS_View_ClearCache extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
?>
new Tablesort(document.getElementById('clearcachetable'));
<?php
} /* }}} */
protected function output($name, $title, $space, $c) {
echo '<tr><td><input type="checkbox" name="'.$name.'" value="1" checked></td>';
echo '<td>'.$title.'</td>';
echo '<td>'.($space !== NULL ? SeedDMS_Core_File::format_filesize($space) : '').'</td>';
echo '<td>'.($c !== NULL ? $c : '').'</td>';
echo '<td data-sort="'.((int) $space).'">'.($space !== NULL ? SeedDMS_Core_File::format_filesize($space) : '').'</td>';
echo '<td data-sort="'.((int) $c).'">'.($c !== NULL ? $c : '').'</td>';
echo '</tr>';
}
@ -44,6 +46,9 @@ class SeedDMS_View_ClearCache extends SeedDMS_Theme_Style {
$user = $this->params['user'];
$cachedir = $this->params['cachedir'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/tablesort/tablesort.min.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/tablesort/sorts/tablesort.number.min.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
@ -53,9 +58,9 @@ class SeedDMS_View_ClearCache extends SeedDMS_Theme_Style {
?>
<form action="../op/op.ClearCache.php" name="form1" method="post">
<?php echo createHiddenFieldWithKey('clearcache'); ?>
<table class="table table-sm table-condensed table-hover">
<table id="clearcachetable" class="table table-sm table-condensed table-hover">
<thead>
<tr><th></th><th>Cache</th><th>Size</th><th>Files</th></tr>
<tr><th data-sort-method="none"></th><th data-sort-method="none">Cache</th><th>Size</th><th>Files</th></tr>
</thead>
<tbody>
<?php

View File

@ -22,14 +22,21 @@
*/
class SeedDMS_View_ConversionServices extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
?>
new Tablesort(document.getElementById('servicetable'));
<?php
} /* }}} */
/**
* List all registered conversion services
*
*/
function list_conversion_services($allservices) { /* {{{ */
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<table id=\"servicetable\" class=\"table table-condensed table-sm\">\n";
echo "<thead>";
echo "<tr><th>".getMLText('service_list_from')."</th><th>".getMLText('service_list_to')."</th><th>".getMLText('class_name')."</th><th>".getMLText('service_list_info')."</th></tr>\n";
echo "<tr><th>".getMLText('service_list_from')."</th><th>".getMLText('service_list_to')."</th><th>".getMLText('class_name')."</th><th data-sort-method=\"none\">".getMLText('service_list_info')."</th></tr>\n";
echo "</thead>";
echo "<tbody>";
foreach($allservices as $from=>$tos) {
@ -48,6 +55,9 @@ class SeedDMS_View_ConversionServices extends SeedDMS_Theme_Style {
$user = $this->params['user'];
$conversionmgr = $this->params['conversionmgr'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/tablesort/tablesort.min.js"></script>'."\n", 'js');
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/tablesort/sorts/tablesort.number.min.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
@ -57,7 +67,7 @@ class SeedDMS_View_ConversionServices extends SeedDMS_Theme_Style {
$allservices = $conversionmgr->getServices();
if($data = $dms->getStatisticalData('docspermimetype')) {
$this->contentHeading(getMLText("list_conversion_overview"));
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<table id=\"mimetypetable\" class=\"table table-condensed table-sm\">\n";
echo "<thead>";
echo "<tr><th>".getMLText('mimetype')."</th><th>".getMLText('preview')."</th><th>".getMLText('fullsearch')."</th><th>".getMLText('preview_pdf')."</th></tr>\n";
echo "</thead>";