From 3ed6e69ea8168e3f5b7fdbccdb6654cbedf18534 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Mon, 19 May 2008 13:10:38 +0200 Subject: [PATCH] Configured Columns which are not defined will be automatically hidden now --- src/index.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/index.php b/src/index.php index 21398b5..9c4ce60 100644 --- a/src/index.php +++ b/src/index.php @@ -201,16 +201,19 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c // --- Init the fields we need foreach($content['Columns'] as $mycolkey) { - $content['fields'][$mycolkey]['FieldID'] = $mycolkey; - $content['fields'][$mycolkey]['FieldCaption'] = $content[ $fields[$mycolkey]['FieldCaptionID'] ]; - $content['fields'][$mycolkey]['FieldType'] = $fields[$mycolkey]['FieldType']; - $content['fields'][$mycolkey]['FieldSortable'] = $stream->IsPropertySortable($mycolkey); // $fields[$mycolkey]['Sortable']; - $content['fields'][$mycolkey]['DefaultWidth'] = $fields[$mycolkey]['DefaultWidth']; + if ( isset($fields[$mycolkey]) ) + { + $content['fields'][$mycolkey]['FieldID'] = $mycolkey; + $content['fields'][$mycolkey]['FieldCaption'] = $content[ $fields[$mycolkey]['FieldCaptionID'] ]; + $content['fields'][$mycolkey]['FieldType'] = $fields[$mycolkey]['FieldType']; + $content['fields'][$mycolkey]['FieldSortable'] = $stream->IsPropertySortable($mycolkey); // $fields[$mycolkey]['Sortable']; + $content['fields'][$mycolkey]['DefaultWidth'] = $fields[$mycolkey]['DefaultWidth']; - if ( $mycolkey == SYSLOG_MESSAGE ) - $content['fields'][$mycolkey]['colspan'] = ''; //' colspan="2" '; - else - $content['fields'][$mycolkey]['colspan'] = ''; + if ( $mycolkey == SYSLOG_MESSAGE ) + $content['fields'][$mycolkey]['colspan'] = ''; //' colspan="2" '; + else + $content['fields'][$mycolkey]['colspan'] = ''; + } } // --- @@ -291,7 +294,7 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c // --- Now we populate the values array! foreach($content['Columns'] as $mycolkey) { - if ( isset($logArray[$mycolkey]) ) + if ( isset($fields[$mycolkey]) && isset($logArray[$mycolkey]) ) { // Set defaults $content['syslogmessages'][$counter]['values'][$mycolkey]['FieldColumn'] = $mycolkey;