mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
some code cleanup and no output if there are no dumps
This commit is contained in:
parent
911c7895d9
commit
450ca9953e
|
@ -80,9 +80,6 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
// list backup files
|
// list backup files
|
||||||
$this->contentSubHeading(getMLText("backup_list"));
|
|
||||||
|
|
||||||
$print_header=true;
|
|
||||||
|
|
||||||
$handle = opendir($contentdir);
|
$handle = opendir($contentdir);
|
||||||
$entries = array();
|
$entries = array();
|
||||||
|
@ -96,38 +93,36 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
sort($entries);
|
sort($entries);
|
||||||
$entries = array_reverse($entries);
|
$entries = array_reverse($entries);
|
||||||
|
|
||||||
foreach ($entries as $entry){
|
if($entries) {
|
||||||
|
$this->contentSubHeading(getMLText("backup_list"));
|
||||||
|
print "<table class=\"table-condensed\">\n";
|
||||||
|
print "<thead>\n<tr>\n";
|
||||||
|
print "<th></th>\n";
|
||||||
|
print "<th>".getMLText("folder")."</th>\n";
|
||||||
|
print "<th>".getMLText("creation_date")."</th>\n";
|
||||||
|
print "<th>".getMLText("file_size")."</th>\n";
|
||||||
|
print "<th></th>\n";
|
||||||
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
|
|
||||||
if ($print_header){
|
foreach ($entries as $entry){
|
||||||
print "<table class=\"table-condensed\">\n";
|
|
||||||
print "<thead>\n<tr>\n";
|
$folderid=substr($entry,strpos($entry,"_")+1);
|
||||||
print "<th></th>\n";
|
$folder=$dms->getFolder((int)$folderid);
|
||||||
print "<th>".getMLText("folder")."</th>\n";
|
|
||||||
print "<th>".getMLText("creation_date")."</th>\n";
|
print "<tr>\n";
|
||||||
print "<th>".getMLText("file_size")."</th>\n";
|
print "<td><a href=\"../op/op.Download.php?arkname=".$entry."\">".$entry."</a></td>\n";
|
||||||
print "<th></th>\n";
|
if (is_object($folder)) print "<td>".htmlspecialchars($folder->getName())."</td>\n";
|
||||||
print "</tr>\n</thead>\n<tbody>\n";
|
else print "<td>".getMLText("unknown_id")."</td>\n";
|
||||||
$print_header=false;
|
print "<td>".getLongReadableDate(filectime($contentdir.$entry))."</td>\n";
|
||||||
|
print "<td>".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))."</td>\n";
|
||||||
|
print "<td>";
|
||||||
|
print "<a href=\"out.RemoveArchive.php?arkname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("backup_remove")."</a>";
|
||||||
|
print "</td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
print "</table>\n";
|
||||||
$folderid=substr($entry,strpos($entry,"_")+1);
|
|
||||||
$folder=$dms->getFolder((int)$folderid);
|
|
||||||
|
|
||||||
print "<tr>\n";
|
|
||||||
print "<td><a href=\"../op/op.Download.php?arkname=".$entry."\">".$entry."</a></td>\n";
|
|
||||||
if (is_object($folder)) print "<td>".htmlspecialchars($folder->getName())."</td>\n";
|
|
||||||
else print "<td>".getMLText("unknown_id")."</td>\n";
|
|
||||||
print "<td>".getLongReadableDate(filectime($contentdir.$entry))."</td>\n";
|
|
||||||
print "<td>".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))."</td>\n";
|
|
||||||
print "<td>";
|
|
||||||
print "<a href=\"out.RemoveArchive.php?arkname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("backup_remove")."</a>";
|
|
||||||
print "</td>\n";
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($print_header) printMLText("empty_notify_list");
|
|
||||||
else print "</table>\n";
|
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
|
|
||||||
// dump creation ///////////////////////////////////////////////////////////////
|
// dump creation ///////////////////////////////////////////////////////////////
|
||||||
|
@ -141,10 +136,6 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
// list backup files
|
// list backup files
|
||||||
$this->contentSubHeading(getMLText("dump_list"));
|
|
||||||
|
|
||||||
$print_header=true;
|
|
||||||
|
|
||||||
$handle = opendir($contentdir);
|
$handle = opendir($contentdir);
|
||||||
$entries = array();
|
$entries = array();
|
||||||
while ($e = readdir($handle)){
|
while ($e = readdir($handle)){
|
||||||
|
@ -157,32 +148,29 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
sort($entries);
|
sort($entries);
|
||||||
$entries = array_reverse($entries);
|
$entries = array_reverse($entries);
|
||||||
|
|
||||||
foreach ($entries as $entry){
|
if($entries) {
|
||||||
|
$this->contentSubHeading(getMLText("dump_list"));
|
||||||
|
print "<table class=\"table-condensed\">\n";
|
||||||
|
print "<thead>\n<tr>\n";
|
||||||
|
print "<th></th>\n";
|
||||||
|
print "<th>".getMLText("creation_date")."</th>\n";
|
||||||
|
print "<th>".getMLText("file_size")."</th>\n";
|
||||||
|
print "<th></th>\n";
|
||||||
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
|
|
||||||
if ($print_header){
|
foreach ($entries as $entry){
|
||||||
print "<table class=\"table-condensed\">\n";
|
print "<tr>\n";
|
||||||
print "<thead>\n<tr>\n";
|
print "<td><a href=\"../op/op.Download.php?dumpname=".$entry."\">".$entry."</a></td>\n";
|
||||||
print "<th></th>\n";
|
print "<td>".getLongReadableDate(filectime($contentdir.$entry))."</td>\n";
|
||||||
print "<th>".getMLText("creation_date")."</th>\n";
|
print "<td>".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))."</td>\n";
|
||||||
print "<th>".getMLText("file_size")."</th>\n";
|
print "<td>";
|
||||||
print "<th></th>\n";
|
print "<a href=\"out.RemoveDump.php?dumpname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("dump_remove")."</a>";
|
||||||
print "</tr>\n</thead>\n<tbody>\n";
|
print "</td>\n";
|
||||||
$print_header=false;
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
print "</table>\n";
|
||||||
print "<tr>\n";
|
|
||||||
print "<td><a href=\"../op/op.Download.php?dumpname=".$entry."\">".$entry."</a></td>\n";
|
|
||||||
print "<td>".getLongReadableDate(filectime($contentdir.$entry))."</td>\n";
|
|
||||||
print "<td>".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))."</td>\n";
|
|
||||||
print "<td>";
|
|
||||||
print "<a href=\"out.RemoveDump.php?dumpname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("dump_remove")."</a>";
|
|
||||||
print "</td>\n";
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($print_header) printMLText("empty_notify_list");
|
|
||||||
else print "</table>\n";
|
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
|
|
||||||
// files deletion //////////////////////////////////////////////////////////////
|
// files deletion //////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue
Block a user