diff options
Diffstat (limited to 'mod/logbrowser')
-rw-r--r-- | mod/logbrowser/languages/en.php | 2 | ||||
-rw-r--r-- | mod/logbrowser/manifest.xml | 7 | ||||
-rw-r--r-- | mod/logbrowser/start.php | 2 | ||||
-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.php | 53 | ||||
-rw-r--r-- | mod/logbrowser/views/default/logbrowser/form.php | 76 | ||||
-rw-r--r-- | mod/logbrowser/views/default/logbrowser/refine.php | 35 | ||||
-rw-r--r-- | mod/logbrowser/views/default/logbrowser/table.php | 9 |
8 files changed, 101 insertions, 87 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/manifest.xml b/mod/logbrowser/manifest.xml index 585288912..4527e2cbb 100644 --- a/mod/logbrowser/manifest.xml +++ b/mod/logbrowser/manifest.xml @@ -8,11 +8,10 @@ <description>Browse the system event log</description> <website>http://www.elgg.org/</website> <copyright>See COPYRIGHT.txt</copyright> - <license>GNU Public License version 2</license> + <license>GNU General Public License version 2</license> <requires> - <type>elgg_version</type> - <version>2009030702</version> + <type>elgg_release</type> + <version>1.8</version> </requires> <activate_on_install>true</activate_on_install> - <admin_interface>advanced</admin_interface> </plugin_manifest> diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php index 71b6115a5..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'); } /** 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 2cb746eac..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/utilities/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 diff --git a/mod/logbrowser/views/default/logbrowser/table.php b/mod/logbrowser/views/default/logbrowser/table.php index 86c8a1423..b7f6a1f20 100644 --- a/mod/logbrowser/views/default/logbrowser/table.php +++ b/mod/logbrowser/views/default/logbrowser/table.php @@ -24,11 +24,13 @@ $log_entries = $vars['log_entries']; if ($user) { $user_link = elgg_view('output/url', array( 'href' => $user->getURL(), - 'text' => $user->name + 'text' => $user->name, + 'is_trusted' => true, )); $user_guid_link = elgg_view('output/url', array( 'href' => "admin/overview/logbrowser?user_guid=$user->guid", - 'text' => $user->getGUID() + 'text' => $user->getGUID(), + 'is_trusted' => true, )); } else { $user_guid_link = $user_link = ' '; @@ -38,7 +40,8 @@ $log_entries = $vars['log_entries']; if (is_callable(array($object, 'getURL'))) { $object_link = elgg_view('output/url', array( 'href' => $object->getURL(), - 'text' => $entry->object_class + 'text' => $entry->object_class, + 'is_trusted' => true, )); } else { $object_link = $entry->object_class; |