aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire
diff options
context:
space:
mode:
Diffstat (limited to 'mod/thewire')
-rw-r--r--mod/thewire/actions/delete.php2
-rw-r--r--mod/thewire/pages/thewire/view.php31
-rw-r--r--mod/thewire/start.php12
-rw-r--r--mod/thewire/views/default/js/thewire.php16
-rw-r--r--mod/thewire/views/default/thewire/css.php3
5 files changed, 53 insertions, 11 deletions
diff --git a/mod/thewire/actions/delete.php b/mod/thewire/actions/delete.php
index 58502a7e7..38355d25e 100644
--- a/mod/thewire/actions/delete.php
+++ b/mod/thewire/actions/delete.php
@@ -24,7 +24,7 @@ if ($thewire->getSubtype() == "thewire" && $thewire->canEdit()) {
}
// Get owning user
- $owner = get_entity($thewire->getOwner());
+ $owner = get_entity($thewire->getOwnerGUID());
// Delete it
$rowsaffected = $thewire->delete();
diff --git a/mod/thewire/pages/thewire/view.php b/mod/thewire/pages/thewire/view.php
new file mode 100644
index 000000000..1709e5e9a
--- /dev/null
+++ b/mod/thewire/pages/thewire/view.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * View individual wire post
+ */
+
+$post = get_entity(get_input('guid'));
+if (!$post) {
+ register_error(elgg_echo('noaccess'));
+ $_SESSION['last_forward_from'] = current_page_url();
+ forward('');
+}
+$owner = $post->getOwnerEntity();
+if (!$owner) {
+ forward();
+}
+
+$title = elgg_echo('thewire:by', array($owner->name));
+
+elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
+elgg_push_breadcrumb($owner->name, 'thewire/owner/' . $owner->username);
+elgg_push_breadcrumb($title);
+
+$content = elgg_view_entity($post);
+
+$body = elgg_view_layout('content', array(
+ 'filter' => false,
+ 'content' => $content,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index 5d5786e2f..1ba48263a 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -37,7 +37,7 @@ function thewire_init() {
elgg_register_plugin_hook_handler('register', 'menu:entity', 'thewire_setup_entity_menu_items');
// Extend system CSS with our own styles, which are defined in the thewire/css view
- elgg_extend_view('css', 'thewire/css');
+ elgg_extend_view('css/elgg', 'thewire/css');
//extend views
elgg_extend_view('activity/thewire', 'thewire/activity_view');
@@ -77,7 +77,8 @@ function thewire_init() {
* thewire/owner/<username> View this user's wire posts
* thewire/following/<username> View the posts of those this user follows
* thewire/reply/<guid> Reply to a post
- * thewire/view/<guid> View a conversation thread
+ * thewire/view/<guid> View a post
+ * thewire/thread/<id> View a conversation thread
* thewire/tag/<tag> View wire posts tagged with <tag>
*
* @param array $page From the page_handler function
@@ -104,6 +105,13 @@ function thewire_page_handler($page) {
include "$base_dir/owner.php";
break;
+ case "view":
+ if (isset($page[1])) {
+ set_input('guid', $page[1]);
+ }
+ include "$base_dir/view.php";
+ break;
+
case "thread":
if (isset($page[1])) {
set_input('thread_id', $page[1]);
diff --git a/mod/thewire/views/default/js/thewire.php b/mod/thewire/views/default/js/thewire.php
index 0a6eba134..ba8f35050 100644
--- a/mod/thewire/views/default/js/thewire.php
+++ b/mod/thewire/views/default/js/thewire.php
@@ -34,11 +34,11 @@ elgg.thewire.textCounter = function(textarea, status, limit) {
status.html(remaining_chars);
if (remaining_chars < 0) {
- status.parent().css("color", "#D40D12");
+ status.parent().addClass("thewire-characters-remaining-warning");
$("#thewire-submit-button").attr('disabled', 'disabled');
$("#thewire-submit-button").addClass('elgg-state-disabled');
} else {
- status.parent().css("color", "");
+ status.parent().removeClass("thewire-characters-remaining-warning");
$("#thewire-submit-button").removeAttr('disabled', 'disabled');
$("#thewire-submit-button").removeClass('elgg-state-disabled');
}
@@ -57,16 +57,16 @@ elgg.thewire.viewPrevious = function(event) {
var postGuid = $link.attr("href").split("/").pop();
var $previousDiv = $("#thewire-previous-" + postGuid);
- if ($link.html() == "<?php echo elgg_echo('thewire:hide'); ?>") {
- $link.html("<?php echo elgg_echo('thewire:previous'); ?>");
- $link.attr("title", "<?php echo elgg_echo('thewire:previous:help'); ?>");
+ if ($link.html() == elgg.echo('thewire:hide')) {
+ $link.html(elgg.echo('thewire:previous'));
+ $link.attr("title", elgg.echo('thewire:previous:help'));
$previousDiv.slideUp(400);
} else {
- $link.html("<?php echo elgg_echo('thewire:hide'); ?>");
- $link.attr("title", "<?php echo elgg_echo('thewire:hide:help'); ?>");
+ $link.html(elgg.echo('thewire:hide'));
+ $link.attr("title", elgg.echo('thewire:hide:help'));
$.ajax({type: "GET",
- url: "<?php echo $site_url . "ajax/view/thewire/previous"; ?>",
+ url: elgg.config.wwwroot + "ajax/view/thewire/previous",
dataType: "html",
cache: false,
data: {guid: postGuid},
diff --git a/mod/thewire/views/default/thewire/css.php b/mod/thewire/views/default/thewire/css.php
index d1ef31993..d11cce74a 100644
--- a/mod/thewire/views/default/thewire/css.php
+++ b/mod/thewire/views/default/thewire/css.php
@@ -27,6 +27,9 @@ The Wire
text-align: right;
background: white;
}
+.thewire-characters-remaining-warning {
+ color: #D40D12 !important;
+}
.thewire-parent {
margin-left: 40px;
}