diff --git a/src/index.php b/src/index.php index 853045e..7301ae1 100644 --- a/src/index.php +++ b/src/index.php @@ -450,7 +450,7 @@ if ( isset($content['Sources'][$currentSourceID]) ) if ( $mycolkey != SYSLOG_MESSAGE ) { if ( $myStrCharLimit > 0 ) - $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = GetStringWithHTMLCodes(strlen($logArray[$mycolkey]) > $myStrCharLimit ? substr($logArray[$mycolkey], 0, $myStrCharLimit) . " ..." : $logArray[$mycolkey]); + $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = GetStringWithHTMLCodes(strlen($logArray[$mycolkey]) > $myStrCharLimit ? substr($logArray[$mycolkey], 0, $myStrCharLimit) . "..." : $logArray[$mycolkey]); } // --- @@ -771,7 +771,7 @@ function PrepareStringForSearch($myString) function AddOnClickMenu(&$fieldGridItem, $fieldType, $FieldID, $szFieldDisplayNameID, $searchOnline = false) { - global $content, $fields; + global $content, $fields, $myStrCharLimit; // Set OnClick Menu for SYSLOG_SYSLOGTAG $fieldGridItem['hasbuttons'] = true; @@ -793,11 +793,15 @@ function AddOnClickMenu(&$fieldGridItem, $fieldType, $FieldID, $szFieldDisplayN { $fieldGridItem['buttons'][] = array( 'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+' . $szSearchFieldName . '%3A%3D' . $szEncodedFieldValue . '&search=Search' . $content['additional_url_sourceonly'], + 'ButtonTarget' => '_top', + 'ButtonAppendUrl' => true, 'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $fieldGridItem['fieldvalue']), 'IconSource' => $content['MENU_BULLET_GREEN'] ); $fieldGridItem['buttons'][] = array( 'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+' . $szSearchFieldName . '%3A-%3D' . $szEncodedFieldValue . '&search=Search' . $content['additional_url_sourceonly'], + 'ButtonTarget' => '_top', + 'ButtonAppendUrl' => true, 'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_EXCLUDEFILTER'], $fieldGridItem['fieldvalue']), 'IconSource' => $content['MENU_BULLET_GREEN'] ); @@ -806,11 +810,15 @@ function AddOnClickMenu(&$fieldGridItem, $fieldType, $FieldID, $szFieldDisplayN // More Menu entries $fieldGridItem['buttons'][] = array( 'ButtonUrl' => '?filter=' . $szSearchFieldName . '%3A%3D' . $szEncodedFieldValue . '&search=Search' . $content['additional_url_sourceonly'], + 'ButtonTarget' => '_top', + 'ButtonAppendUrl' => true, 'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $fieldGridItem['fieldvalue']), 'IconSource' => $content['MENU_BULLET_BLUE'] ); $fieldGridItem['buttons'][] = array( 'ButtonUrl' => '?filter=' . $szSearchFieldName . '%3A-%3D' . $szEncodedFieldValue . '&search=Search' . $content['additional_url_sourceonly'], + 'ButtonTarget' => '_top', + 'ButtonAppendUrl' => true, 'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_SHOWALLBUT'], $fieldGridItem['fieldvalue']), 'IconSource' => $content['MENU_BULLET_BLUE'] ); @@ -820,10 +828,25 @@ function AddOnClickMenu(&$fieldGridItem, $fieldType, $FieldID, $szFieldDisplayN { $fieldGridItem['buttons'][] = array( 'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . $FieldID . '&q=' . $szEncodedFieldValue, + 'ButtonTarget' => '_top', + 'ButtonAppendUrl' => true, 'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content[$szFieldDisplayNameID] . " '" . $fieldGridItem['fieldvalue'] . "'", 'IconSource' => $content['MENU_NETWORK'] ); } + + // Search for links within the fieldcontent! + if ( $fieldType == FILTER_TYPE_STRING && preg_match("#([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", $fieldGridItem['rawfieldvalue'], $szLink) >= 1 ) + { + $fieldGridItem['buttons'][] = array( + 'ButtonUrl' => $szLink[0], + 'ButtonTarget' => '_blank', + 'ButtonAppendUrl' => false, + 'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_VISITLINK'], strlen($szLink[0]) > $myStrCharLimit ? substr($szLink[0], 0, $myStrCharLimit) . "..." : $szLink[0] ), + 'IconSource' => $content['MENU_NETWORK'] + ); + } + } // --- diff --git a/src/lang/de/main.php b/src/lang/de/main.php index 4d69344..a6e10aa 100644 --- a/src/lang/de/main.php +++ b/src/lang/de/main.php @@ -132,6 +132,7 @@ $content['LN_SEARCH_PERFORMADVANCED'] = "Erweiterte Suche starten"; $content['LN_VIEW_EXCLUDEFILTER'] = "Exclude '%1' from filterset"; $content['LN_VIEW_FILTERFORONLY'] = "Filter for '%1' only"; $content['LN_VIEW_SHOWALLBUT'] = "Show all except '%1'"; + $content['LN_VIEW_VISITLINK'] = "Open Link '%1' in new window"; $content['LN_HIGHLIGHT'] = "Hightlight >>"; $content['LN_HIGHLIGHT_OFF'] = "Hightlight <<"; diff --git a/src/lang/en/main.php b/src/lang/en/main.php index f73dad3..5401330 100644 --- a/src/lang/en/main.php +++ b/src/lang/en/main.php @@ -133,7 +133,7 @@ $content['LN_GEN_MESSAGEDETAILS'] = "Message Details"; $content['LN_VIEW_EXCLUDEFILTER'] = "Exclude '%1' from filterset"; $content['LN_VIEW_FILTERFORONLY'] = "Filter for '%1' only"; $content['LN_VIEW_SHOWALLBUT'] = "Show all except '%1'"; - + $content['LN_VIEW_VISITLINK'] = "Open Link '%1' in new window"; $content['LN_HIGHLIGHT'] = "Hightlight >>"; $content['LN_HIGHLIGHT_OFF'] = "Hightlight <<"; diff --git a/src/lang/pt_BR/main.php b/src/lang/pt_BR/main.php index 8ae181e..e54adba 100644 --- a/src/lang/pt_BR/main.php +++ b/src/lang/pt_BR/main.php @@ -135,6 +135,7 @@ $content['LN_GEN_MESSAGEDETAILS'] = "Detalhes da Mensagem"; $content['LN_VIEW_EXCLUDEFILTER'] = "Exclude '%1' from filterset"; $content['LN_VIEW_FILTERFORONLY'] = "Filter for '%1' only"; $content['LN_VIEW_SHOWALLBUT'] = "Show all except '%1'"; + $content['LN_VIEW_VISITLINK'] = "Open Link '%1' in new window"; $content['LN_HIGHLIGHT'] = "Destacar >>"; $content['LN_HIGHLIGHT_OFF'] = "Destacar <<"; diff --git a/src/templates/index.html b/src/templates/index.html index 35d7cd9..4e86f58 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -263,7 +263,7 @@