aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-29 02:30:15 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-29 02:30:15 +0000
commit13a495664c79037557e6c5ea7c3e442be0523139 (patch)
tree35d83ec7008d10670fad0dca5e94e3b243beaad2 /mod/logbrowser/views
parent855b008013aad0426ab0332b040bddb033bb6af9 (diff)
downloadelgg-13a495664c79037557e6c5ea7c3e442be0523139.tar.gz
elgg-13a495664c79037557e6c5ea7c3e442be0523139.tar.bz2
Cleaned up the log browser plugin
git-svn-id: http://code.elgg.org/elgg/trunk@7467 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/logbrowser/views')
-rw-r--r--mod/logbrowser/views/default/admin/overview/logbrowser.php20
-rw-r--r--mod/logbrowser/views/default/logbrowser/adminlinks.php10
-rw-r--r--mod/logbrowser/views/default/logbrowser/css.php42
-rw-r--r--mod/logbrowser/views/default/logbrowser/form.php14
-rw-r--r--mod/logbrowser/views/default/logbrowser/table.php72
-rw-r--r--mod/logbrowser/views/default/object/logwrapper.php48
6 files changed, 124 insertions, 82 deletions
diff --git a/mod/logbrowser/views/default/admin/overview/logbrowser.php b/mod/logbrowser/views/default/admin/overview/logbrowser.php
index 5ff3df096..373e48a49 100644
--- a/mod/logbrowser/views/default/admin/overview/logbrowser.php
+++ b/mod/logbrowser/views/default/admin/overview/logbrowser.php
@@ -1,6 +1,8 @@
<?php
/**
- * Elgg log browser.
+ * Elgg log browser admin page
+ *
+ * @note The ElggObject this creates for each entry is temporary
*
* @package ElggLogBrowser
*/
@@ -43,23 +45,21 @@ $form = elgg_view('logbrowser/form', array(
// Get log entries
$log = get_system_log($user, "", "", "","", $limit, $offset, false, $timeupper, $timelower);
$count = get_system_log($user, "", "", "","", $limit, $offset, true, $timeupper, $timelower);
-$log_entries = array();
-foreach ($log as $l) {
- $tmp = new ElggObject();
- $tmp->subtype = 'logwrapper';
- $tmp->entry = $l;
- $log_entries[] = $tmp;
-}
+$table = elgg_view('logbrowser/table', array('log_entries' => $log));
-$list = elgg_view_entity_list($log_entries, $count, $offset, $limit, false, false);
+$nav = elgg_view('navigation/pagination',array(
+ 'offset' => $offset,
+ 'count' => $count,
+ 'limit' => $limit,
+));
// display admin body
$body = <<<__HTML
$title
$form
<div class="admin_settings log_browser radius8 clearfix">
- $list
+ $nav $table $nav
</div>
__HTML;
diff --git a/mod/logbrowser/views/default/logbrowser/adminlinks.php b/mod/logbrowser/views/default/logbrowser/adminlinks.php
index c52419c89..03e42fbb8 100644
--- a/mod/logbrowser/views/default/logbrowser/adminlinks.php
+++ b/mod/logbrowser/views/default/logbrowser/adminlinks.php
@@ -1,4 +1,10 @@
<?php
-
+/**
+ * The dropdown link for exploring a user's log
+ *
+ * @package ElggLogBrowser
+ */
?>
-<a href="<?php echo elgg_get_site_url(); ?>mod/logbrowser/?user_guid=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("logbrowser:explore"); ?></a> \ No newline at end of file
+<a href="<?php echo elgg_get_site_url(); ?>pg/admin/overview/logbrowser/?user_guid=<?php echo $vars['entity']->guid; ?>">
+ <?php echo elgg_echo("logbrowser:explore"); ?>
+</a> \ No newline at end of file
diff --git a/mod/logbrowser/views/default/logbrowser/css.php b/mod/logbrowser/views/default/logbrowser/css.php
index 1612bff99..5e2f4e168 100644
--- a/mod/logbrowser/views/default/logbrowser/css.php
+++ b/mod/logbrowser/views/default/logbrowser/css.php
@@ -1,10 +1,9 @@
<?php
-
- /**
- * Elgg logbrowser CSS
- *
- * @package logbrowser
- */
+/**
+ * Elgg logbrowser CSS
+ *
+ * @package ElggLogBrowser
+ */
?>
#logbrowser_search_area {
@@ -22,27 +21,30 @@
padding-bottom:7px;
}
.log_entry {
- width: 710px;
- font-size: 80%;
- background:white;
- margin:0 10px 5px 10px;
- border:1px solid white;
+ margin: 5px;
}
-.log_entry:hover {
- background-color: #eeeeee;
- border:1px solid #666666;
+.log_entry td, th {
+ padding: 4px 8px;
+ background: white;
+ border: 1px solid #cccccc;
}
-.log_entry td {
+.log_entry th {
+ background-color: #dddddd;
}
-.log_entry_user {
- width: 120px;
+.log_entry .alt td {
+ background: #eeeeee;
}
.log_entry_time {
width: 210px;
- padding:2px;
}
-.log_entry_item {
-
+.log_entry_user {
+ width: 120px;
+}
+.log_entry_guid {
+ width: 80px;
+}
+.log_entry_object {
+ width: 120px;
}
.log_entry_action {
width: 75px;
diff --git a/mod/logbrowser/views/default/logbrowser/form.php b/mod/logbrowser/views/default/logbrowser/form.php
index c87b67703..7f52d04c9 100644
--- a/mod/logbrowser/views/default/logbrowser/form.php
+++ b/mod/logbrowser/views/default/logbrowser/form.php
@@ -1,3 +1,10 @@
+<?php
+/**
+ * Log browser search form
+ *
+ * @package ElggLogBrowser
+ */
+?>
<div id="logbrowser_search_area">
<?php
@@ -46,12 +53,15 @@
$wrappedform = elgg_view('input/form', array(
'body' => $form,
'method' => 'get',
- 'action' => "pg/admin/logbrowser",
+ 'action' => "pg/admin/overview/logbrowser/",
+ 'disable_security' => true,
));
?>
<div id="log_browser_search_form" class="hidden radius8"><?php echo $wrappedform; ?></div>
<p>
- <a class="link" onclick="elgg_slide_toggle(this,'#logbrowser_search_area','#log_browser_search_form');"><?php echo elgg_echo('logbrowser:search'); ?></a>
+ <a class="link" onclick="elgg_slide_toggle(this,'#logbrowser_search_area','#log_browser_search_form');">
+ <?php echo elgg_echo('logbrowser:search'); ?>
+ </a>
</p>
</div> \ No newline at end of file
diff --git a/mod/logbrowser/views/default/logbrowser/table.php b/mod/logbrowser/views/default/logbrowser/table.php
new file mode 100644
index 000000000..77de5dcaa
--- /dev/null
+++ b/mod/logbrowser/views/default/logbrowser/table.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Log browser table
+ *
+ * @package ElggLogBrowser
+ */
+
+$log_entries = $vars['log_entries'];
+?>
+
+<table class="log_entry">
+ <tr>
+ <th><?php echo elgg_echo('logbrowser:date'); ?></th>
+ <th><?php echo elgg_echo('logbrowser:user:name'); ?></th>
+ <th><?php echo elgg_echo('logbrowser:user:guid'); ?></th>
+ <th><?php echo elgg_echo('logbrowser:object'); ?></th>
+ <th><?php echo elgg_echo('logbrowser:object:guid'); ?></th>
+ <th><?php echo elgg_echo('logbrowser:action'); ?></th>
+ </tr>
+<?php
+ $alt = '';
+ foreach ($log_entries as $entry) {
+ $user = get_entity($entry->performed_by_guid);
+ if ($user) {
+ $user_link = elgg_view('output/url', array(
+ 'href' => $user->getURL(),
+ 'text' => $user->name
+ ));
+ $user_guid_link = elgg_view('output/url', array(
+ 'href' => elgg_get_site_url() . "pg/admin/overview/logbrowser/?user_guid=$user->guid",
+ 'text' => $user->getGUID()
+ ));
+ } else {
+ $user_guid_link = $user_link = '&nbsp;';
+ }
+
+ $object = get_object_from_log_entry($entry->id);
+ if (is_callable(array($object, 'getURL'))) {
+ $object_link = elgg_view('output/url', array(
+ 'href' => $object->getURL(),
+ 'text' => $entry->object_class
+ ));
+ } else {
+ $object_link = $entry->object_class;
+ }
+?>
+ <tr <?php echo $alt; ?>>
+ <td class="log_entry_time">
+ <?php echo date('r', $entry->time_created); ?>
+ </td>
+ <td class="log_entry_user">
+ <?php echo $user_link; ?>
+ </td>
+ <td class="log_entry_guid">
+ <?php echo $user_guid_link; ?>
+ </td>
+ <td class="log_entry_object">
+ <?php echo $object_link; ?>
+ </td>
+ <td class="log_entry_guid">
+ <?php echo $entry->object_id; ?>
+ </td>
+ <td class="log_entry_action">
+ <?php echo elgg_echo($entry->event); ?>
+ </td>
+ </tr>
+<?php
+
+ $alt = $alt ? '' : 'class="alt"';
+ }
+?>
+</table> \ No newline at end of file
diff --git a/mod/logbrowser/views/default/object/logwrapper.php b/mod/logbrowser/views/default/object/logwrapper.php
deleted file mode 100644
index 12d34dfd1..000000000
--- a/mod/logbrowser/views/default/object/logwrapper.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
- /**
- * Elgg log browser.
- *
- * @package ElggLogBrowser
-
-
- */
-
- $entry = $vars['entity']->entry;
-
- $by = get_entity($entry->performed_by_guid);
- $object = get_object_from_log_entry($entry->id);
-
- if (is_callable(array($object, 'getURL')))
- $obj_url = $object->getURL();
-
- //echo elgg_view_listing($icon, $info);
-?>
- <table class="log_entry">
- <tr>
- <td class="log_entry_time">
- <?php echo date('r', $entry->time_created ); ?>
- </td>
- <td class="log_entry_user">
- <?php if ($by) {
- echo "<a href=\"".$by->getURL()."\">{$by->name}</a>";
- echo " <a href=\"?user_guid={$by->guid}\">" . $by->guid . "</a>";
- }
- else echo "&nbsp;"; ?>
- <td>
- <td class="log_entry_item">
- <?php
- if ($obj_url) echo "<a href=\"$obj_url\">";
- echo "{$entry->object_class}";
- if ($obj_url) echo "</a>";
- echo " " . $entry->object_id;
-
- ?>
- </td>
- <td class="log_entry_action">
- <div class="log_entry_action_<?php echo $entry->event; ?>">
- <?php echo elgg_echo($entry->event); ?>
- </div>
- </td>
- </tr>
- </table>
- \ No newline at end of file