Minor changes in the index.php and added language strings

This commit is contained in:
Andre Lorbach 2008-03-12 15:38:48 +01:00
parent bcf8c70283
commit 0ec6b17b0a
3 changed files with 38 additions and 4 deletions

View File

@ -48,16 +48,20 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren
// Create LogStream Object
$stream = $stream_config->LogStreamFactory($stream_config);
$stream->Open( array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_FACILITY_TEXT, SYSLOG_SEVERITY, SYSLOG_SEVERITY_TEXT, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_MESSAGE, SYSLOG_MESSAGETYPE ), true);
$uID = -1;
$counter = 0;
// $stream->SetReadDirection(EnumReadDirection::Backward);
while ($stream->ReadNext($uID, $logArray) == 0 && $counter <= 30)
while ($stream->ReadNext($uID, $logArray) == SUCCESS && $counter <= 30)
{
// Copy Obtained array
$content['syslogmessages'][] = $logArray;
// Copy UID
$content['syslogmessages'][$counter]['UID'] = $uID;
// Set truncasted message for display
if ( isset($logArray[SYSLOG_MESSAGE]) )
$content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] = strlen($logArray[SYSLOG_MESSAGE]) > 100 ? substr($logArray[SYSLOG_MESSAGE], 0, 100 ) . " ..." : $logArray[SYSLOG_MESSAGE];
@ -68,6 +72,14 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren
$counter++;
}
if ( $stream->ReadNext($uID, $logArray) == SUCCESS )
{
// Enable Player Pager
$content['main_pagerenabled'] = "true";
}
// Close file!
$stream->Close();
}

View File

@ -6,10 +6,16 @@ $content['LN_MAINTITLE'] = "Main PhpLogCon";
$content['LN_MAIN_SELECTSTYLE'] = "Select a Style";
$content['LN_GEN_LANGUAGE'] = "Select language";
$content['LN_GEN_SELECTSOURCE'] = "Select Source";
$content['LN_GEN_MOREPAGES'] = "More then one Page available";
$content['LN_GEN_FIRSTPAGE'] = "First Page";
$content['LN_GEN_LASTPAGE'] = "Last Page";
$content['LN_GEN_NEXTPAGE'] = "Next Page";
$content['LN_GEN_PREVIOUSPAGE'] = "Previous Page";
// Main Index Site
$content['LN_ERROR_INSTALLFILEREMINDER'] = "Warning! You still have NOT removed the 'install.php' from your PhpLogCon main directory!";
$content['LN_TOP_NUM'] = "No.";
$content['LN_TOP_UID'] = "uID";
$content['LN_GRID_DATE'] = "Date";
$content['LN_GRID_FACILITY'] = "Facility";
$content['LN_GRID_SEVERITY'] = "Severity";
@ -18,5 +24,4 @@ $content['LN_GRID_INFOUNIT'] = "InfoUnit";
$content['LN_GRID_HOST'] = "Source";
$content['LN_GRID_MSG'] = "Message";
?>

View File

@ -25,13 +25,30 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="with_border">
<tr>
<td colspan="3" class="title" nowrap><B>Recent syslog messages</B></td>
</tr>
<!-- IF main_pagerenabled="true" -->
<table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="with_border">
<tr>
<td nowrap width="100%"class="line2"><I>&nbsp;{LN_GEN_MOREPAGES}</I></td>
<td class="cellmenu2" nowrap><B>Pager: &nbsp; </B></td>
<td class="line0" nowrap><a href="?sorting={sorting}&start={mypagebegin}{additional_url}" target="_top"><img src="{BASEPATH}images/icons/media_beginning.png" width="16" title="{LN_GEN_FIRSTPAGE}"></a>&nbsp;</td>
<td class="line1" nowrap><a href="?sorting={sorting}&start={mypagebegin}{additional_url}" target="_top"><img src="{BASEPATH}images/icons/media_rewind.png" width="16" title="{LN_GEN_NEXTPAGE}"></a>&nbsp;</td>
<!-- BEGIN syslogpages -->
<td class="{cssclass}" nowrap><a href="?sorting={sorting}&start={mypagebegin}{additional_url}" target="_top">{mypagenumber}</a>&nbsp;</td>
<!-- END syslogpages -->
<td class="line0" nowrap><a href="?sorting={sorting}&start={mypagebegin}{additional_url}" target="_top"><img src="{BASEPATH}images/icons/media_fast_forward.png" width="16" title="{LN_GEN_PREVIOUSPAGE}"></a>&nbsp;</td>
<td class="line1" nowrap><a href="?sorting={sorting}&start={mypagebegin}{additional_url}" target="_top"><img src="{BASEPATH}images/icons/media_end.png" width="16" title="{LN_GEN_LASTPAGE}"></a>&nbsp;</td>
</tr>
</table>
<!-- ENDIF main_pagerenabled="true" -->
<tr>
<td width="100%" valign="top">
<!-- IF syslogmessagesenabled="true" -->
<table width="100%" cellpadding="0" cellspacing="1" border="0" align="center" class="with_border_alternate">
<tr>
<td width="25" class="cellmenu1" align="center" nowrap><B>{LN_TOP_NUM}</B></td>
<td width="25" class="cellmenu1" align="center" nowrap><B>{LN_TOP_UID}</B></td>
<td width="100" class="cellmenu1" align="center" nowrap><A HREF="?sorting={additional_url}" class="cellmenu1_link" >{LN_GRID_DATE}</A></td>
<td width="50" class="cellmenu1" align="center" nowrap><A HREF="?sorting={additional_url}" class="cellmenu1_link" >{LN_GRID_FACILITY}</A></td>
<td width="50" class="cellmenu1" align="center" nowrap><A HREF="?sorting={additional_url}" class="cellmenu1_link" >{LN_GRID_SEVERITY}</A></td>
@ -43,7 +60,7 @@
<!-- BEGIN syslogmessages -->
<tr>
<td align="right" class="{cssclass}"><B>{ZAEHLER}</B></td>
<td align="right" class="{cssclass}"><B>{UID}</B></td>
<td align="center" class="{cssclass}"><B>{timereported}</B></td>
<td align="left" class="{cssclass}"><B>{syslogfacility-text}</B></td>
<td align="left" class="{cssclass}"><B>{syslogseverity-text}</B></td>