From: hickert Date: Wed, 7 May 2008 11:16:37 +0000 (+0000) Subject: Updated log view X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1f6291b7182b440366d787844fc7bb2733933f32;p=gosa.git Updated log view git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10815 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/goto/class_goto_log_view.inc b/gosa-plugins/goto/addons/goto/class_goto_log_view.inc index a75aba78c..82775d929 100644 --- a/gosa-plugins/goto/addons/goto/class_goto_log_view.inc +++ b/gosa-plugins/goto/addons/goto/class_goto_log_view.inc @@ -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'"), ); } } diff --git a/gosa-plugins/goto/addons/goto/log_view.tpl b/gosa-plugins/goto/addons/goto/log_view.tpl index 5e0df9ddd..108ec9667 100644 --- a/gosa-plugins/goto/addons/goto/log_view.tpl +++ b/gosa-plugins/goto/addons/goto/log_view.tpl @@ -5,7 +5,7 @@
{$divlist}

-

{t}Selected log{/t}: {$selected_log} fabian, fill the selected log here: name, date

+

{t}Selected log{/t}: {$selected_log}

{$log_file}