diff options
Diffstat (limited to 'views/default/widgets')
| -rw-r--r-- | views/default/widgets/admin_welcome/content.php | 9 | ||||
| -rw-r--r-- | views/default/widgets/content_stats/content.php | 5 | ||||
| -rw-r--r-- | views/default/widgets/control_panel/content.php | 38 | ||||
| -rw-r--r-- | views/default/widgets/friends/content.php | 17 | ||||
| -rw-r--r-- | views/default/widgets/new_users/content.php | 3 | ||||
| -rw-r--r-- | views/default/widgets/online_users/content.php | 11 | ||||
| -rw-r--r-- | views/default/widgets/river_widget/content.php | 8 | ||||
| -rw-r--r-- | views/default/widgets/river_widget/edit.php | 13 |
8 files changed, 83 insertions, 21 deletions
diff --git a/views/default/widgets/admin_welcome/content.php b/views/default/widgets/admin_welcome/content.php index 4ebdb719c..f4b92ea66 100644 --- a/views/default/widgets/admin_welcome/content.php +++ b/views/default/widgets/admin_welcome/content.php @@ -7,16 +7,13 @@ $sections = array( 'intro' => array(), 'admin_overview' => array(), - 'common_links' => array( - elgg_normalize_url('pg/admin/plugins/simple'), - elgg_normalize_url('pg/admin/site/advanced'), - ), - 'external_resources' => array(), 'outro' => array() ); // don't use longtext because it filters output. // that's annoying. +echo '<div class="elgg-output">'; foreach ($sections as $section => $strings) { echo '<p>' . elgg_echo("admin:widget:admin_welcome:$section", $strings) . '</p>'; -}
\ No newline at end of file +} +echo '</div>';
\ No newline at end of file diff --git a/views/default/widgets/content_stats/content.php b/views/default/widgets/content_stats/content.php index 7086e4b9e..56772047d 100644 --- a/views/default/widgets/content_stats/content.php +++ b/views/default/widgets/content_stats/content.php @@ -19,7 +19,10 @@ foreach ($object_stats as $subtype => $num) { } echo '</table>'; +echo '<div class="mtm">'; echo elgg_view('output/url', array( 'href' => 'admin/statistics/overview', - 'text' => 'more', + 'text' => elgg_echo('more'), + 'is_trusted' => true, )); +echo '</div>'; diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php new file mode 100644 index 000000000..a348d612f --- /dev/null +++ b/views/default/widgets/control_panel/content.php @@ -0,0 +1,38 @@ +<?php +/** + * Admin control panel widget + */ + +elgg_register_menu_item('admin_control_panel', array( + 'name' => 'flush', + 'text' => elgg_echo('admin:cache:flush'), + 'href' => 'action/admin/site/flush_cache', + 'is_action' => true, + 'link_class' => 'elgg-button elgg-button-action', +)); + +// @todo Move in this in ElggUpgradeManager::isLocked() when #4682 fixed +$is_locked = _elgg_upgrade_is_locked(); + +if (!$is_locked) { + elgg_register_menu_item('admin_control_panel', array( + 'name' => 'upgrade', + 'text' => elgg_echo('upgrade'), + 'href' => 'upgrade.php', + 'link_class' => 'elgg-button elgg-button-action', + )); +} else { + elgg_register_menu_item('admin_control_panel', array( + 'name' => 'unlock_upgrade', + 'text' => elgg_echo('upgrade:unlock'), + 'href' => 'action/admin/site/unlock_upgrade', + 'is_action' => true, + 'link_class' => 'elgg-button elgg-button-action', + 'confirm' => elgg_echo('upgrade:unlock:confirm'), + )); +} + +echo elgg_view_menu('admin_control_panel', array( + 'class' => 'elgg-menu-hz', + 'item_class' => 'mrm', +)); diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php index 4c5ef5b4a..98814c244 100644 --- a/views/default/widgets/friends/content.php +++ b/views/default/widgets/friends/content.php @@ -13,12 +13,13 @@ $num = (int) $vars['entity']->num_display; // get the correct size $size = $vars['entity']->icon_size; -$html = $owner->listFriends('', $num, array( - 'size' => $size, - 'gallery' => true, -)); -if ($html) { - echo $html; -} else { - +if (elgg_instanceof($owner, 'user')) { + $html = $owner->listFriends('', $num, array( + 'size' => $size, + 'list_type' => 'gallery', + 'pagination' => false + )); + if ($html) { + echo $html; + } } diff --git a/views/default/widgets/new_users/content.php b/views/default/widgets/new_users/content.php index 207a67a9d..ba85e7421 100644 --- a/views/default/widgets/new_users/content.php +++ b/views/default/widgets/new_users/content.php @@ -6,5 +6,6 @@ echo elgg_list_entities(array( 'type' => 'user', 'subtype'=> null, - 'full_view' => FALSE + 'full_view' => false, + 'pagination' => false, ));
\ No newline at end of file diff --git a/views/default/widgets/online_users/content.php b/views/default/widgets/online_users/content.php index d81ff3705..6e0cc7abb 100644 --- a/views/default/widgets/online_users/content.php +++ b/views/default/widgets/online_users/content.php @@ -3,4 +3,13 @@ * Online users widget */ -echo $users_online = get_online_users();
\ No newline at end of file +$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/river_widget/content.php b/views/default/widgets/river_widget/content.php index 427fd92bf..867fc9db6 100644 --- a/views/default/widgets/river_widget/content.php +++ b/views/default/widgets/river_widget/content.php @@ -10,13 +10,13 @@ $options = array( 'pagination' => false, ); -if (elgg_in_context('profile')) { - $options['subject_guid'] = elgg_get_page_owner_guid(); -} else { +if (elgg_in_context('dashboard')) { if ($vars['entity']->content_type == 'friends') { - $options['relationship_guid'] = elgg_get_logged_in_user_guid(); + $options['relationship_guid'] = elgg_get_page_owner_guid(); $options['relationship'] = 'friend'; } +} else { + $options['subject_guid'] = elgg_get_page_owner_guid(); } $content = elgg_list_river($options); diff --git a/views/default/widgets/river_widget/edit.php b/views/default/widgets/river_widget/edit.php index e0351e883..228212e47 100644 --- a/views/default/widgets/river_widget/edit.php +++ b/views/default/widgets/river_widget/edit.php @@ -43,3 +43,16 @@ $num_dropdown = elgg_view('input/dropdown', $params); <?php echo elgg_echo('widget:numbertodisplay'); ?>: <?php echo $num_dropdown; ?> </div> + +<?php +// pass the context so we have the correct output upon save. +if (elgg_in_context('dashboard')) { + $context = 'dashboard'; +} else { + $context = 'profile'; +} + +echo elgg_view('input/hidden', array( + 'name' => 'context', + 'value' => $context +));
\ No newline at end of file |
