aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser/index.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-07 11:23:52 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-07 11:23:52 +0000
commit5028eba1c6087d32ff5db192f12581cfe60a5b87 (patch)
tree55f40226dea46ce9fa09d1343d0422776dd7cb32 /mod/logbrowser/index.php
parent0171329bbf3b881493b5e45b841781ab03442f94 (diff)
downloadelgg-5028eba1c6087d32ff5db192f12581cfe60a5b87.tar.gz
elgg-5028eba1c6087d32ff5db192f12581cfe60a5b87.tar.bz2
The log browser is now searchable.
git-svn-id: https://code.elgg.org/elgg/trunk@1747 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/logbrowser/index.php')
-rw-r--r--mod/logbrowser/index.php31
1 files changed, 23 insertions, 8 deletions
diff --git a/mod/logbrowser/index.php b/mod/logbrowser/index.php
index d0a6b7852..cabcad766 100644
--- a/mod/logbrowser/index.php
+++ b/mod/logbrowser/index.php
@@ -17,18 +17,30 @@
$limit = get_input('limit', 40);
$offset = get_input('offset');
- $user_guid = get_input('user_guid',0);
- if ($user_guid) {
- $user = (int) $user_guid;
+ $search_username = get_input('search_username');
+ if ($search_username) {
+ if ($user = get_user_by_username($search_username)) {
+ $user = $user->guid;
+ }
} else {
- $user = "";
+ $user_guid = get_input('user_guid',0);
+ if ($user_guid) {
+ $user = (int) $user_guid;
+ } else {
+ $user = "";
+ }
}
+
+ $timelower = get_input('timelower');
+ if ($timelower) $timelower = strtotime($timelower);
+ $timeupper = get_input('timeupper');
+ if ($timeupper) $timeupper = strtotime($timeupper);
$title = elgg_view_title(elgg_echo('logbrowser'));
// Get log entries
- $log = get_system_log($user, "", "", $limit, $offset);
- $count = get_system_log($user, "", "", $limit, $offset, true);
+ $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)
@@ -37,12 +49,15 @@
$tmp->subtype = 'logwrapper';
$tmp->entry = $l;
$log_entries[] = $tmp;
- }
+ }
+
+ $form = elgg_view('logbrowser/form',array('user_guid' => $user, 'timeupper' => $timeupper, 'timelower' => $timelower));
+
set_context('search');
$result = elgg_view_entity_list($log_entries, $count, $offset, $limit, false, false);
set_context('admin');
// Display main admin menu
- page_draw(elgg_echo('logbrowser'),elgg_view_layout("two_column_left_sidebar", '', $title.$result));
+ page_draw(elgg_echo('logbrowser'),elgg_view_layout("two_column_left_sidebar", '', $title . $form . $result));
?> \ No newline at end of file