diff --git a/src/admin/index.php b/src/admin/index.php index 3bffae7..7035016 100644 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -172,6 +172,7 @@ if ( isset($_POST['op']) ) if ( isset ($_POST['InjectBodyFooter']) ) { $content['InjectBodyFooter'] = $_POST['InjectBodyFooter']; } if ( isset ($_POST['PhplogconLogoUrl']) ) { $content['PhplogconLogoUrl'] = $_POST['PhplogconLogoUrl']; } if ( isset ($_POST['UseProxyServerForRemoteQueries']) ) { $content['UseProxyServerForRemoteQueries'] = $_POST['UseProxyServerForRemoteQueries']; } + if ( isset ($_POST['HeaderDefaultEncoding']) ) { $content['HeaderDefaultEncoding'] = $_POST['HeaderDefaultEncoding']; } // Save configuration variables now SaveGeneralSettingsIntoDB(); @@ -309,6 +310,22 @@ foreach ( $content['SOURCES'] as &$mySource ) } // --- +// --- Init for DefaultEncoding field! +// copy Sources Array +$content['ENCODINGS'] = $encodings; +// if ( !isset($content['DefaultSourceID']) ) { $content['DefaultSourceID'] = ''; } +foreach ( $content['ENCODINGS'] as &$myEncoding) +{ + $myEncoding['DisplayName'] = $myEncoding['ID']; + if ( $myEncoding['ID'] == $content['HeaderDefaultEncoding'] ) + $myEncoding['selected'] = "selected"; + else + $myEncoding['selected'] = ""; +} +// --- + + + // Do if User wants extra options if ( $content['ENABLEUSEROPTIONS'] ) { diff --git a/src/include/config.sample.php b/src/include/config.sample.php index ab3ac12..fb590da 100644 --- a/src/include/config.sample.php +++ b/src/include/config.sample.php @@ -86,6 +86,7 @@ $CFG['PopupMenuTimeout'] = 3000; // This variable defines the default timeout $CFG['PhplogconLogoUrl'] = ""; // Put an Url to a custom toplogo you want to use. $CFG['InlineOnlineSearchIcons'] = 1; // Show online search icons $CFG['UseProxyServerForRemoteQueries'] = "";// If empty no proxy server will be used. If set to a proxy server url like 127.0.0.1:8080, LogAnalyzer will use this server for url queries like the updatecheck. +$CFG['HeaderDefaultEncoding'] = ENC_ISO_8859_1; // Set default character encoding // --- // --- Custom HTML Code diff --git a/src/include/constants_general.php b/src/include/constants_general.php index 1d965eb..7131757 100644 --- a/src/include/constants_general.php +++ b/src/include/constants_general.php @@ -216,4 +216,10 @@ $msgtype_colors[IUT_SMTPLISTENER] = "#CCE4DE"; $msgtype_colors[IUT_WEBSERVERLOG] = "#E1FBD0"; // --- +// Supported Encodings +define('ENC_ISO_8859_1', "ISO-8859-1"); +define('ENC_UTF8', "utf-8"); +$encodings[ENC_ISO_8859_1] = array("ID" => ENC_ISO_8859_1); +$encodings[ENC_UTF8] = array("ID" => ENC_UTF8); + ?> \ No newline at end of file diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 5b12c8e..8b883ce 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -75,7 +75,6 @@ $content['SHOW_DONATEBUTTON'] = true; // Default = true! // PreInit overall user variables $content['EXTRA_PHPLOGCON_LOGO'] = $content['BASEPATH'] . "images/main/Header-Logo.png"; $content['EXTRA_METATAGS'] = ""; -//$content['EXTRA_METATAGS'] .= ''; $content['EXTRA_JAVASCRIPT'] = ""; $content['EXTRA_STYLESHEET'] = ""; $content['EXTRA_HTMLHEAD'] = ""; @@ -905,6 +904,10 @@ function InitConfigurationValues() $content['UseProxyServerForRemoteQueries'] = ""; // Init Option // --- + // --- Read Encoding Option, and set default! + $content['HeaderDefaultEncoding'] = GetConfigSetting("HeaderDefaultEncoding", ENC_ISO_8859_1); + // --- + // Init main langauge file now! IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/main.php' ); @@ -1089,12 +1092,15 @@ function GetStringWithHTMLCodes($myStr) function InitTemplateParser() { - global $page, $gl_root_path; + global $page, $gl_root_path, $content; // ----------------------------------------------- // Create Template Object and set some variables for the templates // ----------------------------------------------- $page = new Template(); $page -> set_path ( $gl_root_path . "templates/" ); + + // Append correct Character encoding to HTML Header + $content['EXTRA_METATAGS'] .= ''; } function VerifyLanguage( $mylang ) @@ -1570,6 +1576,7 @@ function SaveGeneralSettingsIntoDB($bForceStripSlahes = false) WriteConfigValue( "MiscDebugToSyslog", true, null, null,$bForceStripSlahes ); WriteConfigValue( "MiscMaxExecutionTime", true, null, null,$bForceStripSlahes ); WriteConfigValue( "UseProxyServerForRemoteQueries", true, null, null,$bForceStripSlahes ); + WriteConfigValue( "HeaderDefaultEncoding", true, null, null,$bForceStripSlahes ); // Custom HTML Code WriteConfigValue( "InjectHtmlHeader", true, null, null,$bForceStripSlahes ); diff --git a/src/lang/de/admin.php b/src/lang/de/admin.php index 5a0e130..a568b3d 100644 --- a/src/lang/de/admin.php +++ b/src/lang/de/admin.php @@ -109,6 +109,7 @@ $content['LN_ADMIN_PHPLOGCON_LOGOURL'] = "Optionale LogAnalyzer-Logo-URL. Bitte $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allowed to perform any change operations."; $content['LN_ADMIN_ERROR_NOTALLOWEDTOEDIT'] = "You are not allowed to edit this configuration item."; $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a proxy server! If set to valid proxy server (for example '127.0.0.1:8080'), LogAnalyzer will use this server for remote queries like the update check feature."; +$content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; // User Center $content['LN_USER_CENTER'] = "Benutzer Optionen"; diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index e4205c6..15f744d 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -109,6 +109,7 @@ $content['LN_ADMIN_PHPLOGCON_LOGOURL'] = "Optional LogAnalyzer Logo URL. Leave e $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allowed to perform any change operations."; $content['LN_ADMIN_ERROR_NOTALLOWEDTOEDIT'] = "You are not allowed to edit this configuration item."; $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a proxy server! If set to valid proxy server (for example '127.0.0.1:8080'), LogAnalyzer will use this server for remote queries like the update check feature."; +$content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/lang/it_IT/admin.php b/src/lang/it_IT/admin.php index 12755c8..b67d452 100644 --- a/src/lang/it_IT/admin.php +++ b/src/lang/it_IT/admin.php @@ -109,6 +109,7 @@ $content['LN_ADMIN_PHPLOGCON_LOGOURL'] = "Optional LogAnalyzer Logo URL. Leave e $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allowed to perform any change operations."; $content['LN_ADMIN_ERROR_NOTALLOWEDTOEDIT'] = "You are not allowed to edit this configuration item."; $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a proxy server! If set to valid proxy server (for example '127.0.0.1:8080'), LogAnalyzer will use this server for remote queries like the update check feature."; +$content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/lang/pt_BR/admin.php b/src/lang/pt_BR/admin.php index 102361a..541d6bc 100644 --- a/src/lang/pt_BR/admin.php +++ b/src/lang/pt_BR/admin.php @@ -109,6 +109,7 @@ $content['LN_ADMIN_PHPLOGCON_LOGOURL'] = "Optional LogAnalyzer Logo URL. Leave e $content['LN_ADMIN_ERROR_READONLY'] = "This is a READONLY User, you are not allowed to perform any change operations."; $content['LN_ADMIN_ERROR_NOTALLOWEDTOEDIT'] = "You are not allowed to edit this configuration item."; $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a proxy server! If set to valid proxy server (for example '127.0.0.1:8080'), LogAnalyzer will use this server for remote queries like the update check feature."; +$content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding"; // User Center $content['LN_USER_CENTER'] = "User Options"; diff --git a/src/templates/admin/admin_index.html b/src/templates/admin/admin_index.html index d4ee8df..b312640 100644 --- a/src/templates/admin/admin_index.html +++ b/src/templates/admin/admin_index.html @@ -280,6 +280,16 @@ {LN_ADMIN_USEPROXYSERVER} + + {LN_ADMIN_DEFAULTENCODING} + + + + {LN_GEN_DEBUGUSERLOGIN} diff --git a/src/templates/include_footer.html b/src/templates/include_footer.html index 08a9471..0899631 100644 --- a/src/templates/include_footer.html +++ b/src/templates/include_footer.html @@ -1,7 +1,7 @@ - +
Made by Adiscon GmbH (2008)Made by Adiscon GmbH (2008-2011)  Adiscon LogAnalyzer Version {BUILDNUMBER}