]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Updates to thewire interface
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 8 Mar 2010 15:45:41 +0000 (15:45 +0000)
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 8 Mar 2010 15:45:41 +0000 (15:45 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5302 36083f99-b078-4883-b0ff-0f9b5a30f544

12 files changed:
mod/thewire/actions/add.php
mod/thewire/add.php
mod/thewire/everyone.php
mod/thewire/graphics/thewire_speech_bubble.gif
mod/thewire/index.php
mod/thewire/languages/en.php
mod/thewire/manifest.xml
mod/thewire/views/default/object/thewire.php
mod/thewire/views/default/thewire/css.php
mod/thewire/views/default/thewire/forms/add.php
mod/thewire/views/default/thewire/profile_status.php
mod/thewire/views/default/thewire/scripts/counter.js

index 58589dc9acb706a74dd1d7aecbe489f339522988..1a59a979fb24b43bebe41677bc8cd5674b74401e 100644 (file)
@@ -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)
index 4702c9aa5c76e09e3b1d60d0703fd06210969990..6012338fa2c57ad2f1987655579875c3c3bf5c77 100644 (file)
@@ -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);
index a5214a21259aaf9312dc5b3d160ea886d921953b..db35f441091e8f7826ff84b12ec9392c8f5aaf03 100644 (file)
@@ -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);
index d0e8606a19f0ff1531dd9e0297daaf94960fd230..ec5b89773516215e4c68b2918a6f706daebeaf7c 100644 (file)
Binary files a/mod/thewire/graphics/thewire_speech_bubble.gif and b/mod/thewire/graphics/thewire_speech_bubble.gif differ
index 2514d74522b7c3ba2f49f03992b688776b68401a..078e932711780a36b9060d049f942d2244b9f515 100644 (file)
                }
                
        // 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);
index da0fc222fe12651240250ebe0918532b82e25aa1..69e35cdfd38e94bff796970e1d3cb722eeac0f1e 100644 (file)
@@ -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:",
index 080b69b73ae71c8bb82fb6a52cf759660e65aa9b..a4239313ae8fab65ad2b8d49a2be79552ddbad1e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <plugin_manifest>
         <field key="author" value="Curverider" />
-        <field key="version" value="1.7" />
+        <field key="version" value="1.8" />
         <field key="description" value="Provides a microblogging service for your Elgg site." />
         <field key="website" value="http://www.elgg.org/" />
         <field key="copyright" value="(C) Curverider 2008-2010" />
index 3e8e53124d50fbdae6315649aef2138d019033e3..738ab96ba0bddc46a2a9e760c998ea6a3f75cfb2 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 
        /**
-        * Elgg thewire note view
+        * Elgg Wire Posts Listings
         * 
-        * @package ElggTheWire
+        * @package thewire
         * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
         * @author Curverider <info@elgg.com>
         * @copyright Curverider Ltd 2008-2010
         * @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");                 
 ?>
-<div class="thewire-singlepage">
-       <div class="thewire-post">
-                           
-           <!-- the actual shout -->
-               <div class="note_body">
+<div class="wire_post">
+       <div class="wire_post_contents clearfloat radius8">
 
-           <div class="thewire_icon">
+           <div class="wire_post_icon">
            <?php
-                       echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'small'));
+                       echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'tiny'));
            ?>
            </div>
 
-                       <div class="thewire_options">
-                       
-                       <a href="<?php echo $vars['url']; ?>mod/thewire/add.php?wire_username=<?php echo $vars['entity']->getOwnerEntity()->username; ?>" class="reply"><?php echo elgg_echo('thewire:reply'); ?></a>
-               <?php
-/*                 //only have a reply option for main notes, not other replies
-                   if($vars['entity']->parent == 0){
-        ?>
-               <a href="<?php echo $vars['url']; ?>mod/thewire/reply.php?note_id=<?php echo $vars['entity']->guid; ?>" class="reply">reply</a>
-               <?php
-               }
-*/
-           ?>
-           <div class="clearfloat"></div>
-                       <?php
-                                  
-                       // if the user looking at thewire post can edit, show the delete link
+               <div class="wire_post_options">
+                       <a href="<?php echo $vars['url']; ?>mod/thewire/add.php?wire_username=<?php echo $vars['entity']->getOwnerEntity()->username; ?>" class="action_button reply small"><?php echo elgg_echo('thewire:reply'); ?></a>
+               <?php
+                               // if the user looking at thewire post can edit, show the delete link
                        if ($vars['entity']->canEdit()) {
-                                               
-         
-                                          echo "<div class='delete_note'>" . elgg_view("output/confirmlink",array(
-                                                                                                                       'href' => $vars['url'] . "action/thewire/delete?thewirepost=" . $vars['entity']->getGUID(),
-                                                                                                                       'text' => elgg_echo('delete'),
-                                                                                                                       'confirm' => elgg_echo('deleteconfirm'),
-                                                                                                               )) . "</div>";
-                       
-                       } //end of can edit if statement
-               ?>
+                          echo "<div class='delete_button'>" . elgg_view("output/confirmlink",array(
+                                       'href' => $vars['url'] . "action/thewire/delete?thewirepost=" . $vars['entity']->getGUID(),
+                                       'text' => elgg_echo('delete'),
+                                       'confirm' => elgg_echo('deleteconfirm'),
+                               )) . "</div>";
+                       }
+                       ?>
            </div>
-           
-               
-               <?php
-                   echo "<b>{$user_name}: </b>";
-                   
-
-                   $desc = $vars['entity']->description;
-
-                   $desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@<a href="' . $vars['url'] . 'pg/thewire/$1">$1</a>',$desc);
-                       echo parse_urls($desc);
-               ?>
-               
                
-               <div class="clearfloat"></div>
-               </div>
-               <div class="note_date">
-               
-               <?php
-                       
+               <div class="wire_post_info">
+                       <a href="<?php echo $vars['url']; ?>pg/thewire/<?php echo $vars['entity']->getOwnerEntity()->username; ?>"><?php echo $user_name; ?></a>
+                       <?php
+                           $desc = $vars['entity']->description;
+                           $desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@<a href="' . $vars['url'] . 'pg/thewire/$1">$1</a>',$desc);
+                               echo parse_urls($desc);
+                       ?>
+                       <p class="entity_subtext">              
+                       <?php
                                echo elgg_echo("thewire:wired") . " " . sprintf(elgg_echo("thewire:strapline"),
                                                                friendly_time($vars['entity']->time_created)
                                );
-                               
                                echo " via " . elgg_echo($vars['entity']->method) . ".";
-                       
-               ?>
+                       ?>
+                       </p>            
                </div>
-               
-               
        </div>
 </div>
 <?php
-
-               }
-
+}
 ?>
\ No newline at end of file
index 6491af2edfa9197049aac559cc546af334a4a134..9f460458de97191d16a4417a5dc0d54718536c17 100644 (file)
         */
 
 ?>
-/* 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(<?php echo $vars['url']; ?>mod/thewire/graphics/thewire_speech_bubble.gif) no-repeat right bottom; 
-}
-.thewire-post {
-       background:#cccccc;
-       margin-bottom:10px;
+       background-image: url(<?php echo $vars['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("<?php echo $vars['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;
-}
+
 
index cf9ff15e66ccdb6db680f25b77ed891815a40dde..60d7914ea4fc4d9899909895c387d4db848a14b6 100644 (file)
                if (!empty($wire_user)) { $msg = '@' . $wire_user . ' '; } else { $msg = ''; }
 
 ?>
-<div class="post_to_wire">
+<div class="new_wire_post clearfloat">
 <h3><?php echo elgg_echo("thewire:doing"); ?></h3>
-<script>
-function textCounter(field,cntfield,maxlimit) {
-    // if too long...trim it!
-    if (field.value.length > maxlimit) {
-        field.value = field.value.substring(0, maxlimit);
-    } else {
-        // otherwise, update 'characters left' counter
-        cntfield.value = maxlimit - field.value.length;
-    }
-}
-</script>
-
-       <form action="<?php echo $vars['url']; ?>action/thewire/add" method="post" name="noteForm">
-                       <?php
-                           $display .= "<textarea name='note' value='' onKeyDown=\"textCounter(document.noteForm.note,document.noteForm.remLen1,140)\" onKeyUp=\"textCounter(document.noteForm.note,document.noteForm.remLen1,140)\" id=\"thewire_large-textarea\">{$msg}</textarea>";
-                $display .= "<div class='thewire_characters_remaining'><input readonly type=\"text\" name=\"remLen1\" size=\"3\" maxlength=\"3\" value=\"140\" class=\"thewire_characters_remaining_field\">";
-                echo $display;
-                echo elgg_echo("thewire:charleft") . "</div>";
-                               echo elgg_view('input/securitytoken');
-                       ?>
-                       <input type="hidden" name="method" value="site" />
-                       <input type="submit" value="<?php echo elgg_echo('save'); ?>" />
-       </form>
+<script type="text/javascript" src="<?php echo $vars['url']; ?>mod/thewire/views/default/thewire/scripts/counter.js"></script>
+<form action="<?php echo $vars['url']; ?>action/thewire/add" method="post" name="new_post">
+       <?php
+               $action_txt = elgg_echo('post');
+           $display .= "<textarea name='new_post_textarea' value='' onKeyDown=\"textCounter(document.new_post.new_post_textarea,document.new_post.remLen1,140)\" onKeyUp=\"textCounter(document.new_post.new_post_textarea,document.new_post.remLen1,140)\">{$msg}</textarea>";
+        $display .= "<input type='submit' class='action_button' value='{$action_txt}' />";
+        $display .= "<div class='character_count'><input readonly type=\"text\" name=\"remLen1\" size=\"3\" maxlength=\"3\" value=\"140\">";
+        echo $display;
+        echo elgg_echo("thewire:charleft") . "</div>";
+               echo elgg_view('input/securitytoken');
+       ?>
+       <input type="hidden" name="method" value="site" />
+</form>
 </div>
 <?php echo elgg_view('input/urlshortener'); ?>
\ No newline at end of file
index 890b8b9c37a27bea2d130a7a9213bb1106fadf88..fa8ccd76bd67b703df3d3b5c2986778c56bc92be 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
        /**
-        * New wire post view for the activity stream
+        * Latest wire post on profile activity page
         */
         
        $owner = $vars['entity']->guid;
        if($latest_wire){
                foreach($latest_wire as $lw){
                        $content = $lw->description;
-                       $time = "<span> (" . friendly_time($lw->time_created) . ")</span>";
+                       $time = "<p class='entity_subtext'> (" . friendly_time($lw->time_created) . ")</p>";
                }
        }
        
        if($latest_wire){
-               echo "<div class=\"profile_status\">";
+               echo "<div class='wire_post'><div class='wire_post_contents clearfloat radius8'>";
                echo $content;
                if($owner == $_SESSION['user']->guid)
-                       echo " <a class=\"status_update\" href=\"{$url_to_wire}\">update</a>";
+                       echo " <a class='action_button update small' href=\"{$url_to_wire}\">update</a>";
                echo $time;
-               echo "</div>";
+               echo "</div></div>";
        }
 ?>
\ No newline at end of file
index 3a1ebdbc53b4f7c4bcea20317f6dc65f404c6222..7486bd1de96fc7bcce03d2c6186208fc376f7283 100644 (file)
@@ -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 <info@elgg.com>
+ * @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
 
-/*
 <!-- Dynamic Version by: Nannette Thacker -->
 <!-- http://www.shiningstar.net -->
 <!-- Original by :  Ronnie T. Moore -->
@@ -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