]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3500 added setting for raw string display
authorcash <cash.costello@gmail.com>
Sat, 2 Jul 2011 23:22:07 +0000 (19:22 -0400)
committercash <cash.costello@gmail.com>
Sat, 2 Jul 2011 23:22:07 +0000 (19:22 -0400)
mod/developers/actions/developers/settings.php
mod/developers/languages/en.php
mod/developers/start.php
mod/developers/views/default/admin/developers/settings.php

index 9fa96fa912c71234fbedea4b8c9197d897346aaf..5a7f97cd3163b1f0b53942314efba4a0f1d9187c 100644 (file)
@@ -17,9 +17,6 @@ if (get_input('view_path_cache')) {
        elgg_disable_filepath_cache();
 }
 
-elgg_set_plugin_setting('display_errors', get_input('display_errors'), 'developers');
-elgg_set_plugin_setting('screen_log', get_input('screen_log'), 'developers');
-
 $debug = get_input('debug_level');
 if ($debug) {
        set_config('debug', $debug, $site->getGUID());
@@ -27,6 +24,11 @@ if ($debug) {
        unset_config('debug', $site->getGUID());
 }
 
+$simple_settings = array('display_errors', 'screen_log', 'show_strings');
+foreach ($simple_settings as $setting) {
+       elgg_set_plugin_setting($setting, get_input($setting), 'developers');
+}
+
 system_message(elgg_echo('developers:settings:success'));
 
 forward(REFERER);
index 053eed04fed07b2bf4f79b088a8dca42e48226f0..827eb6ba3dafaada70a6c3fd09ef3a798cefcfec 100644 (file)
@@ -23,6 +23,8 @@ $english = array(
        'developers:help:display_errors' => "By default, Elgg's .htaccess file supresses the display of fatal errors.",
        'developers:label:screen_log' => "Log to the screen",
        'developers:help:screen_log' => "This displays elgg_log() and elgg_dump() output on the web page.",
+       'developers:label:show_strings' => "Show raw translation strings",
+       'developers:help:show_strings' => "This displays the translation strings used by elgg_echo().",
 
        'developers:debug:off' => 'Off',
        'developers:debug:error' => 'Error',
index 23b82d9db52dc7175fc29a82fb8641edc274e39a..b864bca1e1a2286cb3d9dc543a500e4eff33bd88 100644 (file)
@@ -40,6 +40,12 @@ function developers_process_settings() {
                elgg_register_plugin_hook_handler('debug', 'log', array($cache, 'insertDump'));
                elgg_extend_view('page/elements/foot', 'developers/log');
        }
+
+       if (elgg_get_plugin_setting('show_strings', 'developers') == 1) {
+               // first and last in case a plugin registers a translation in an init method
+               register_elgg_event_handler('init', 'system', 'developers_clear_strings', 1000);
+               register_elgg_event_handler('init', 'system', 'developers_clear_strings', 1);
+       }
 }
 
 function developers_setup_menu() {
@@ -50,6 +56,17 @@ function developers_setup_menu() {
        }
 }
 
+/**
+* Clear all the strings so the raw descriptor strings are displayed
+*/
+function developers_clear_strings() {
+       global $CONFIG;
+
+       $language = get_language();
+       $CONFIG->translations[$language] = array();
+       $CONFIG->translations['en'] = array();
+}
+
 /**
  * Serve the theme preview pages
  *
index 3843c2c30bb2aae65ea96a7b02768d1479c471c9..a1ae6c1866f01be35c90246e20f39c9c22b0b06d 100644 (file)
@@ -3,14 +3,6 @@
  * Developer settings
  */
 
-$sections = array(
-       'simple_cache' => 'checkbox',
-       'view_path_cache' => 'checkbox',
-       'display_errors' => 'checkbox',
-       'debug_level' => 'pulldown',
-       'screen_log' => 'checkbox',
-);
-
 $data = array(
        'simple_cache' => array(
                'type' => 'checkbox',
@@ -46,6 +38,12 @@ $data = array(
                'value' => 1,
                'checked' => elgg_get_plugin_setting('screen_log', 'developers') == 1,
        ),
+       
+       'show_strings' => array(
+               'type' => 'checkbox',
+               'value' => 1,
+               'checked' => elgg_get_plugin_setting('show_strings', 'developers') == 1,
+       ),
 );
 
 $form_vars = array('id' => 'developer-settings-form');