]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
put message form on inbox and outbox
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 24 Sep 2008 20:41:31 +0000 (16:41 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 24 Sep 2008 20:41:31 +0000 (16:41 -0400)
darcs-hash:20080924204131-5ed1f-099c73720b3a4f2263ca28566fcd6b4c809fd4ab.gz

actions/newmessage.php
lib/mailbox.php
lib/util.php

index f6c4e31acc813aa4bd6ac77b8d29b7343f6e4846..25ce6c694d0a1c1b3ad0be7791db7bf372c710d3 100644 (file)
@@ -92,43 +92,8 @@ class NewmessageAction extends Action {
                list($content, $user, $to) = $params;
                
                assert(!is_null($user));
-               
-               common_element_start('form', array('id' => 'message_form',
-                                                                                  'method' => 'post',
-                                                                                  'action' => $this->self_url()));
-               
-               $mutual_users = $user->mutuallySubscribedUsers();
-               
-               $mutual = array();
-               
-               while ($mutual_users->fetch()) {
-                       if ($mutual_users->id != $user->id) {
-                               $mutual[$mutual_users->id] = $mutual_users->nickname;
-                       }
-               }
 
-               $mutual_users->free();
-               unset($mutual_users);
-
-               common_dropdown('to', _('To'), $mutual, NULL, FALSE, $to->id);
-               
-               common_element_start('p');
-               
-               common_element('textarea', array('id' => 'message_content',
-                                                                                'cols' => 60,
-                                                                                'rows' => 3,
-                                                                                'name' => 'content'),
-                                          ($content) ? $content : '');
-                                               
-               common_element('input', array('id' => 'message_send',
-                                                                         'name' => 'message_send',
-                                                                         'type' => 'submit',
-                                                                         'value' => _('Send')));
-               
-               common_hidden('token', common_session_token());
-               
-               common_element_end('p');
-               common_element_end('form');
+               common_message_form($content, $user, $to);
        }
 
        function show_form($msg=NULL) {
index 42eeee97ea984f90d5b99894ce9152685e9bfe69..4ed8d17582a6d53d40f71f902a8676a09c88f853 100644 (file)
@@ -69,12 +69,10 @@ class MailboxAction extends PersonalAction {
        }
 
        function show_top() {
+
+               $cur = common_current_user();
                
-               $inst = $this->get_instructions();
-               $output = common_markup_to_html($inst);
-               common_element_start('div', 'instructions');
-               common_raw($output);
-               common_element_end('div');
+               common_message_form(NULL, $cur, NULL);
                
                $this->views_menu();
        }
index e663eb861c41b41bbd6f0d53ef70c8007c4f4fd1..624d3b7e706b935ff2a22a920ac572c6411b40c5 100644 (file)
@@ -1688,3 +1688,43 @@ function common_keyize($str) {
        $str = preg_replace('/\s/', '_', $str);
        return $str;
 }
+
+function common_message_form($content, $user, $to) {
+       
+       common_element_start('form', array('id' => 'message_form',
+                                                                          'method' => 'post',
+                                                                          'action' => $this->self_url()));
+       
+       $mutual_users = $user->mutuallySubscribedUsers();
+       
+       $mutual = array();
+       
+       while ($mutual_users->fetch()) {
+               if ($mutual_users->id != $user->id) {
+                       $mutual[$mutual_users->id] = $mutual_users->nickname;
+               }
+       }
+       
+       $mutual_users->free();
+       unset($mutual_users);
+       
+       common_dropdown('to', _('To'), $mutual, NULL, FALSE, $to->id);
+       
+       common_element_start('p');
+       
+       common_element('textarea', array('id' => 'message_content',
+                                                                        'cols' => 60,
+                                                                        'rows' => 3,
+                                                                        'name' => 'content'),
+                                  ($content) ? $content : '');
+       
+       common_element('input', array('id' => 'message_send',
+                                                                 'name' => 'message_send',
+                                                                 'type' => 'submit',
+                                                                 'value' => _('Send')));
+       
+       common_hidden('token', common_session_token());
+       
+       common_element_end('p');
+       common_element_end('form');
+}
\ No newline at end of file