aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-09-29 18:16:03 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-09-29 18:16:03 -0700
commitbfdb9bb8a87a29038ba1ae25355684ae19678fdd (patch)
treea074e2d6bfa19c17b284c3950b4555cf584eabe2 /mod/logbrowser
parent7be23080f34a8f92ca1f8d49c3aa0e6ce3472f4c (diff)
parenta458ae4e0f8e5b19884860fead6e5f901b95eca4 (diff)
downloadelgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.gz
elgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.bz2
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'mod/logbrowser')
-rw-r--r--mod/logbrowser/languages/en.php2
-rw-r--r--mod/logbrowser/start.php4
-rw-r--r--mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php (renamed from mod/logbrowser/views/default/admin/utilities/logbrowser.php)4
-rw-r--r--mod/logbrowser/views/default/forms/logbrowser/refine.php53
-rw-r--r--mod/logbrowser/views/default/logbrowser/form.php76
-rw-r--r--mod/logbrowser/views/default/logbrowser/refine.php35
6 files changed, 93 insertions, 81 deletions
diff --git a/mod/logbrowser/languages/en.php b/mod/logbrowser/languages/en.php
index 90689a1b0..3b6ead272 100644
--- a/mod/logbrowser/languages/en.php
+++ b/mod/logbrowser/languages/en.php
@@ -6,7 +6,7 @@
*/
$english = array(
- 'admin:utilities:logbrowser' => 'Log browser',
+ 'admin:administer_utilities:logbrowser' => 'Log browser',
'logbrowser' => 'Log browser',
'logbrowser:browse' => 'Browse system log',
'logbrowser:search' => 'Refine results',
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
index eedc9d8ad..3bffe800a 100644
--- a/mod/logbrowser/start.php
+++ b/mod/logbrowser/start.php
@@ -14,7 +14,7 @@ function logbrowser_init() {
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'logbrowser_user_hover_menu');
- elgg_register_admin_menu_item('administer', 'logbrowser', 'utilities');
+ elgg_register_admin_menu_item('administer', 'logbrowser', 'administer_utilities');
}
/**
@@ -23,7 +23,7 @@ function logbrowser_init() {
function logbrowser_user_hover_menu($hook, $type, $return, $params) {
$user = $params['entity'];
- $url = "admin/overview/logbrowser?user_guid={$user->guid}";
+ $url = "admin/utilities/logbrowser?user_guid={$user->guid}";
$item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url);
$item->setSection('admin');
$return[] = $item;
diff --git a/mod/logbrowser/views/default/admin/utilities/logbrowser.php b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php
index dadc6cda3..2be1f33dc 100644
--- a/mod/logbrowser/views/default/admin/utilities/logbrowser.php
+++ b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php
@@ -34,7 +34,7 @@ if ($timeupper) {
$timeupper = strtotime($timeupper);
}
-$form = elgg_view('logbrowser/form', array(
+$refine = elgg_view('logbrowser/refine', array(
'user_guid' => $user,
'timeupper' => $timeupper,
'timelower' => $timelower,
@@ -54,7 +54,7 @@ $nav = elgg_view('navigation/pagination',array(
// display admin body
$body = <<<__HTML
-$form
+$refine
$nav
$table
$nav
diff --git a/mod/logbrowser/views/default/forms/logbrowser/refine.php b/mod/logbrowser/views/default/forms/logbrowser/refine.php
new file mode 100644
index 000000000..ff3f48b03
--- /dev/null
+++ b/mod/logbrowser/views/default/forms/logbrowser/refine.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Form body for refining the log browser search.
+ * Look for a particular person or in a time window.
+ *
+ * @uses $vars['user_guid']
+ * @uses $vars['timelower']
+ * @uses $vars['timeupper']
+ */
+
+if (isset($vars['timelower'])) {
+ $lowerval = date('r',$vars['timelower']);
+} else {
+ $lowerval = "";
+}
+if (isset($vars['timeupper'])) {
+ $upperval = date('r',$vars['timeupper']);
+} else {
+ $upperval = "";
+}
+if (isset($vars['user_guid'])) {
+ if ($user = get_entity($vars['user_guid'])) {
+ $userval = $user->username;
+ }
+} else {
+ $userval = "";
+}
+
+
+$form = "<div>" . elgg_echo('logbrowser:user');
+$form .= elgg_view('input/text', array(
+ 'name' => 'search_username',
+ 'value' => $userval,
+)) . "</div>";
+
+$form .= "<div>" . elgg_echo('logbrowser:starttime');
+$form .= elgg_view('input/text', array(
+ 'name' => 'timelower',
+ 'value' => $lowerval,
+)) . "</div>";
+
+$form .= "<div>" . elgg_echo('logbrowser:endtime');
+$form .= elgg_view('input/text', array(
+ 'name' => 'timeupper',
+ 'value' => $upperval,
+)) . "</div>";
+$form .= '<div class="elgg-foot">';
+$form .= elgg_view('input/submit', array(
+ 'value' => elgg_echo('search'),
+));
+$form .= '</div>';
+
+echo $form;
diff --git a/mod/logbrowser/views/default/logbrowser/form.php b/mod/logbrowser/views/default/logbrowser/form.php
deleted file mode 100644
index d5cf9f6b8..000000000
--- a/mod/logbrowser/views/default/logbrowser/form.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-/**
- * Log browser search form
- *
- * @package ElggLogBrowser
- */
-?>
-
-<div id="logbrowser-search-area">
-<?php
-
- if ($vars['timelower']) {
- $lowerval = date('r',$vars['timelower']);
- } else {
- $lowerval = "";
- }
- if ($vars['timeupper']) {
- $upperval = date('r',$vars['timeupper']);
- } else {
- $upperval = "";
- }
- if ($vars['user_guid']) {
- if ($user = get_entity($vars['user_guid']))
- $userval = $user->username;
- } else {
- $userval = "";
- }
-
-
- $form = "<p>" . elgg_echo('logbrowser:user');
- $form .= elgg_view('input/text', array(
- 'name' => 'search_username',
- 'value' => $userval,
- )) . "</p>";
-
- $form .= "<p>" . elgg_echo('logbrowser:starttime');
- $form .= elgg_view('input/text', array(
- 'name' => 'timelower',
- 'value' => $lowerval,
- )) . "</p>";
-
- $form .= "<p>" . elgg_echo('logbrowser:endtime');
- $form .= elgg_view('input/text', array(
- 'name' => 'timeupper',
- 'value' => $upperval,
- )) . "</p>";
- $form .= elgg_view('input/submit', array(
- 'value' => elgg_echo('search'),
- ));
-
- //@todo Forms 1.8: Convert to use elgg_view_form()
- $wrappedform = elgg_view('input/form', array(
- 'body' => $form,
- 'method' => 'get',
- 'action' => "admin/overview/logbrowser",
- 'disable_security' => true,
- ));
-
- $toggle_link = elgg_view('output/url', array(
- 'href' => '#log-browser-search-form',
- 'text' => elgg_echo('logbrowser:search'),
- 'rel' => 'toggle',
- ));
-?>
- <p>
- <?php echo $toggle_link; ?>
- </p>
- <div id="log-browser-search-form" class="elgg-module elgg-module-inline hidden">
- <div class="elgg-head">
- <h3><?php echo elgg_echo('logbrowser:search'); ?></h3>
- </div>
- <div class="elgg-body">
- <?php echo $wrappedform; ?>
- </div>
- </div>
-</div> \ No newline at end of file
diff --git a/mod/logbrowser/views/default/logbrowser/refine.php b/mod/logbrowser/views/default/logbrowser/refine.php
new file mode 100644
index 000000000..27cb6042f
--- /dev/null
+++ b/mod/logbrowser/views/default/logbrowser/refine.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Log browser search form
+ *
+ * @package ElggLogBrowser
+ */
+
+$form_vars = array(
+ 'method' => 'get',
+ 'action' => 'admin/administer_utilities/logbrowser',
+ 'disable_security' => true,
+);
+$form = elgg_view_form('logbrowser/refine', $form_vars, $vars);
+
+$toggle_link = elgg_view('output/url', array(
+ 'href' => '#log-browser-search-form',
+ 'text' => elgg_echo('logbrowser:search'),
+ 'rel' => 'toggle',
+));
+
+?>
+
+<div id="logbrowser-search-area" class="mbm">
+ <div>
+ <?php echo $toggle_link; ?>
+ </div>
+ <div id="log-browser-search-form" class="elgg-module elgg-module-inline hidden">
+ <div class="elgg-head">
+ <h3><?php echo elgg_echo('logbrowser:search'); ?></h3>
+ </div>
+ <div class="elgg-body">
+ <?php echo $form; ?>
+ </div>
+ </div>
+</div> \ No newline at end of file