diff options
Diffstat (limited to 'mod/logbrowser/views/default/logbrowser')
-rw-r--r-- | mod/logbrowser/views/default/logbrowser/refine.php | 40 | ||||
-rw-r--r-- | mod/logbrowser/views/default/logbrowser/table.php | 90 |
2 files changed, 130 insertions, 0 deletions
diff --git a/mod/logbrowser/views/default/logbrowser/refine.php b/mod/logbrowser/views/default/logbrowser/refine.php new file mode 100644 index 000000000..b40f23fa3 --- /dev/null +++ b/mod/logbrowser/views/default/logbrowser/refine.php @@ -0,0 +1,40 @@ +<?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', +)); + +$form_class = 'elgg-module elgg-module-inline'; +if (!isset($vars['user_guid']) && !isset($vars['username'])) { + $form_class .= ' hidden'; +} + +?> + +<div id="logbrowser-search-area" class="mbm"> + <div> + <?php echo $toggle_link; ?> + </div> + <div id="log-browser-search-form" class="<?php echo $form_class; ?>"> + <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 new file mode 100644 index 000000000..b08a0c428 --- /dev/null +++ b/mod/logbrowser/views/default/logbrowser/table.php @@ -0,0 +1,90 @@ +<?php +/** + * Log browser table + * + * @package ElggLogBrowser + */ + +$log_entries = $vars['log_entries']; +?> + +<table class="elgg-table"> + <tr> + <th><?php echo elgg_echo('logbrowser:date'); ?></th> + <th><?php echo elgg_echo('logbrowser:ip_address'); ?></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) { + if ($entry->ip_address) { + $ip_address = $entry->ip_address; + } else { + $ip_address = ' '; + } + + $user = get_entity($entry->performed_by_guid); + if ($user) { + $user_link = elgg_view('output/url', array( + 'href' => $user->getURL(), + 'text' => $user->name, + 'is_trusted' => true, + )); + $user_guid_link = elgg_view('output/url', array( + 'href' => "admin/administer_utilities/logbrowser?user_guid={$user->guid}", + 'text' => $user->getGUID(), + 'is_trusted' => true, + )); + } else { + $user_guid_link = $user_link = ' '; + } + + $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, + 'is_trusted' => true, + )); + } 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-ip-address"> + <?php echo $ip_address; ?> + </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> +<?php +if (!$log_entries) { + echo elgg_echo('logbrowser:no_result'); + return true; +} |