aboutsummaryrefslogtreecommitdiff
path: root/views/default/river/item
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-01 06:38:42 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-01 06:38:42 +0000
commitf68f1d52556f02a85aba9ec8b09ffabbab008446 (patch)
treeff01ad63771dee41e9c5307b4797b79ca3277ada /views/default/river/item
parente8a86a744de1b0285e23eca5ccb4e64ab32f3805 (diff)
downloadelgg-f68f1d52556f02a85aba9ec8b09ffabbab008446.tar.gz
elgg-f68f1d52556f02a85aba9ec8b09ffabbab008446.tar.bz2
Refs #2895: River items now emit a "river" menu. Not confident on the name, just trying to keep things short and sweet.
git-svn-id: http://code.elgg.org/elgg/trunk@8532 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/river/item')
-rw-r--r--views/default/river/item/controls.php31
1 files changed, 15 insertions, 16 deletions
diff --git a/views/default/river/item/controls.php b/views/default/river/item/controls.php
index 9c3305635..32653452b 100644
--- a/views/default/river/item/controls.php
+++ b/views/default/river/item/controls.php
@@ -13,40 +13,39 @@ if (elgg_is_logged_in()) {
if ($vars['item']->annotation_id == 0) {
// comments
if ($object->canComment()) {
- $params = array(
+ elgg_register_menu_item('river', array(
+ 'name' => 'comment',
'href' => '#',
'text' => elgg_echo('generic_comments:text'),
'class' => "elgg-toggler elgg-toggles-comments-add-{$object->getGUID()}",
- );
- echo elgg_view('output/url', $params);
+ ));
}
// like this
if ($object->canAnnotate(0, 'likes')) {
if (!elgg_annotation_exists($object->getGUID(), 'likes')) {
- $url = "action/likes/add?guid={$object->getGUID()}";
- $params = array(
- 'href' => $url,
+
+ elgg_register_menu_item('river', array(
+ 'name' => 'likes',
+ 'href' => "action/likes/add?guid={$object->getGUID()}",
'text' => elgg_echo('likes:likethis'),
'is_action' => true,
- );
- echo elgg_view('output/url', $params);
+ ));
} else {
- $options = array(
+ $likes = elgg_get_annotations(array(
'guid' => $guid,
'annotation_name' => 'likes',
'owner_guid' => elgg_get_logged_in_user_guid()
- );
- $likes = elgg_get_annotations($options);
- $url = elgg_get_site_url() . "action/likes/delete?annotation_id={$likes[0]->id}";
- $params = array(
- 'href' => $url,
+ ));
+
+ elgg_register_menu_item('river', array(
+ 'href' => "action/likes/delete?annotation_id={$likes[0]->id}",
'text' => elgg_echo('likes:remove'),
'is_action' => true,
- );
- echo elgg_view('output/url', $params);
+ ));
}
}
}
+ echo elgg_view_menu('river', array('sort_by' => 'weight', 'item' => $vars['item']));
} \ No newline at end of file