diff options
Diffstat (limited to 'mod/logbrowser/views')
-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 |
4 files changed, 90 insertions, 78 deletions
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 |