Code

Updated log view
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 May 2008 11:16:37 +0000 (11:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 May 2008 11:16:37 +0000 (11:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10815 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/addons/goto/class_goto_log_view.inc
gosa-plugins/goto/addons/goto/log_view.tpl

index a75aba78cedb92d3f7ca412707ef00a0b6638795..82775d9299c67edbca6f9834a6f71cd05e3ca15b 100644 (file)
@@ -17,10 +17,11 @@ class goto_log_view extends plugin
   var $attributes = array("macAddress");
   var $macAddress = "";
 
-  var $sort_by  = "file";
+  var $sort_by  = "time";
   var $sort_dir = 1; // 1 => up, 0 => down
   
   var $ignore_account = TRUE;
+  var $standalone = FALSE;
  
   function __construct(&$config,$dn,$parent)
   {
@@ -43,8 +44,10 @@ class goto_log_view extends plugin
      */      
     if(is_array($this->parent) && isset($this->parent['MACADDRESS'])){
       $this->mac = $this->parent['MACADDRESS'];
+      $this->standalone = TRUE;
     }elseif(isset($parent->attrs['macAddress'][0])){
       $this->mac = $parent->attrs['macAddress'][0];
+      $this->standalone = FALSE;
     }
 
     /* Query for log files
@@ -74,6 +77,11 @@ class goto_log_view extends plugin
     $smarty->assign("selected_file",$this->selected_file);
     $smarty->assign("selected_date",$this->selected_date);
     $smarty->assign("log_file", $this->get_log($this->mac,$this->selected_date,$this->selected_file));        
+    $smarty->assign("standalone",$this->standalone);
+
+    $date = date("d.m.Y H:i:s",$this->logs[$this->mac][$this->selected_date]['REAL_DATE']);
+    $file = $this->selected_file;
+    $smarty->assign("selected_log",$file.", ".$date);
 
     $divlist = new divlist("log_view");
 
@@ -108,12 +116,18 @@ class goto_log_view extends plugin
       foreach($times as $time => $data){
         $rtime = $data['REAL_DATE'];
         foreach($data['FILES'] as $file){
+
+          $highlight = "";
+          if($file == $this->selected_file && $time == $this->selected_date && $mac == $this->mac){
+            $highlight = "background-color:#CCCCCC";
+          }
+
           $use_link = preg_replace(array("/%mac%/","/%time%/","/%file%/"),array($mac,$time,$file),$link);
           $to_add[$$sort_by.$file.$time] = array(
             array("string" => preg_replace("/%str%/",$file,$use_link),
-                  "attach" => "style='width:200px;'"),
+                  "attach" => "style='width:200px; $highlight'"),
             array("string" => preg_replace("/%str%/",date("d.m.Y H:i:s",$rtime),$use_link),
-                  "attach" => "style='border-right:none;'"),
+                  "attach" => "style='border-right:none; $highlight'"),
             );
         }
       }
index 5e0df9ddd38c8bdaa0a4ead4047b1bc0c9aa17a3..108ec9667f530bd43e1e4175dd22dc1decebbfbf 100644 (file)
@@ -5,7 +5,7 @@
        <div style="width:99%;border: solid 1px #CCCCCC;">{$divlist}</div>
   <br>
   <p class="seperator"></p>
-       <h2>{t}Selected log{/t}: {$selected_log} fabian, fill the selected log here: name, date</h2>
+       <h2>{t}Selected log{/t}: {$selected_log}</h2>
        <div style="width:99%;height:350px;padding:3px;background-color:white; overflow-y: scroll;border: solid 1px;">
                {$log_file}
        </div>