From 570775f5bba9bd8833dc62aa8f6134b8e82073e9 Mon Sep 17 00:00:00 2001 From: steinm Date: Wed, 19 Dec 2012 10:20:48 +0000 Subject: [PATCH] - seperate webdav logs and regular logs - viewing a log will open a modal box --- views/bootstrap/class.LogManagement.php | 115 +++++++++++++++--------- 1 file changed, 74 insertions(+), 41 deletions(-) diff --git a/views/bootstrap/class.LogManagement.php b/views/bootstrap/class.LogManagement.php index 2be41ad97..a34877609 100644 --- a/views/bootstrap/class.LogManagement.php +++ b/views/bootstrap/class.LogManagement.php @@ -31,35 +31,8 @@ require_once("class.Bootstrap.php"); */ class LetoDMS_View_LogManagement extends LetoDMS_Bootstrap_Style { - function show() { /* {{{ */ - $dms = $this->params['dms']; - $user = $this->params['user']; - $contentdir = $this->params['contentdir']; - $logname = $this->params['logname']; - - $this->htmlStartPage(getMLText("backup_tools")); - $this->globalNavigation(); - $this->contentStart(); - $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); - - $this->contentHeading(getMLText("log_management")); - $this->contentContainerStart(); - - $print_header=true; - - $handle = opendir($contentdir); - $entries = array(); - while ($e = readdir($handle)){ - if (is_dir($contentdir.$e)) continue; - if (strpos($e,".log")==FALSE) continue; - if (strcmp($e,"current.log")==0) continue; - $entries[] = $e; - } - closedir($handle); - - sort($entries); - $entries = array_reverse($entries); - + function filelist($entries) { /* {{{ */ + $print_header = true; foreach ($entries as $entry){ if ($print_header){ @@ -75,6 +48,7 @@ class LetoDMS_View_LogManagement extends LetoDMS_Bootstrap_Style { print "\n"; print "".$entry."\n"; + print "\n"; print "".getLongReadableDate(filectime($contentdir.$entry))."\n"; print "".formatted_size(filesize($contentdir.$entry))."\n"; print ""; @@ -82,33 +56,92 @@ class LetoDMS_View_LogManagement extends LetoDMS_Bootstrap_Style { print "".getMLText("rm_file").""; print " "; print "".getMLText("download").""; - + print " "; + print "View …"; print "\n"; print "\n"; } if ($print_header) printMLText("empty_notify_list"); else print "\n"; + } /* }}} */ + function show() { /* {{{ */ + $dms = $this->params['dms']; + $user = $this->params['user']; + $contentdir = $this->params['contentdir']; + $logname = $this->params['logname']; + + if(!$logname) { + $this->htmlStartPage(getMLText("backup_tools")); + $this->globalNavigation(); + $this->contentStart(); + $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); + + $this->contentHeading(getMLText("log_management")); + + $handle = opendir($contentdir); + $entries = array(); + $wentries = array(); + while ($e = readdir($handle)){ + if (is_dir($contentdir.$e)) continue; + if (strpos($e,".log")==FALSE) continue; + if (strcmp($e,"current.log")==0) continue; + if(substr($e, 0, 6) == 'webdav') { + $wentries[] = $e; + } else { + $entries[] = $e; + } + } + closedir($handle); + + sort($entries); + sort($wentries); + $entries = array_reverse($entries); + $wentries = array_reverse($wentries); +?> + +
+
+contentContainerStart(); + $this->filelist($entries); $this->contentContainerEnd(); +?> +
+
+contentContainerStart(); + $this->filelist($wentries); + $this->contentContainerEnd(); +?> +
+
+ +htmlEndPage(); + } elseif(file_exists($contentdir.$logname)){ +// $this->htmlStartPage(getMLText("backup_tools")); - if ($logname && file_exists($contentdir.$logname)){ +// $this->contentSubHeading(sanitizeString($logname)); - $this->contentHeading(" "); - $this->contentContainerStart(); - - $this->contentSubHeading(sanitizeString($logname)); - - echo "
"; - echo "
\n";
+			echo $logname."
\n";
 			readfile($contentdir.$logname);
 			echo "
\n"; - echo "
"; - $this->contentContainerEnd(); +// echo "\n\n"; } - $this->htmlEndPage(); } /* }}} */ } ?>