aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'mod/developers/views/default')
-rw-r--r--mod/developers/views/default/admin/developers/settings.php41
-rw-r--r--mod/developers/views/default/forms/developers/settings.php37
2 files changed, 55 insertions, 23 deletions
diff --git a/mod/developers/views/default/admin/developers/settings.php b/mod/developers/views/default/admin/developers/settings.php
index 990d77263..705ad00c6 100644
--- a/mod/developers/views/default/admin/developers/settings.php
+++ b/mod/developers/views/default/admin/developers/settings.php
@@ -3,5 +3,44 @@
* Developer settings
*/
+$sections = array(
+ 'simple_cache' => 'checkbox',
+ 'view_path_cache' => 'checkbox',
+ 'display_errors' => 'checkbox',
+ 'debug_level' => 'pulldown',
+);
+
+$data = array(
+ 'simple_cache' => array(
+ 'type' => 'checkbox',
+ 'value' => 1,
+ 'checked' => elgg_get_config('simplecache_enabled') == 1,
+ ),
+
+ 'view_path_cache' => array(
+ 'type' => 'checkbox',
+ 'value' => 1,
+ 'checked' => elgg_get_config('viewpath_cache_enabled') == 1,
+ ),
+
+ 'display_errors' => array(
+ 'type' => 'checkbox',
+ 'value' => 1,
+ 'checked' => elgg_get_plugin_setting('display_errors', 'developers') == 1,
+ ),
+
+ 'debug_level' => array(
+ 'type' => 'dropdown',
+ 'value' => elgg_get_config('debug'),
+ 'options_values' => array(
+ false => elgg_echo('developers:debug:off'),
+ 'ERROR' => elgg_echo('developers:debug:error'),
+ 'WARNING' => elgg_echo('developers:debug:warning'),
+ 'NOTICE' => elgg_echo('developers:debug:notice'),
+ ),
+ ),
+);
+
$form_vars = array('id' => 'developer-settings-form');
-echo elgg_view_form('developers/settings', $form_vars, array()); \ No newline at end of file
+$body_vars = array('data' => $data);
+echo elgg_view_form('developers/settings', $form_vars, $body_vars);
diff --git a/mod/developers/views/default/forms/developers/settings.php b/mod/developers/views/default/forms/developers/settings.php
index 2a3825500..371a2de2b 100644
--- a/mod/developers/views/default/forms/developers/settings.php
+++ b/mod/developers/views/default/forms/developers/settings.php
@@ -2,40 +2,33 @@
/**
* Settings form body
*
- * @uses $vars['values'] Array of current values
- * @uses $vars['options'] Array of possible options
+ * @uses $vars['values']
*/
$form_body = '<p>' . elgg_echo('elgg_dev_tools:settings:explanation') . '</p>';
-$sections = array(
- 'simple_cache' => 'checkbox',
- 'views_cache' => 'checkbox',
- //'display_errors' => 'checkbox',
- 'debug_level' => 'pulldown',
-);
-
-foreach ($sections as $name => $type) {
- echo '<p>';
- if ($type == 'checkbox') {
- echo elgg_view("input/$type", array(
- 'internalname' => $name,
- 'value' => $vars['settings'][$name],
+foreach ($vars['data'] as $name => $info) {
+ echo '<div>';
+ if ($info['type'] == 'checkbox') {
+ echo elgg_view("input/checkbox", array(
+ 'name' => $name,
+ 'value' => $info['value'],
+ 'checked' => $info['checked'],
));
echo '<label>' . elgg_echo("developers:label:$name") . '</label>';
echo '<span class="elgg-text-help">' . elgg_echo("developers:help:$name") . '</span>';
} else {
echo '<label>' . elgg_echo("developers:label:$name") . '</label>';
- echo elgg_view("input/$type", array(
- 'internalname' => $name,
- 'value' => $vars['settings'][$name],
- 'options' => $vars['options'][$name],
+ echo elgg_view("input/{$info['type']}", array(
+ 'name' => $name,
+ 'value' => $info['value'],
+ 'options_values' => $info['options_values'],
));
echo '<span class="elgg-text-help">' . elgg_echo("developers:help:$name") . '</span>';
}
- echo '</p>';
+ echo '</div>';
}
-echo '<p>';
+echo '<div>';
echo elgg_view('input/submit', array('value' => elgg_echo('save')));
-echo '</p>'; \ No newline at end of file
+echo '</div>';