aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-08-25 10:00:38 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-08-25 10:00:38 -0700
commitdccc333c765bb28da55b4a55d9c916acdb88413a (patch)
treebdd26a0b4cd85241a19b7fcb2c0770f0ac3eb9f0 /mod/thewire
parentec7b94a64aef23b85866ecdac8e8acc712d29bb6 (diff)
parent003cb81c7888f4d2fd763e5814027c6f8d71186f (diff)
downloadelgg-dccc333c765bb28da55b4a55d9c916acdb88413a.tar.gz
elgg-dccc333c765bb28da55b4a55d9c916acdb88413a.tar.bz2
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'mod/thewire')
-rw-r--r--mod/thewire/languages/en.php5
-rw-r--r--mod/thewire/pages/thewire/everyone.php4
-rw-r--r--mod/thewire/pages/thewire/friends.php9
-rw-r--r--mod/thewire/pages/thewire/owner.php4
-rw-r--r--mod/thewire/pages/thewire/previous.php1
-rw-r--r--mod/thewire/pages/thewire/reply.php4
-rw-r--r--mod/thewire/pages/thewire/tag.php1
-rw-r--r--mod/thewire/pages/thewire/thread.php1
-rw-r--r--mod/thewire/start.php12
-rw-r--r--mod/thewire/views/default/forms/thewire/add.php9
-rw-r--r--mod/thewire/views/default/js/thewire.php4
-rw-r--r--mod/thewire/views/default/object/thewire.php1
-rw-r--r--mod/thewire/views/default/river/object/thewire/create.php29
-rw-r--r--mod/thewire/views/default/thewire/reply.php7
14 files changed, 59 insertions, 32 deletions
diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php
index 1b9d71c56..9716fc060 100644
--- a/mod/thewire/languages/en.php
+++ b/mod/thewire/languages/en.php
@@ -13,7 +13,7 @@ $english = array(
'thewire:user' => "%s's wire posts",
'thewire:friends' => "Friends' wire posts",
'thewire:reply' => "Reply",
- 'thewire:replying' => "Replying to %s who wrote",
+ 'thewire:replying' => "Replying to %s (@%s) who wrote",
'thewire:thread' => "Thread",
'thewire:charleft' => "characters remaining",
'thewire:tags' => "Wire posts tagged with '%s'",
@@ -29,7 +29,8 @@ $english = array(
/**
* The wire river
*/
- 'thewire:river:create' => "posted to the wire",
+ 'river:create:object:thewire' => "%s posted to the %s",
+ 'thewire:wire' => 'wire',
/**
* Wire widget
diff --git a/mod/thewire/pages/thewire/everyone.php b/mod/thewire/pages/thewire/everyone.php
index e3d38ace5..e78395c31 100644
--- a/mod/thewire/pages/thewire/everyone.php
+++ b/mod/thewire/pages/thewire/everyone.php
@@ -9,7 +9,8 @@ elgg_push_breadcrumb(elgg_echo('thewire'));
$title = elgg_echo('thewire:everyone');
if (elgg_is_logged_in()) {
- $content .= elgg_view_form('thewire/add');
+ $form_vars = array('class' => 'thewire-form');
+ $content .= elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
}
@@ -23,7 +24,6 @@ $body = elgg_view_layout('content', array(
'filter_context' => 'all',
'content' => $content,
'title' => $title,
- 'buttons' => false,
'sidebar' => elgg_view('thewire/sidebar'),
));
diff --git a/mod/thewire/pages/thewire/friends.php b/mod/thewire/pages/thewire/friends.php
index ab452aa55..265b73eab 100644
--- a/mod/thewire/pages/thewire/friends.php
+++ b/mod/thewire/pages/thewire/friends.php
@@ -11,13 +11,18 @@ elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all");
elgg_push_breadcrumb($owner->name, "thewire/owner/$owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
-$content = list_user_friends_objects($owner->guid, 'thewire', 15, false);
+if (get_loggedin_userid() == $owner->guid) {
+ $form_vars = array('class' => 'thewire-form');
+ $content = elgg_view_form('thewire/add', $form_vars);
+ $content .= elgg_view('input/urlshortener');
+}
+
+$content .= list_user_friends_objects($owner->guid, 'thewire', 15, false);
$body = elgg_view_layout('content', array(
'filter_context' => 'friends',
'content' => $content,
'title' => $title,
- 'buttons' => false,
));
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/owner.php b/mod/thewire/pages/thewire/owner.php
index d61307990..b6449b217 100644
--- a/mod/thewire/pages/thewire/owner.php
+++ b/mod/thewire/pages/thewire/owner.php
@@ -12,7 +12,8 @@ elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all");
elgg_push_breadcrumb($owner->name);
if (get_loggedin_userid() == $owner->guid) {
- $content = elgg_view_form('thewire/add');
+ $form_vars = array('class' => 'thewire-form');
+ $content = elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
}
@@ -27,7 +28,6 @@ $body = elgg_view_layout('content', array(
'filter_context' => 'mine',
'content' => $content,
'title' => $title,
- 'buttons' => false,
'sidebar' => elgg_view('thewire/sidebar'),
));
diff --git a/mod/thewire/pages/thewire/previous.php b/mod/thewire/pages/thewire/previous.php
index 45c1e1095..a3f1cb01c 100644
--- a/mod/thewire/pages/thewire/previous.php
+++ b/mod/thewire/pages/thewire/previous.php
@@ -15,7 +15,6 @@ $body = elgg_view_layout('content', array(
'filter' => false,
'content' => $body,
'title' => $title,
- 'buttons' => false,
));
echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/thewire/pages/thewire/reply.php b/mod/thewire/pages/thewire/reply.php
index 826d513b6..df4511c51 100644
--- a/mod/thewire/pages/thewire/reply.php
+++ b/mod/thewire/pages/thewire/reply.php
@@ -14,7 +14,8 @@ elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
elgg_push_breadcrumb($title);
$content = elgg_view('thewire/reply', array('post' => $post));
-$content .= elgg_view_form('thewire/add', array(), array('post' => $post));
+$form_vars = array('class' => 'thewire-form');
+$content .= elgg_view_form('thewire/add', $form_vars, array('post' => $post));
$content .= elgg_view('input/urlshortener');
@@ -22,7 +23,6 @@ $body = elgg_view_layout('content', array(
'filter' => false,
'content' => $content,
'title' => $title,
- 'buttons' => false,
));
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/tag.php b/mod/thewire/pages/thewire/tag.php
index 53f9e9db9..1c88030ec 100644
--- a/mod/thewire/pages/thewire/tag.php
+++ b/mod/thewire/pages/thewire/tag.php
@@ -30,7 +30,6 @@ $body = elgg_view_layout('content', array(
'filter' => false,
'content' => $content,
'title' => $title,
- 'buttons' => false,
));
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/thread.php b/mod/thewire/pages/thewire/thread.php
index 5c32a8400..ec2709430 100644
--- a/mod/thewire/pages/thewire/thread.php
+++ b/mod/thewire/pages/thewire/thread.php
@@ -22,7 +22,6 @@ $body = elgg_view_layout('content', array(
'filter' => false,
'content' => $content,
'title' => $title,
- 'buttons' => false,
));
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index 0e6bd7794..9d3993b6f 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -278,6 +278,16 @@ function thewire_save_post($text, $userid, $access_id, $parent_guid = 0, $method
if ($guid) {
add_to_river('river/object/thewire/create', 'create', $post->owner_guid, $post->guid);
+
+ // let other plugins know we are setting a user status
+ $params = array(
+ 'entity' => $post,
+ 'user' => $post->getOwnerEntity(),
+ 'message' => $post->description,
+ 'url' => $post->getURL(),
+ 'origin' => 'thewire',
+ );
+ elgg_trigger_plugin_hook('status', 'user', $params);
}
return $guid;
@@ -401,7 +411,7 @@ function thewire_setup_entity_menu_items($hook, $type, $value, $params) {
'text' => elgg_echo('thewire:previous'),
'href' => "thewire/previous/$entity->guid",
'priority' => 160,
- 'class' => 'thewire-previous',
+ 'link_class' => 'thewire-previous',
'title' => elgg_echo('thewire:previous:help'),
);
$value[] = ElggMenuItem::factory($options);
diff --git a/mod/thewire/views/default/forms/thewire/add.php b/mod/thewire/views/default/forms/thewire/add.php
index 67585b0df..8607b3662 100644
--- a/mod/thewire/views/default/forms/thewire/add.php
+++ b/mod/thewire/views/default/forms/thewire/add.php
@@ -20,12 +20,17 @@ if ($post) {
'value' => $post->guid,
));
}
+
+echo elgg_view('input/plaintext', array(
+ 'name' => 'body',
+ 'class' => 'mtm',
+ 'id' => 'thewire-textarea',
+));
?>
-<textarea id="thewire-textarea" name="body" class="mtm"></textarea>
<div id="thewire-characters-remaining">
<span>140</span> <?php echo elgg_echo('thewire:charleft'); ?>
</div>
-<div class="mts">
+<div class="elgg-foot mts">
<?php
echo elgg_view('input/submit', array(
diff --git a/mod/thewire/views/default/js/thewire.php b/mod/thewire/views/default/js/thewire.php
index 1eda90bee..d9bf6d10e 100644
--- a/mod/thewire/views/default/js/thewire.php
+++ b/mod/thewire/views/default/js/thewire.php
@@ -30,7 +30,7 @@ elgg.thewire.init = function() {
*/
elgg.thewire.textCounter = function(textarea, status, limit) {
- var remaining_chars = limit - textarea.value.length;
+ var remaining_chars = limit - $(textarea).val().length;
status.html(remaining_chars);
if (remaining_chars < 0) {
@@ -83,4 +83,4 @@ elgg.thewire.viewPrevious = function(event) {
event.preventDefault();
}
-elgg.register_hook_handler('init', 'system', elgg.thewire.init); \ No newline at end of file
+elgg.register_hook_handler('init', 'system', elgg.thewire.init);
diff --git a/mod/thewire/views/default/object/thewire.php b/mod/thewire/views/default/object/thewire.php
index 3ae347711..2727df60d 100644
--- a/mod/thewire/views/default/object/thewire.php
+++ b/mod/thewire/views/default/object/thewire.php
@@ -51,6 +51,7 @@ $params = array(
'content' => thewire_filter($post->description),
'tags' => false,
);
+$params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($owner_icon, $list_body);
diff --git a/mod/thewire/views/default/river/object/thewire/create.php b/mod/thewire/views/default/river/object/thewire/create.php
index d4dac38ee..c3c434858 100644
--- a/mod/thewire/views/default/river/object/thewire/create.php
+++ b/mod/thewire/views/default/river/object/thewire/create.php
@@ -7,18 +7,23 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = thewire_filter($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
+$subject = $vars['item']->getSubjectEntity();
+$subject_link = elgg_view('output/url', array(
+ 'href' => $subject->getURL(),
+ 'text' => $subject->name,
+ 'class' => 'elgg-river-subject',
+));
-echo elgg_echo('thewire:river:create');
+$object_link = elgg_view('output/url', array(
+ 'href' => "thewire/owner/$subject->username",
+ 'text' => elgg_echo('thewire:wire'),
+ 'class' => 'elgg-river-object',
+));
-echo " $link";
+$summary = elgg_echo("river:create:object:thewire", array($subject_link, $object_link));
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+ 'summary' => $summary,
+)); \ No newline at end of file
diff --git a/mod/thewire/views/default/thewire/reply.php b/mod/thewire/views/default/thewire/reply.php
index 3794e1454..341b691b1 100644
--- a/mod/thewire/views/default/thewire/reply.php
+++ b/mod/thewire/views/default/thewire/reply.php
@@ -5,7 +5,10 @@
$post = $vars['post'];
$poster = $post->getOwnerEntity();
-
+$poster_details = array(
+ htmlspecialchars($poster->name, ENT_QUOTES, 'UTF-8'),
+ htmlspecialchars($poster->username, ENT_QUOTES, 'UTF-8'),
+);
?>
-<b><?php echo elgg_echo('thewire:replying', array($poster->name)); ?>: </b>
+<b><?php echo elgg_echo('thewire:replying', $poster_details); ?>: </b>
<?php echo $post->description; \ No newline at end of file