aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/actions
diff options
context:
space:
mode:
Diffstat (limited to 'mod/developers/actions')
-rw-r--r--mod/developers/actions/developers/inspect.php16
-rw-r--r--mod/developers/actions/developers/settings.php35
2 files changed, 51 insertions, 0 deletions
diff --git a/mod/developers/actions/developers/inspect.php b/mod/developers/actions/developers/inspect.php
new file mode 100644
index 000000000..6fd9e90f9
--- /dev/null
+++ b/mod/developers/actions/developers/inspect.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Ajax endpoint for inspection
+ *
+ */
+
+$inspect_type = get_input('inspect_type');
+$method = 'get' . str_replace(' ', '', $inspect_type);
+
+$inspector = new ElggInspector();
+if ($inspector && method_exists($inspector, $method)) {
+ $tree = $inspector->$method();
+ echo elgg_view('developers/tree', array('tree' => $tree));
+} else {
+ echo 'error';
+}
diff --git a/mod/developers/actions/developers/settings.php b/mod/developers/actions/developers/settings.php
new file mode 100644
index 000000000..7c91e2f5f
--- /dev/null
+++ b/mod/developers/actions/developers/settings.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Save the developer settings
+ */
+
+$site = elgg_get_site_entity();
+
+if (get_input('simple_cache')) {
+ elgg_enable_simplecache();
+} else {
+ elgg_disable_simplecache();
+}
+
+if (get_input('system_cache')) {
+ elgg_enable_system_cache();
+} else {
+ elgg_disable_system_cache();
+}
+
+$debug = get_input('debug_level');
+if ($debug) {
+ set_config('debug', $debug, $site->getGUID());
+} else {
+ unset_config('debug', $site->getGUID());
+}
+
+$simple_settings = array('display_errors', 'screen_log', 'show_strings',
+ 'wrap_views', 'log_events',);
+foreach ($simple_settings as $setting) {
+ elgg_set_plugin_setting($setting, get_input($setting), 'developers');
+}
+
+system_message(elgg_echo('developers:settings:success'));
+
+forward(REFERER);