diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-07 10:23:38 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-07 10:23:38 +0000 |
commit | a65cdd21f234c8a07c90e54f9e9a0b1f33a972c2 (patch) | |
tree | a462d06cc0f34b56d547b07c5df3005b10260d1b | |
parent | f4ac146f927ff75822baadbb15f1beea89eaace6 (diff) | |
download | elgg-a65cdd21f234c8a07c90e54f9e9a0b1f33a972c2.tar.gz elgg-a65cdd21f234c8a07c90e54f9e9a0b1f33a972c2.tar.bz2 |
Initial changes to log browser
git-svn-id: https://code.elgg.org/elgg/trunk@1745 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | mod/logbrowser/index.php | 17 | ||||
-rw-r--r-- | mod/logbrowser/start.php | 2 | ||||
-rw-r--r-- | mod/logbrowser/views/default/logbrowser/gallery.php | 34 | ||||
-rw-r--r-- | mod/logbrowser/views/default/logbrowser/listing.php | 40 | ||||
-rw-r--r-- | mod/logbrowser/views/default/object/logwrapper.php | 61 |
5 files changed, 56 insertions, 98 deletions
diff --git a/mod/logbrowser/index.php b/mod/logbrowser/index.php index c548e450b..d0a6b7852 100644 --- a/mod/logbrowser/index.php +++ b/mod/logbrowser/index.php @@ -14,14 +14,21 @@ admin_gatekeeper(); set_context('admin');
- $limit = get_input('limit', 10); + $limit = get_input('limit', 40); $offset = get_input('offset'); +
+ $user_guid = get_input('user_guid',0);
+ if ($user_guid) {
+ $user = (int) $user_guid;
+ } else {
+ $user = "";
+ }
$title = elgg_view_title(elgg_echo('logbrowser')); // Get log entries - $log = get_system_log("", "","",$limit, $offset); - $count = get_system_log("", "","",$limit, $offset, true); + $log = get_system_log($user, "", "", $limit, $offset); + $count = get_system_log($user, "", "", $limit, $offset, true); $log_entries = array(); foreach ($log as $l) @@ -32,10 +39,10 @@ $log_entries[] = $tmp; } set_context('search'); - $result = elgg_view_entity_list($log_entries, $count, $offset, $limit, false);#
+ $result = elgg_view_entity_list($log_entries, $count, $offset, $limit, false, false);
set_context('admin'); // Display main admin menu - page_draw($title,elgg_view_layout("two_column_left_sidebar", '', $title.$result)); + page_draw(elgg_echo('logbrowser'),elgg_view_layout("two_column_left_sidebar", '', $title.$result)); ?>
\ No newline at end of file diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php index f7b9c97c1..4a3b5916a 100644 --- a/mod/logbrowser/start.php +++ b/mod/logbrowser/start.php @@ -29,7 +29,7 @@ {
if (get_context() == 'admin' && isadminloggedin()) {
global $CONFIG;
- add_submenu_item(elgg_echo('logbrowser:browser'), $CONFIG->wwwroot . 'pg/logbrowser/');
+ add_submenu_item(elgg_echo('logbrowser'), $CONFIG->wwwroot . 'pg/logbrowser/');
}
} diff --git a/mod/logbrowser/views/default/logbrowser/gallery.php b/mod/logbrowser/views/default/logbrowser/gallery.php deleted file mode 100644 index fb3a7537d..000000000 --- a/mod/logbrowser/views/default/logbrowser/gallery.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - /** - * Elgg log browser. - * - * @package ElggLogBrowser - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Marcus Povey - * @copyright Curverider Ltd 2008 - * @link http://elgg.com/ - */ - - $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(); - - - $info .= "<p><b>"; - if ($obj_url) $info .= "<a href=\"$obj_url\">"; - $info .= "{$entry->object_class}"; - if ($obj_url) $info .= "</a>"; - $info .= " " . elgg_echo($entry->event) . "</b></p>"; - - - $info .= "<div>"; - if ($by) $info .= elgg_echo('by') . " <a href=\"".$by->getURL()."\">{$by->name}</a> "; - $info .= " " .date('r', $entry->time_created )."</div>"; - - echo elgg_view_listing($icon, $info); -?>
\ No newline at end of file diff --git a/mod/logbrowser/views/default/logbrowser/listing.php b/mod/logbrowser/views/default/logbrowser/listing.php deleted file mode 100644 index 9550dba2e..000000000 --- a/mod/logbrowser/views/default/logbrowser/listing.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - /** - * Elgg log browser. - * - * @package ElggLogBrowser - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Marcus Povey - * @copyright Curverider Ltd 2008 - * @link http://elgg.com/ - */ - - $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(); - - $icon = elgg_view( - "graphics/icon", array( - 'entity' => $vars['entity'], - 'size' => 'small', - ) - ); - - $info .= "<p><b>"; - if ($obj_url) $info .= "<a href=\"$obj_url\">"; - $info .= "{$entry->object_class}"; - if ($obj_url) $info .= "</a>"; - $info .= " " . elgg_echo($entry->event) . "</b></p>"; - - - $info .= "<div>"; - if ($by) $info .= elgg_echo('by') . " <a href=\"".$by->getURL()."\">{$by->name}</a> "; - $info .= " " .date('r', $entry->time_created )."</div>"; - - echo elgg_view_listing($icon, $info); -?>
\ No newline at end of file diff --git a/mod/logbrowser/views/default/object/logwrapper.php b/mod/logbrowser/views/default/object/logwrapper.php index 673d732e8..8450c9b66 100644 --- a/mod/logbrowser/views/default/object/logwrapper.php +++ b/mod/logbrowser/views/default/object/logwrapper.php @@ -1,18 +1,43 @@ -<?php - /** - * Elgg log browser. - * - * @package ElggLogBrowser - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Marcus Povey - * @copyright Curverider Ltd 2008 - * @link http://elgg.com/ - */ - - if (get_input('search_viewtype') == "gallery") { - echo elgg_view('logbrowser/gallery',$vars); - } else { - echo elgg_view("logbrowser/listing",$vars); - } - -?>
\ No newline at end of file +<?php
+ /**
+ * Elgg log browser.
+ *
+ * @package ElggLogBrowser
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ $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_user">
+ <?php if ($by) {echo "<a href=\"".$by->getURL()."\">{$by->name}</a>"; } else echo " "; ?>
+ <td>
+ <td class="log_entry_time">
+ <?php echo date('r', $entry->time_created ); ?>
+ </td>
+ <td class="log_entry_item">
+ <?php
+ if ($obj_url) $info .= "<a href=\"$obj_url\">";
+ $info .= "{$entry->object_class}";
+ if ($obj_url) $info .= "</a>";
+ ?>
+ </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 |