From 21e4f3681d9f936af24e6a44868628ceeb53ddf9 Mon Sep 17 00:00:00 2001 From: pete Date: Mon, 8 Mar 2010 15:45:41 +0000 Subject: Updates to thewire interface git-svn-id: http://code.elgg.org/elgg/trunk@5302 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/thewire/actions/add.php | 2 +- mod/thewire/add.php | 3 +- mod/thewire/everyone.php | 4 +- mod/thewire/graphics/thewire_speech_bubble.gif | Bin 560 -> 278 bytes mod/thewire/index.php | 12 +- mod/thewire/languages/en.php | 6 +- mod/thewire/manifest.xml | 2 +- mod/thewire/views/default/object/thewire.php | 105 +++++-------- mod/thewire/views/default/thewire/css.php | 168 ++++++++------------- mod/thewire/views/default/thewire/forms/add.php | 38 ++--- .../views/default/thewire/profile_status.php | 10 +- .../views/default/thewire/scripts/counter.js | 16 +- 12 files changed, 150 insertions(+), 216 deletions(-) (limited to 'mod') diff --git a/mod/thewire/actions/add.php b/mod/thewire/actions/add.php index 58589dc9a..1a59a979f 100644 --- a/mod/thewire/actions/add.php +++ b/mod/thewire/actions/add.php @@ -14,7 +14,7 @@ if (!isloggedin()) forward(); // Get input data - $body = get_input('note'); + $body = get_input('new_post_textarea'); $tags = get_input('thewiretags'); $access_id = (int)get_default_access(); if ($access_id == ACCESS_PRIVATE) diff --git a/mod/thewire/add.php b/mod/thewire/add.php index 4702c9aa5..6012338fa 100644 --- a/mod/thewire/add.php +++ b/mod/thewire/add.php @@ -20,7 +20,8 @@ // choose the required canvas layout and items to display $area2 = elgg_view_title(elgg_echo('thewire:add')); $area2 .= elgg_view("thewire/forms/add"); - $body = elgg_view_layout("two_column_left_sidebar", '',$area2); + + $body = elgg_view_layout("one_column_with_sidebar", '',$area2); // Display page page_draw(elgg_echo('thewire:addpost'),$body); diff --git a/mod/thewire/everyone.php b/mod/thewire/everyone.php index a5214a212..db35f4410 100644 --- a/mod/thewire/everyone.php +++ b/mod/thewire/everyone.php @@ -17,9 +17,9 @@ //add form $area2 .= elgg_view("thewire/forms/add"); + $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'thewire')); - $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'thewire')); // elgg_view("thewire/view",array('entity' => $thewireposts)); - $body = elgg_view_layout("two_column_left_sidebar", '', $area2); + $body = elgg_view_layout("one_column_with_sidebar", '', $area2); // Display page page_draw(elgg_echo('thewire:everyone'),$body); diff --git a/mod/thewire/graphics/thewire_speech_bubble.gif b/mod/thewire/graphics/thewire_speech_bubble.gif index d0e8606a1..ec5b89773 100644 Binary files a/mod/thewire/graphics/thewire_speech_bubble.gif and b/mod/thewire/graphics/thewire_speech_bubble.gif differ diff --git a/mod/thewire/index.php b/mod/thewire/index.php index 2514d7452..078e93271 100644 --- a/mod/thewire/index.php +++ b/mod/thewire/index.php @@ -21,16 +21,20 @@ } // title - $area2 = elgg_view_title(elgg_echo("thewire:read")); + if (page_owner() == $_SESSION['guid']) { + $area2 = elgg_view_title(elgg_echo("thewire:read")); + } else { + $area2 = elgg_view_title(sprintf(elgg_echo("thewire:user"),$page_owner->name)); + } //add form $area2 .= elgg_view("thewire/forms/add"); // Display the user's wire - $area2 .= list_user_objects($page_owner->getGUID(),'thewire'); // elgg_view("thewire/view",array('entity' => $thewire)); - + $area2 .= list_user_objects($page_owner->getGUID(),'thewire'); + //select the correct canvas area - $body = elgg_view_layout("two_column_left_sidebar", '', $area2); + $body = elgg_view_layout("one_column_with_sidebar", '', $area2); // Display page page_draw(sprintf(elgg_echo('thewire:user'),$page_owner->name),$body); diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php index da0fc222f..69e35cdfd 100644 --- a/mod/thewire/languages/en.php +++ b/mod/thewire/languages/en.php @@ -7,11 +7,11 @@ */ 'thewire' => "The wire", - 'thewire:user' => "%s's wire", + 'thewire:user' => "%s's wire posts", 'thewire:posttitle' => "%s's notes on the wire: %s", 'thewire:everyone' => "All wire posts", - 'thewire:read' => "Wire posts", + 'thewire:read' => "My wire posts", 'thewire:strapline' => "%s", @@ -20,7 +20,7 @@ 'thewire:reply' => "Reply", 'thewire:via' => "via", 'thewire:wired' => "Posted to the wire", - 'thewire:charleft' => "characters left", + 'thewire:charleft' => "characters remaining", 'item:object:thewire' => "Wire posts", 'thewire:notedeleted' => "note deleted", 'thewire:doing' => "What are you doing? Tell everyone on the wire:", diff --git a/mod/thewire/manifest.xml b/mod/thewire/manifest.xml index 080b69b73..a4239313a 100644 --- a/mod/thewire/manifest.xml +++ b/mod/thewire/manifest.xml @@ -1,7 +1,7 @@ - + diff --git a/mod/thewire/views/default/object/thewire.php b/mod/thewire/views/default/object/thewire.php index 3e8e53124..738ab96ba 100644 --- a/mod/thewire/views/default/object/thewire.php +++ b/mod/thewire/views/default/object/thewire.php @@ -1,9 +1,9 @@ * @copyright Curverider Ltd 2008-2010 @@ -14,89 +14,54 @@ * @uses $vars['entity'] Optionally, the note to view */ - if (isset($vars['entity'])) { - - $user_name = $vars['entity']->getOwnerEntity()->name; - - //if the note is a reply, we need some more info - - $note_url = ''; - $note_owner = elgg_echo("thewire:notedeleted"); - +if (isset($vars['entity'])) { + $user_name = $vars['entity']->getOwnerEntity()->name; + + //if the note is a reply, we need some more info + $note_url = ''; + $note_owner = elgg_echo("thewire:notedeleted"); ?> -
-
- - -
+
+
-
+
$vars['entity']->getOwnerEntity(), 'size' => 'small')); + echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'tiny')); ?>
-
- - - parent == 0){ - ?> - reply - -
- + + canEdit()) { - - - echo "
" . elgg_view("output/confirmlink",array( - 'href' => $vars['url'] . "action/thewire/delete?thewirepost=" . $vars['entity']->getGUID(), - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm'), - )) . "
"; - - } //end of can edit if statement - ?> + echo "
" . elgg_view("output/confirmlink",array( + 'href' => $vars['url'] . "action/thewire/delete?thewirepost=" . $vars['entity']->getGUID(), + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + )) . "
"; + } + ?>
- - - {$user_name}: "; - - - $desc = $vars['entity']->description; - - $desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@$1',$desc); - echo parse_urls($desc); - ?> - -
-
-
- - + + description; + $desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@$1',$desc); + echo parse_urls($desc); + ?> +

+ time_created) ); - echo " via " . elgg_echo($vars['entity']->method) . "."; - - ?> + ?> +

- -
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/css.php b/mod/thewire/views/default/thewire/css.php index 6491af2ed..9f460458d 100644 --- a/mod/thewire/views/default/thewire/css.php +++ b/mod/thewire/views/default/thewire/css.php @@ -11,126 +11,90 @@ */ ?> -/* widget */ -.thewire-singlepage { - margin:0 10px 0 10px; +/* new wire post form */ +.new_wire_post { + margin:10px 0 15px 0; + padding-bottom:15px; + border-bottom: 1px solid #dedede; } -.thewire-singlepage .note_body { +.new_wire_post input[type="submit"] { + margin:3px 0 0 0; + float:right; +} +.new_wire_post textarea { + width: 719px; + height: 52px; + padding: 2px 5px 5px 5px; + font-size: 120%; + color:#333333; +} +.character_count { + width: 642px; + color:#666666; +} +.character_count input { + color:#666666; + border:none; + font-size: 100%; + font-weight: bold; + padding:0 2px 0 0; + margin:0; + text-align: right; background: white; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; } -.collapsable_box_content .note_body { - line-height:1.2em; +.character_count input:focus { + border:none; + background:white; } -.thewire-singlepage .thewire-post { + + +/* wire posts listings */ +.wire_post { + padding-bottom:10px; margin-bottom:5px; - background:transparent url(mod/thewire/graphics/thewire_speech_bubble.gif) no-repeat right bottom; -} -.thewire-post { - background:#cccccc; - margin-bottom:10px; + background-image: url(mod/thewire/graphics/thewire_speech_bubble.gif); + background-repeat: no-repeat; + background-position: right bottom; } -.thewire-post .note_date { - font-size:90%; - color:#666666; - padding:0; +.wire_post_contents { + background-color: #eeeeee; + margin:0; + padding:5px; + line-height: 1.2em; + min-height: 34px; + position: relative; } -.thewire_icon { +.wire_post_icon { float:left; - margin:0 8px 4px 2px; + margin-right:8px; } -.note_body { - margin:0; - padding:6px 4px 4px 4px; - min-height: 40px; - line-height: 1.4em; +.wire_post_info { + margin-top:-3px; + float:left; + width:620px; } -.thewire_options { +.wire_post_options { float:right; width:65px; } -.thewire-post .reply { - font: 11px/100% Arial, Helvetica, sans-serif; - font-weight: bold; - color: #ffffff; - background:#999999; - border: 2px solid #999999; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - width: auto; - padding: 0 3px 2px 3px; - margin:0 0 5px 5px; - cursor: pointer; +.wire_post_options .action_button.reply.small { float:right; } -.thewire-post .reply:hover { - background: #4690d6; - border: 2px solid #4690d6; - color:white; - text-decoration: none; -} -.thewire-post .delete_note { - width:14px; - height:14px; - margin:3px 0 0 0; - float:right; +.wire_post_options .delete_button { + position: absolute; + bottom:5px; + right:5px; } -.thewire-post .delete_note a { - display:block; - cursor: pointer; - width:14px; - height:14px; - background: url("_graphics/icon_customise_remove.png") no-repeat 0 0; - text-indent: -9000px; -} -.thewire-post .delete_note a:hover { - background-position: 0 -16px; -} -/* IE 6 fix */ -* html .thewire-post .delete_note a { background-position-y: 2px; } -* html .thewire-post .delete_note a:hover { background-position-y: -14px; } -.post_to_wire { - background: white; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - margin:0 10px 10px 10px; - padding:10px; -} -.post_to_wire input[type="submit"] { - margin:0; -} -/* reply form */ -textarea#thewire_large-textarea { - width: 664px; - height: 40px; - padding: 6px; - font-family: Arial, 'Trebuchet MS','Lucida Grande', sans-serif; - font-size: 100%; - color:#666666; -} -/* IE 6 fix */ -* html textarea#thewire_large-textarea { - width: 642px; +/* latest wire post on profile page */ +.wire_post .action_button.update.small { + float:right; + padding:4px; + position: absolute; + bottom:5px; + right:5px; } -input.thewire_characters_remaining_field { - color:#333333; - border:none; - font-size: 100%; - font-weight: bold; - padding:0 2px 0 0; - margin:0; - text-align: right; - background: white; -} -input.thewire_characters_remaining_field:focus { - border:none; - background:white; -} -.thewire_characters_remaining { - text-align: right; -} + diff --git a/mod/thewire/views/default/thewire/forms/add.php b/mod/thewire/views/default/thewire/forms/add.php index cf9ff15e6..60d7914ea 100644 --- a/mod/thewire/views/default/thewire/forms/add.php +++ b/mod/thewire/views/default/thewire/forms/add.php @@ -15,30 +15,20 @@ if (!empty($wire_user)) { $msg = '@' . $wire_user . ' '; } else { $msg = ''; } ?> -
+

- - -
- {$msg}"; - $display .= "
"; - echo $display; - echo elgg_echo("thewire:charleft") . "
"; - echo elgg_view('input/securitytoken'); - ?> - - -
+ +
+ {$msg}"; + $display .= ""; + $display .= "
"; + echo $display; + echo elgg_echo("thewire:charleft") . "
"; + echo elgg_view('input/securitytoken'); + ?> + +
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/profile_status.php b/mod/thewire/views/default/thewire/profile_status.php index 890b8b9c3..fa8ccd76b 100644 --- a/mod/thewire/views/default/thewire/profile_status.php +++ b/mod/thewire/views/default/thewire/profile_status.php @@ -1,7 +1,7 @@ guid; @@ -13,16 +13,16 @@ if($latest_wire){ foreach($latest_wire as $lw){ $content = $lw->description; - $time = " (" . friendly_time($lw->time_created) . ")"; + $time = "

(" . friendly_time($lw->time_created) . ")

"; } } if($latest_wire){ - echo "
"; + echo "
"; echo $content; if($owner == $_SESSION['user']->guid) - echo " update"; + echo " update"; echo $time; - echo "
"; + echo "
"; } ?> \ No newline at end of file diff --git a/mod/thewire/views/default/thewire/scripts/counter.js b/mod/thewire/views/default/thewire/scripts/counter.js index 3a1ebdbc5..7486bd1de 100644 --- a/mod/thewire/views/default/thewire/scripts/counter.js +++ b/mod/thewire/views/default/thewire/scripts/counter.js @@ -1,6 +1,16 @@ -// I need to move this into a JS folder for the plugin +/** + * Elgg thewire text counter + * + * @package ElggTheWire + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + * + * @question - do we want users to be able to edit thewire? + * + * @uses $vars['entity'] Optionally, the note to view -/* @@ -16,4 +26,4 @@ function textCounter(field,cntfield,maxlimit) { // otherwise, update 'characters left' counter cntfield.value = maxlimit - field.value.length; } -} +} \ No newline at end of file -- cgit v1.2.3