diff options
Diffstat (limited to 'views/default/widgets/online_users')
-rw-r--r-- | views/default/widgets/online_users/content.php | 15 | ||||
-rw-r--r-- | views/default/widgets/online_users/edit.php | 22 |
2 files changed, 37 insertions, 0 deletions
diff --git a/views/default/widgets/online_users/content.php b/views/default/widgets/online_users/content.php new file mode 100644 index 000000000..6e0cc7abb --- /dev/null +++ b/views/default/widgets/online_users/content.php @@ -0,0 +1,15 @@ +<?php +/** + * Online users widget + */ + +$count = find_active_users(600, 10, 0, true); +$objects = find_active_users(600, 10); + +if ($objects) { + echo elgg_view_entity_list($objects, array( + 'count' => $count, + 'limit' => 10, + 'pagination' => false, + )); +} diff --git a/views/default/widgets/online_users/edit.php b/views/default/widgets/online_users/edit.php new file mode 100644 index 000000000..66f03a745 --- /dev/null +++ b/views/default/widgets/online_users/edit.php @@ -0,0 +1,22 @@ +<?php +/** + * Online users widget edit view + */ + +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 8; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$dropdown = elgg_view('input/dropdown', $params); + +?> +<p> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $dropdown; ?> +</p> |