aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/upgrades/2010121702.php10
-rw-r--r--languages/en.php1
-rw-r--r--version.php2
-rw-r--r--views/default/annotation/annotatelike.php11
-rw-r--r--views/default/river/annotation/likes/create.php23
5 files changed, 35 insertions, 12 deletions
diff --git a/engine/lib/upgrades/2010121702.php b/engine/lib/upgrades/2010121702.php
new file mode 100644
index 000000000..1c4a931b1
--- /dev/null
+++ b/engine/lib/upgrades/2010121702.php
@@ -0,0 +1,10 @@
+<?php
+/**
+ * Change the location of the likes river view
+ */
+
+$query = "UPDATE {$CONFIG->dbprefix}river
+ SET view='river/annotation/likes/create', action_type='create'
+ WHERE view='annotation/annotatelike' AND action_type='likes'";
+update_data($query);
+
diff --git a/languages/en.php b/languages/en.php
index 9ce523a4e..2d406d3be 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -638,6 +638,7 @@ $english = array(
'river:select' => 'Show %s',
'river:comments:more' => '+%u more',
'river:generic_comment' => 'commented on %s %s',
+ 'river:likes' => 'likes %s %s',
'members:label:newest' => 'Newest',
'members:label:popular' => 'Popular',
diff --git a/version.php b/version.php
index 2a445de6e..235180d1c 100644
--- a/version.php
+++ b/version.php
@@ -11,7 +11,7 @@
// YYYYMMDD = Elgg Date
// XX = Interim incrementer
-$version = 2010121701;
+$version = 2010121702;
// Human-friendly version name
$release = '1.8-svn';
diff --git a/views/default/annotation/annotatelike.php b/views/default/annotation/annotatelike.php
deleted file mode 100644
index 7b0d5c2e2..000000000
--- a/views/default/annotation/annotatelike.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$performed_by = get_entity($vars['item']->subject_guid);
-$object = get_entity($vars['item']->object_guid);
-$url = $object->getURL();
-$title = $object->title;
-
-$string = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> ";
-$string .= elgg_echo("likes:river:annotate") . " <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity-subtext'>" . elgg_view_friendly_time($object->time_created)."</span>";
-
-echo $string; \ No newline at end of file
diff --git a/views/default/river/annotation/likes/create.php b/views/default/river/annotation/likes/create.php
new file mode 100644
index 000000000..374f4a381
--- /dev/null
+++ b/views/default/river/annotation/likes/create.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Likes river view
+ */
+$object = $vars['item']->getObjectEntity();
+$comment = $vars['item']->getAnnotation();
+
+$url = $object->getURL();
+$title = $object->title;
+if (!$title) {
+ $title = elgg_echo('untitled');
+}
+$params = array(
+ 'href' => $object->getURL(),
+ 'text' => $title,
+);
+$object_link = elgg_view('output/url', $params);
+
+$type = $object->getType();
+$subtype = $object->getSubtype();
+
+$type_string = elgg_echo("river:commented:$type:$subtype");
+echo elgg_echo('river:likes', array($type_string, $object_link));