mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +00:00
pass backup dir to view
This commit is contained in:
parent
30ccf4f8f6
commit
d653c516ea
|
@ -30,8 +30,12 @@ if (!$user->isAdmin()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'contentdir'=>$settings->_contentDir));
|
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||||
if($view) {
|
if($view) {
|
||||||
|
if($settings->_backupDir && file_exists($settings->_backupDir))
|
||||||
|
$view->setParam('backupdir', $settings->_backupDir);
|
||||||
|
else
|
||||||
|
$view->setParam('backupdir', $settings->_contentDir);
|
||||||
$view->show();
|
$view->show();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
function show() { /* {{{ */
|
function show() { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
$contentdir = $this->params['contentdir'];
|
$backupdir = $this->params['backupdir'];
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("backup_tools"));
|
$this->htmlStartPage(getMLText("backup_tools"));
|
||||||
$this->globalNavigation();
|
$this->globalNavigation();
|
||||||
|
@ -43,7 +43,7 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
$this->contentHeading(getMLText("backup_tools"));
|
$this->contentHeading(getMLText("backup_tools"));
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
print getMLText("space_used_on_data_folder")." : ".SeedDMS_Core_File::format_filesize(dskspace($contentdir));
|
print getMLText("space_used_on_data_folder")." : ".SeedDMS_Core_File::format_filesize(dskspace($backupdir));
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
|
|
||||||
// versioning file creation ////////////////////////////////////////////////////
|
// versioning file creation ////////////////////////////////////////////////////
|
||||||
|
@ -76,10 +76,10 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
$print_header=true;
|
$print_header=true;
|
||||||
|
|
||||||
$handle = opendir($contentdir);
|
$handle = opendir($backupdir);
|
||||||
$entries = array();
|
$entries = array();
|
||||||
while ($e = readdir($handle)){
|
while ($e = readdir($handle)){
|
||||||
if (is_dir($contentdir.$e)) continue;
|
if (is_dir($backupdir.$e)) continue;
|
||||||
if (strpos($e,".tar.gz")==FALSE) continue;
|
if (strpos($e,".tar.gz")==FALSE) continue;
|
||||||
$entries[] = $e;
|
$entries[] = $e;
|
||||||
}
|
}
|
||||||
|
@ -109,8 +109,8 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
print "<td><a href=\"../op/op.Download.php?arkname=".$entry."\">".$entry."</a></td>\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";
|
if (is_object($folder)) print "<td>".htmlspecialchars($folder->getName())."</td>\n";
|
||||||
else print "<td>".getMLText("unknown_id")."</td>\n";
|
else print "<td>".getMLText("unknown_id")."</td>\n";
|
||||||
print "<td>".getLongReadableDate(filectime($contentdir.$entry))."</td>\n";
|
print "<td>".getLongReadableDate(filectime($backupdir.$entry))."</td>\n";
|
||||||
print "<td>".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))."</td>\n";
|
print "<td>".SeedDMS_Core_File::format_filesize(filesize($backupdir.$entry))."</td>\n";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print "<a href=\"out.RemoveArchive.php?arkname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("backup_remove")."</a>";
|
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 "</td>\n";
|
||||||
|
@ -137,10 +137,10 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
$print_header=true;
|
$print_header=true;
|
||||||
|
|
||||||
$handle = opendir($contentdir);
|
$handle = opendir($backupdir);
|
||||||
$entries = array();
|
$entries = array();
|
||||||
while ($e = readdir($handle)){
|
while ($e = readdir($handle)){
|
||||||
if (is_dir($contentdir.$e)) continue;
|
if (is_dir($backupdir.$e)) continue;
|
||||||
if (strpos($e,".sql.gz")==FALSE) continue;
|
if (strpos($e,".sql.gz")==FALSE) continue;
|
||||||
$entries[] = $e;
|
$entries[] = $e;
|
||||||
}
|
}
|
||||||
|
@ -164,8 +164,8 @@ class SeedDMS_View_BackupTools extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
print "<td><a href=\"../op/op.Download.php?dumpname=".$entry."\">".$entry."</a></td>\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>".getLongReadableDate(filectime($backupdir.$entry))."</td>\n";
|
||||||
print "<td>".SeedDMS_Core_File::format_filesize(filesize($contentdir.$entry))."</td>\n";
|
print "<td>".SeedDMS_Core_File::format_filesize(filesize($backupdir.$entry))."</td>\n";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print "<a href=\"out.RemoveDump.php?dumpname=".$entry."\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("dump_remove")."</a>";
|
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 "</td>\n";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user