aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-17 12:37:21 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-17 12:37:21 +0000
commit43ffa1d95e62f553f7d0d7164c9c1a356abfcf93 (patch)
tree7bbc9e7d87562a40bf879003452bfa7c5b938852
parent152a6ae4f00f6e0407d9a7ba04ae0000a818c554 (diff)
downloadelgg-43ffa1d95e62f553f7d0d7164c9c1a356abfcf93.tar.gz
elgg-43ffa1d95e62f553f7d0d7164c9c1a356abfcf93.tar.bz2
added pages and thewire river entries
git-svn-id: http://code.elgg.org/elgg/trunk@7659 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/pages/languages/en.php2
-rw-r--r--mod/pages/views/default/river/object/page/create.php43
-rw-r--r--mod/pages/views/default/river/object/page_top/create.php9
-rw-r--r--mod/thewire/languages/en.php2
-rw-r--r--mod/thewire/views/default/river/object/thewire/create.php35
5 files changed, 52 insertions, 39 deletions
diff --git a/mod/pages/languages/en.php b/mod/pages/languages/en.php
index 1fc5929b2..478f8e5c3 100644
--- a/mod/pages/languages/en.php
+++ b/mod/pages/languages/en.php
@@ -38,10 +38,10 @@ $english = array(
* River
**/
+ 'pages:river:create' => 'created the page',
'pages:river:created' => "%s wrote",
'pages:river:updated' => "%s updated",
'pages:river:posted' => "%s posted",
- 'pages:river:create' => "a new page titled",
'pages:river:update' => "a page titled",
'river:commented:object:page' => 'the page',
'river:commented:object:page_top' => 'the page',
diff --git a/mod/pages/views/default/river/object/page/create.php b/mod/pages/views/default/river/object/page/create.php
index 1635de221..032046063 100644
--- a/mod/pages/views/default/river/object/page/create.php
+++ b/mod/pages/views/default/river/object/page/create.php
@@ -1,22 +1,35 @@
<?php
/**
- * Page create river view
- *
- * @package ElggPages
+ * Page river view.
*/
-$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
-$object = get_entity($vars['item']->object_guid);
-$url = $object->getURL();
+$object = $vars['item']->getObjectEntity();
+$excerpt = strip_tags($object->description);
+$excerpt = elgg_get_excerpt($excerpt);
+$params = array(
+ 'href' => $object->getURL(),
+ 'text' => $object->title,
+);
+$link = elgg_view('output/url', $params);
-$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$contents = strip_tags($object->description); //strip tags from the contents to stop large images etc blowing out the river view
-$string = elgg_echo("pages:river:created", array($url)) . " ";
-$string .= elgg_echo("pages:river:create") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a> <span class='entity-subtext'>". elgg_view_friendly_time($object->time_created) ."</span> <a class='river_comment_form_button link'>Comment</a>";
-$string .= elgg_view('forms/likes/link', array('entity' => $object));
-$string .= "<div class=\"river_content_display\">";
-$string .= elgg_get_excerpt($contents, 200);
-$string .= "</div>";
+$group_string = '';
+$container = $object->getContainerEntity();
+if ($container instanceof ElggGroup) {
+ $params = array(
+ 'href' => $container->getURL(),
+ 'text' => $container->name,
+ );
+ $group_link = elgg_view('output/url', $params);
+ $group_string = elgg_echo('river:ingroup', array($group_link));
+}
-echo $string;
+echo elgg_echo('pages:river:create');
+
+echo " $link $group_string";
+
+if ($excerpt) {
+ echo '<div class="elgg-river-content">';
+ echo $excerpt;
+ echo '</div>';
+}
diff --git a/mod/pages/views/default/river/object/page_top/create.php b/mod/pages/views/default/river/object/page_top/create.php
index d951a2f6a..b89eed195 100644
--- a/mod/pages/views/default/river/object/page_top/create.php
+++ b/mod/pages/views/default/river/object/page_top/create.php
@@ -5,11 +5,4 @@
* @package ElggPages
*/
-$statement = $vars['statement'];
-$performed_by = $statement->getSubject();
-$object = $statement->getObject();
-
-$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = elgg_echo("pages:river:created", array($url)) . " ";
-$string .= elgg_echo("pages:river:create") . "<a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
-echo $string; \ No newline at end of file
+echo elgg_view('river/object/page/create', $vars); \ No newline at end of file
diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php
index 7a6853dc4..581ac5506 100644
--- a/mod/thewire/languages/en.php
+++ b/mod/thewire/languages/en.php
@@ -39,7 +39,7 @@
'thewire:river:created' => "%s posted",
//these get inserted into the river links to take the user to the entity
- 'thewire:river:create' => "on the wire.",
+ 'thewire:river:create' => "posted to the wire",
/**
* Wire widget
diff --git a/mod/thewire/views/default/river/object/thewire/create.php b/mod/thewire/views/default/river/object/thewire/create.php
index 0660b47ff..b1142e0f4 100644
--- a/mod/thewire/views/default/river/object/thewire/create.php
+++ b/mod/thewire/views/default/river/object/thewire/create.php
@@ -1,17 +1,24 @@
<?php
+/**
+ * File river view.
+ */
-$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
-$object = get_entity($vars['item']->object_guid);
-$url = $object->getURL();
+$object = $vars['item']->getObjectEntity();
+$excerpt = strip_tags($object->description);
+$excerpt = elgg_get_excerpt($excerpt);
-$string = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}:</a> ";
-$desc = $object->description;
-//$desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@<a href="' . elgg_get_site_url() . 'pg/thewire/$1">$1</a>',$desc);
-$string .= parse_urls($desc);
-$string .= " <span class='entity-subtext'>" . elgg_view_friendly_time($object->time_created);
- if (isloggedin()){
- $string .= "<a class='river_comment_form_button link'>Comment</a>";
- $string .= elgg_view('forms/likes/link', array('entity' => $object));
- }
-$string .= "</span>";
-echo $string; \ No newline at end of file
+$params = array(
+ 'href' => $object->getURL(),
+ 'text' => $object->title,
+);
+$link = elgg_view('output/url', $params);
+
+echo elgg_echo('thewire:river:create');
+
+echo " $link";
+
+if ($excerpt) {
+ echo '<div class="elgg-river-content">';
+ echo $excerpt;
+ echo '</div>';
+}