Skip to content
Permalink
Browse files

feature(developers): improved readability of inspect pages

Switched to a table layout instead of jsTree representation. Leaves
jsTree in place for backwards compatibility

Fixes #6484
  • Loading branch information...
jdalsem authored and mrclay committed Dec 15, 2014
1 parent 9a54746 commit a3e7f09d016db2ea0027266fec95eaa1cec69a07
@@ -37,6 +37,17 @@
// inspection
'developers:inspect:help' => 'Inspect configuration of the Elgg framework.',
'developers:inspect:actions' => 'Actions',
'developers:inspect:events' => 'Events',
'developers:inspect:menus' => 'Menus',
'developers:inspect:pluginhooks' => 'Plugin Hooks',
'developers:inspect:simplecache' => 'Simple Cache',
'developers:inspect:views' => 'Views',
'developers:inspect:widgets' => 'Widgets',
'developers:inspect:webservices' => 'Webservices',
'developers:inspect:widgets:context' => 'Context',
'developers:inspect:functions' => 'Functions',
'developers:inspect:file_location' => 'File location',
// event logging
'developers:event_log_msg' => "%s: '%s, %s' in %s",
@@ -81,7 +81,7 @@ function developers_setup_menu() {
foreach ($inspect_options as $key => $value) {
elgg_register_menu_item('page', array(
'name' => 'dev_inspect_' . elgg_get_friendly_title($key),
'href' => "admin/develop_tools/inspect?inspect_type={$value}",
'href' => "admin/develop_tools/inspect?inspect_type={$key}",
'text' => $value,
'context' => 'admin',
'section' => 'develop',
@@ -246,17 +246,17 @@ function developers_theme_sandbox_controller($page) {
*/
function developers_get_inspect_options() {
$options = array(
'Actions' => 'Actions',
'Events' => 'Events',
'Menus' => 'Menus',
'Plugin Hooks' => 'Plugin Hooks',
'Simple Cache' => 'Simple Cache',
'Views' => 'Views',
'Widgets' => 'Widgets',
'Actions' => elgg_echo('developers:inspect:actions'),
'Events' => elgg_echo('developers:inspect:events'),
'Menus' => elgg_echo('developers:inspect:menus'),
'Plugin Hooks' => elgg_echo('developers:inspect:pluginhooks'),
'Simple Cache' => elgg_echo('developers:inspect:simplecache'),
'Views' => elgg_echo('developers:inspect:views'),
'Widgets' => elgg_echo('developers:inspect:widgets'),
);
if (elgg_is_active_plugin('web_services')) {
$options['Web Services'] = 'Web Services';
$options['Web Services'] = elgg_echo('developers:inspect:webservices');
}
ksort($options);
@@ -5,19 +5,16 @@
* Inspect global variables of Elgg
*/
elgg_load_js('jquery.jstree');
elgg_load_css('jquery.jstree');
$inspect_type = get_input('inspect_type');
$method = 'get' . str_replace(' ', '', $inspect_type);
$inspector = new ElggInspector();
$inspect_result = '';
if ($inspector && method_exists($inspector, $method)) {
$tree = $inspector->$method();
$inspect_result = elgg_view('developers/tree', array('tree' => $tree));
$data = $inspector->$method();
}
echo '<p>' . elgg_echo('developers:inspect:help') . '</p>';
echo "<div id=\"developers-inspect-results\" class=\"hidden\">{$inspect_result}</div>";
$view_name = strtolower(str_replace(' ', '', $inspect_type));
echo elgg_view("admin/develop_tools/inspect/$view_name", array("data" => $data));
@@ -0,0 +1,24 @@
<?php
$data = elgg_extract("data", $vars);
if (empty($data)) {
return;
}
echo "<table class='elgg-table-alt'>";
echo "<tr>";
echo "<th>" . elgg_echo('developers:inspect:actions') . "</th>";
echo "<th>" . elgg_echo('developers:inspect:file_location') . "</th>";
echo "<th>" . elgg_echo('access') . "</th>";
echo "</tr>";
foreach ($data as $key => $arr) {
echo "<tr>";
echo "<td>$key</td>";
echo "<td>{$arr[0]}</td>";
echo "<td>{$arr[1]}</td>";
echo "</tr>";
}
echo "</table>";
@@ -0,0 +1,26 @@
<?php
$data = elgg_extract("data", $vars);
if (empty($data)) {
return;
}
echo "<table class='elgg-table-alt'>";
echo "<tr>";
echo "<th>" . elgg_echo('developers:inspect:events') . "</th>";
echo "<th>" . elgg_echo('developers:inspect:functions') . "</th>";
echo "</tr>";
foreach ($data as $key => $arr) {
echo "<tr>";
echo "<td>$key</td>";
echo "<td><ul>";
foreach ($arr as $subkey => $value) {
echo "<li>$value</li>";
}
echo "</ul></td>";
echo "</tr>";
}
echo "</table>";
@@ -0,0 +1,29 @@
<?php
$data = elgg_extract("data", $vars);
if (empty($data)) {
return;
}
foreach ($data as $key => $arr) {
$menu = "<table class='elgg-table-alt'>";
foreach ($arr as $subkey => $value) {
$menu .= "<tr>";
$menu .= "<td>{$subkey}</td>";
$menu .= "<td><ul>";
foreach ($value as $item) {
$menu .= "<li>$item</li>";
}
$menu .= "</ul></td>";
$menu .= "</tr>";
}
$menu .= "</table>";
echo elgg_view_module("inline", $key, $menu);
}
@@ -0,0 +1,26 @@
<?php
$data = elgg_extract("data", $vars);
if (empty($data)) {
return;
}
echo "<table class='elgg-table-alt'>";
echo "<tr>";
echo "<th>" . elgg_echo('developers:inspect:pluginhooks') . "</th>";
echo "<th>" . elgg_echo('developers:inspect:functions') . "</th>";
echo "</tr>";
foreach ($data as $key => $arr) {
echo "<tr>";
echo "<td>$key</td>";
echo "<td><ul>";
foreach ($arr as $subkey => $value) {
echo "<li>$value</li>";
}
echo "</ul></td>";
echo "</tr>";
}
echo "</table>";
@@ -0,0 +1,20 @@
<?php
$data = elgg_extract("data", $vars);
if (empty($data)) {
return;
}
echo "<table class='elgg-table-alt'>";
echo "<tr>";
echo "<th>" . elgg_echo('developers:inspect:simplecache') . "</th>";
echo "</tr>";
foreach ($data as $key => $arr) {
echo "<tr>";
echo "<td>$key</td>";
echo "</tr>";
}
echo "</table>";
@@ -0,0 +1,22 @@
<?php
$data = elgg_extract("data", $vars);
if (empty($data)) {
return;
}
echo "<table class='elgg-table-alt'>";
echo "<tr>";
echo "<th>" . elgg_echo('developers:inspect:views') . "</th>";
echo "<th>" . elgg_echo('developers:inspect:file_location') . "</th>";
echo "</tr>";
foreach ($data as $key => $arr) {
echo "<tr>";
echo "<td>$key</td>";
echo "<td>{$arr[0]}</td>";
echo "</tr>";
}
echo "</table>";
@@ -0,0 +1,26 @@
<?php
$data = elgg_extract("data", $vars);
if (empty($data)) {
return;
}
echo "<table class='elgg-table-alt'>";
echo "<tr>";
echo "<th>" . elgg_echo('developers:inspect:webservices') . "</th>";
echo "<th>&nbsp;</th>";
echo "</tr>";
foreach ($data as $key => $arr) {
echo "<tr>";
echo "<td>$key</td>";
echo "<td><ul>";
foreach ($arr as $subkey => $value) {
echo "<li>$value</li>";
}
echo "</ul></td>";
echo "</tr>";
}
echo "</table>";
@@ -0,0 +1,24 @@
<?php
$data = elgg_extract("data", $vars);
if (empty($data)) {
return;
}
echo "<table class='elgg-table-alt'>";
echo "<tr>";
echo "<th>" . elgg_echo('developers:inspect:widgets') . "</th>";
echo "<th>" . elgg_echo('title') . "</th>";
echo "<th>" . elgg_echo('developers:inspect:widgets:context') . "</th>";
echo "</tr>";
foreach ($data as $key => $arr) {
echo "<tr>";
echo "<td>$key</td>";
echo "<td>{$arr[0]}</td>";
echo "<td>{$arr[1]}</td>";
echo "</tr>";
}
echo "</table>";

This file was deleted.

0 comments on commit a3e7f09

Please sign in to comment.
You can’t perform that action at this time.