aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-12 22:39:46 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-12 22:39:46 +0000
commitcc6b7d1d223241e397e0d41354924e74606eeffc (patch)
tree0ab9761a9b4db387edd3f3b17568bbee1c2b78c6 /views
parentca9ed0b16163dcf77154c0adc702e9f4c63df13c (diff)
downloadelgg-cc6b7d1d223241e397e0d41354924e74606eeffc.tar.gz
elgg-cc6b7d1d223241e397e0d41354924e74606eeffc.tar.bz2
Refs #650. Replaced calls to get_annotations() by elgg_get_annotations().
git-svn-id: http://code.elgg.org/elgg/trunk@8182 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r--views/default/core/likes/display.php9
-rw-r--r--views/default/core/river/controls.php11
-rw-r--r--views/default/core/river/footer.php16
3 files changed, 28 insertions, 8 deletions
diff --git a/views/default/core/likes/display.php b/views/default/core/likes/display.php
index 209b6de2d..a2f6b7799 100644
--- a/views/default/core/likes/display.php
+++ b/views/default/core/likes/display.php
@@ -1,6 +1,6 @@
<?php
/**
- * Elgg likes display
+ * Elgg likes display
*
* @package Elgg
*
@@ -25,7 +25,12 @@ if (!elgg_annotation_exists($guid, 'likes')) {
);
$likes_button = elgg_view('output/url', $params);
} else {
- $likes = get_annotations($guid, '', '', 'likes', '', elgg_get_logged_in_user_guid());
+ $options = array(
+ 'guid' => $guid,
+ 'annotation_name' => 'likes',
+ 'owner_guid' => 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,
diff --git a/views/default/core/river/controls.php b/views/default/core/river/controls.php
index 7c5e94581..dd9de656d 100644
--- a/views/default/core/river/controls.php
+++ b/views/default/core/river/controls.php
@@ -1,7 +1,7 @@
<?php
/**
* Controls on an river item
- *
+ *
*
* @uses $vars['item']
*/
@@ -18,7 +18,7 @@ if (elgg_is_logged_in()) {
'internalid' => "elgg-toggler-{$object->getGUID()}",
);
echo elgg_view('output/url', $params);
-
+
// like this
if (!elgg_annotation_exists($object->getGUID(), 'likes')) {
$url = "action/likes/add?guid={$object->getGUID()}";
@@ -29,7 +29,12 @@ if (elgg_is_logged_in()) {
);
echo elgg_view('output/url', $params);
} else {
- $likes = get_annotations($guid, '', '', 'likes', '', elgg_get_logged_in_user_guid());
+ $options = array(
+ 'guid' => $guid,
+ 'annotation_name' => 'likes',
+ 'owner_guid' => 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,
diff --git a/views/default/core/river/footer.php b/views/default/core/river/footer.php
index 1b0d14987..04f7d8daa 100644
--- a/views/default/core/river/footer.php
+++ b/views/default/core/river/footer.php
@@ -13,8 +13,18 @@ if ($item->annotation_id != 0 || !$object) {
$comment_count = count_annotations($object->getGUID(), '', '', 'generic_comment');
-$comments = get_annotations($object->getGUID(), "", "", 'generic_comment', "", "", 3, 0, "desc");
+$options = array(
+ 'guid' => $object->getGUID(),
+ 'annotation_name' => 'generic_comment',
+ 'limit' => 3,
+ 'order_by' => 'n_table.time_created desc'
+);
+$comments = elgg_get_annotations($options);
+
if ($comments) {
+ // why is this reversing it? because we're asking for the 3 latest
+ // comments by sorting desc and limiting by 3, but we want to display
+ // these comments with the latest at the bottom.
$comments = array_reverse($comments);
?>
@@ -38,6 +48,6 @@ if ($comments) {
// inline comment form
echo elgg_view_form('comments/inline', array(
- 'action' => 'action/comments/add',
- 'internalid' => "elgg-togglee-{$object->getGUID()}",
+ 'action' => 'action/comments/add',
+ 'internalid' => "elgg-togglee-{$object->getGUID()}",
), array('entity' => $object));