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());
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);
'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',
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() {
}
}
+/**
+* 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
*
* 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',
'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');