From f8cc979307416fbd9b27908ec461004a3feb9387 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 Aug 2011 14:12:39 +0000 Subject: [PATCH] Suffix '_enabled' in config entries is deprecated --- inc/config-global.php | 4 ++-- inc/extensions/ext-other.php | 13 ++++++++++--- inc/language/other_de.php | 4 ++-- inc/modules/admin/what-cache_stats.php | 2 +- inc/modules/admin/what-config_other.php | 7 ------- inc/stats-functions.php | 8 +++++--- inc/wrapper-functions.php | 4 ++-- templates/de/html/admin/admin_config_admin.tpl | 2 +- templates/de/html/admin/admin_config_other.tpl | 6 +++--- 9 files changed, 26 insertions(+), 24 deletions(-) diff --git a/inc/config-global.php b/inc/config-global.php index 9eba061612..f43e484d1e 100644 --- a/inc/config-global.php +++ b/inc/config-global.php @@ -98,8 +98,8 @@ setConfigEntry('COPY', 'Copyright © 2003 - 2009, by Roland Häder,
_enabled in Konfigurationseinträgen ist deprecated und sollte nicht mehr verwendet werden. Da sonst Wrapper-Funktionsnamen wie z.B. isStatsEnabledEnabled() nach streng genommender Namenskonvention entstehen."); + break; } // END - switch break; diff --git a/inc/language/other_de.php b/inc/language/other_de.php index 6bb1e7e83c..99e149d579 100644 --- a/inc/language/other_de.php +++ b/inc/language/other_de.php @@ -78,8 +78,8 @@ addMessages(array( 'ADMIN_CONFIG_MINIMUM_AGE' => "Ab welchem Mindestalter dürfen sich Ihre Mitglieder anmelden?", 'ADMIN_CONFIG_SQL_TITLE' => "SQL-Einstellungen", 'ADMIN_CONFIG_DISPLAY_DEBUG_SQLS' => "Sollen die SQL-Abfragen für Administratoren zu Debug-Zwecken angezeigt werden?. Das Einschalten dieser Einstellung kann enorme Performanceverluste bedeuten.", - 'ADMIN_CONFIG_STATS_TITLE' => "Interne Statistik Einstellungen", - 'ADMIN_CONFIG_STATS_ENABLED' => "Sollen die internen Statistiken eingeschaltet sein? Das Abschalten dieser Statistiken kann etwas Performance bringen, ist aber für Performancemessungen vorraussetzend.", + 'ADMIN_CONFIG_INTERNAL_STATS_TITLE' => "Interne Statistik Einstellungen", + 'ADMIN_CONFIG_INTERNAL_STATS_ENABLED' => "Sollen die internen Statistiken eingeschaltet sein? Das Abschalten dieser Statistiken kann etwas Performance bringen, ist aber für Performancemessungen vorraussetzend.", )); // [EOF] diff --git a/inc/modules/admin/what-cache_stats.php b/inc/modules/admin/what-cache_stats.php index f975bb299b..589d69ae2a 100644 --- a/inc/modules/admin/what-cache_stats.php +++ b/inc/modules/admin/what-cache_stats.php @@ -44,7 +44,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { addYouAreHereLink('admin', __FILE__); // Activated? -if (ifStatsAreEnabled()) { +if (ifInternalStatsEnabled()) { // Prepare data for the template $content['db_hits'] = getStatsEntry('db_hits'); $content['cache_hits'] = getStatsEntry('cache_hits'); diff --git a/inc/modules/admin/what-config_other.php b/inc/modules/admin/what-config_other.php index 2715e1fb2c..27e28fc05f 100644 --- a/inc/modules/admin/what-config_other.php +++ b/inc/modules/admin/what-config_other.php @@ -78,13 +78,6 @@ if (isFormSent()) { $content['profile_update'] = createConfigurationTimeSelections('profile_update' , 'YM'); $content['profile_reupdate'] = createConfigurationTimeSelections('resend_profile_update', 'MWD'); - // Prepare more Y/N selections - foreach (array('show_points_unconfirmed','show_timings','youre_here','member_menu','guest_menu','order_multi_page','autosend_active','send_prof_update','admin_notify','display_debug_sqls','stats_enabled') as $entry) { - $content[$entry . '_y'] = ''; - $content[$entry . '_n'] = ''; - $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"'; - } // END - foreach - // Prepare more foreach (array('css_php_direct','css_php_file','css_php_inline','mailid_error_redirect_index','mailid_error_redirect_reject') as $entry) { $content[$entry] = ''; diff --git a/inc/stats-functions.php b/inc/stats-functions.php index 3b0a794d96..343a7c510c 100644 --- a/inc/stats-functions.php +++ b/inc/stats-functions.php @@ -43,7 +43,7 @@ if (!defined('__SECURITY')) { // Init stats system function initStatsSystem () { // Is stats cache loaded? - if ((!isset($GLOBALS['stats_loaded'])) && (ifStatsAreEnabled())) { + if ((!isset($GLOBALS['stats_loaded'])) && (ifInternalStatsEnabled())) { // Init statistics array $GLOBALS['stats'] = array(); @@ -64,7 +64,9 @@ function isStatsEntrySet ($entry) { // Increments a statistics entry function incrementStatsEntry ($entry, $amount=1) { // Do we have stats enabled? - if (!ifStatsAreEnabled()) return; + if (!ifInternalStatsEnabled()) { + return; + } // END - if // Is it there? if (isStatsEntrySet($entry)) { @@ -174,7 +176,7 @@ function writeStatsTable () { // Filter for flushing statistics function FILTER_FLUSH_STATS () { // Now do we have stats? - if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (ifStatsAreEnabled())) { + if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (ifInternalStatsEnabled())) { // Write statistics to temporary table writeStatsTable(); } // END - if diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 24a2f34095..1c3e2b60d1 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1523,11 +1523,11 @@ function isWhatTitleEnabled () { } // Checks wether stats are enabled -function ifStatsAreEnabled () { +function ifInternalStatsEnabled () { // Do we have cache? if (!isset($GLOBALS[__FUNCTION__])) { // Then determine it - $GLOBALS[__FUNCTION__] = (getConfig('stats_enabled') == 'Y'); + $GLOBALS[__FUNCTION__] = (getConfig('internal_stats') == 'Y'); } // END - if // Return cached value diff --git a/templates/de/html/admin/admin_config_admin.tpl b/templates/de/html/admin/admin_config_admin.tpl index 0e0c9b2a22..ad1fda779c 100644 --- a/templates/de/html/admin/admin_config_admin.tpl +++ b/templates/de/html/admin/admin_config_admin.tpl @@ -30,7 +30,7 @@ {--ADMIN_CONFIG_ADMIN_MENU_JAVASCRIPT_ENABLED--} - {%template,ConfigurationYesNoSelectionBox=admin_menu_javascript_enabled%} + {%template,ConfigurationYesNoSelectionBox=admin_menu_javascript%} diff --git a/templates/de/html/admin/admin_config_other.tpl b/templates/de/html/admin/admin_config_other.tpl index 23cdfef731..0e7fa0c3b0 100644 --- a/templates/de/html/admin/admin_config_other.tpl +++ b/templates/de/html/admin/admin_config_other.tpl @@ -274,16 +274,16 @@ - {--ADMIN_CONFIG_STATS_TITLE--} + {--ADMIN_CONFIG_INTERNAL_STATS_TITLE--} - {--ADMIN_CONFIG_STATS_ENABLED--} + {--ADMIN_CONFIG_INTERNAL_STATS_ENABLED--} - {%template,ConfigurationYesNoSelectionBox=stats_enabled%} + {%template,ConfigurationYesNoSelectionBox=internal_stats%} -- 2.39.5