aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/developers/views')
-rw-r--r--mod/developers/views/default/admin/developers/inspect.php14
-rw-r--r--mod/developers/views/default/developers/css.php3
-rw-r--r--mod/developers/views/default/developers/tree.php18
-rw-r--r--mod/developers/views/default/forms/developers/inspect.php23
-rw-r--r--mod/developers/views/default/js/developers/developers.php43
5 files changed, 101 insertions, 0 deletions
diff --git a/mod/developers/views/default/admin/developers/inspect.php b/mod/developers/views/default/admin/developers/inspect.php
new file mode 100644
index 000000000..cfa3de2ea
--- /dev/null
+++ b/mod/developers/views/default/admin/developers/inspect.php
@@ -0,0 +1,14 @@
+<?php
+/**
+* Inspect View
+*
+* Inspect global variables of Elgg
+*/
+
+elgg_load_js('jquery.jstree');
+elgg_load_css('jquery.jstree');
+
+echo elgg_view_form('developers/inspect', array('class' => 'developers-form-inspect'));
+
+echo '<div id="developers-inspect-results"></div>';
+echo elgg_view('graphics/ajax_loader', array('id' => 'developers-ajax-loader'));
diff --git a/mod/developers/views/default/developers/css.php b/mod/developers/views/default/developers/css.php
index 5e8419945..3aa226d0a 100644
--- a/mod/developers/views/default/developers/css.php
+++ b/mod/developers/views/default/developers/css.php
@@ -12,3 +12,6 @@
#developer-settings-form label {
margin-right: 5px;
}
+.elgg-page .jstree-default.jstree-focused {
+ background-color: transparent;
+}
diff --git a/mod/developers/views/default/developers/tree.php b/mod/developers/views/default/developers/tree.php
new file mode 100644
index 000000000..a8e47333b
--- /dev/null
+++ b/mod/developers/views/default/developers/tree.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Displays a tree for inspection
+ *
+ * @uses $vars['tree']
+ */
+
+echo "<ul>";
+foreach ($vars['tree'] as $key => $arr) {
+ echo "<li><a>$key</a>";
+ echo "<ul>";
+ foreach ($arr as $value) {
+ echo "<li><a>$value</a></li>";
+ }
+ echo "</ul>";
+ echo "</li>";
+}
+echo "</ul>";
diff --git a/mod/developers/views/default/forms/developers/inspect.php b/mod/developers/views/default/forms/developers/inspect.php
new file mode 100644
index 000000000..a1b433fea
--- /dev/null
+++ b/mod/developers/views/default/forms/developers/inspect.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Configuration inspection form
+ */
+
+echo '<div>';
+echo '<p>' . elgg_echo('developers:inspect:help') . '</p>';
+
+echo elgg_view('input/dropdown', array(
+ 'name' => 'inspect_type',
+ 'options_values' => array(
+ 'Actions' => 'Actions',
+ 'Events' => 'Events',
+ 'Plugin Hooks' => 'Plugin Hooks',
+ 'Simple Cache' => 'Simple Cache',
+ 'Views' => 'Views',
+ 'Web Services' => 'Web Services',
+ 'Widgets' => 'Widgets',
+ ),
+));
+
+echo elgg_view('input/submit', array('value' => elgg_echo('submit')));
+echo '</div>';
diff --git a/mod/developers/views/default/js/developers/developers.php b/mod/developers/views/default/js/developers/developers.php
new file mode 100644
index 000000000..e6c249eb1
--- /dev/null
+++ b/mod/developers/views/default/js/developers/developers.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Elgg developers tool JavaScript
+ */
+?>
+
+elgg.provide('elgg.dev');
+
+elgg.dev.init = function() {
+ $('.developers-form-inspect').live('submit', elgg.dev.inspectSubmit);
+}
+
+/**
+ * Submit the inspect form through Ajax
+ *
+ * Requires the jQuery Form Plugin.
+ *
+ * @param {Object} event
+ */
+elgg.dev.inspectSubmit = function(event) {
+
+ $("#developers-inspect-results").hide();
+ $("#developers-ajax-loader").show();
+
+ $(this).ajaxSubmit({
+ success : function(response) {
+ if (response) {
+ $("#developers-inspect-results").html(response.output);
+ $("#developers-inspect-results").jstree({
+ "plugins" : [ "themes", "html_data" ],
+ "themes" : {"icons" : false}
+ }).bind("loaded.jstree", function() {
+ $("#developers-inspect-results").fadeIn();
+ $("#developers-ajax-loader").hide();
+ });
+ }
+ }
+ });
+
+ event.preventDefault();
+}
+
+elgg.register_hook_handler('init', 'system', elgg.dev.init); \ No newline at end of file