Changeset 488 for trunk/app/views/messages
- Timestamp:
- 05/14/08 14:52:22 (7 months ago)
- Location:
- trunk/app/views/messages
- Files:
-
- 1 added
- 3 modified
-
admin_compose.ctp (modified) (1 diff)
-
compose.ctp (modified) (3 diffs)
-
listing.ctp (modified) (1 diff)
-
sentmessages.ctp (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/views/messages/admin_compose.ctp
r330 r488 1 1 2 <br />3 2 <div class="barra">Write message to another MonoNeuron</div> 4 3 5 <div id="charging" style="display:none;"><?php echo $html->image('static/loading.gif', array("alt"=>"Loading")); ?></div>6 7 <div id="already">8 9 <?php10 if ( !$othAuth->user('username') )11 {12 $html->link('You are not logged in', '/users/login');13 exit();14 }15 16 echo $html->formTag(null, 'post', array('onsubmit'=>'return false'));17 18 echo $form->labelTag('Message/string', 'Search user:' ). '<br />';19 20 echo $html->input('Message/string', array("size" => 30, "maxlength" => 45));21 22 echo $ajax->submit('Search', array("url" => "/messages/search/",23 "update"=>"updater",24 "loading" => "Element.show('charging');Element.hide('updater')",25 "complete" => "Element.hide('charging');Effect.Appear('updater')"26 ));27 ?>28 </form>29 30 <br /><br />31 4 32 5 -
trunk/app/views/messages/compose.ctp
r487 r488 1 <div class="barra">Compose new message</div> 1 <?php 2 echo $javascript->link('controls'); 3 ?> 4 <style type="text/css"> 5 div.auto_complete { 6 position :absolute; 7 width :120px; 8 background-color :white; 9 border :1px solid #888; 10 margin :0; 11 padding :0; 12 } 13 14 div.auto_complete li { 15 margin : 0; 16 padding : 0; 17 color:#000; 18 list-style : none; 19 font-weight:bold; 20 } 21 li.selected { background-color: orange; } 22 </style> 2 23 3 24 <?php 4 echo $form->create('Message', array('onsubmit'=>'return false')); 5 echo $form->hidden('Message.sender_id', array("value"=>$cU['User']['id'])); 6 echo $form->hidden('Message.username', array("value"=>$cU['User']['username'] )); 25 e($html->div('barra', 'Compose new message')); 26 e($form->create('Message', array('action'=>'deliver','onsubmit'=>'return validateForm()'))); 7 27 ?> 8 28 <fieldset> … … 10 30 <?php 11 31 echo $form->label('Message.user_id', 'Send message to:' ) . '<br />'; 12 echo $ajax->autoComplete('Message.sendern', '/messages/autocomplete') .'<br />'; 13 echo $cU['User']['username'] . " escribe: <br />"; 14 echo $form->input('Message.title', array("size" => 35, "maxlength" => 50)) . "<br />"; 32 echo $ajax->autoComplete('Message.sendern', '/messages/autocomplete') .'<br />'; 33 echo $cU['User']['username'] . " writes: <br />"; 34 35 echo $form->input('Message.title', array("size"=>25, "maxlength"=>50)) . '<br />'; 15 36 16 37 echo $form->label('Message.body', 'Message:' ) . '<br />'; … … 19 40 ?> 20 41 </fieldset> 42 43 <script type="text/javascript"> 44 function validateForm() 45 { 46 var title = document.getElementById("MessageTitle"); 47 var body = document.getElementById("MessageBody"); 48 var email = document.getElementById("MessageEmail"); 49 50 if (name.value.length < 5) 51 { 52 alert('Name must have five letters at least'); 53 name.focus(); 54 return false; 55 56 } 57 58 if (username.value.length < 5) 59 { 60 alert('Username must have five letters at least'); 61 username.focus(); 62 return false; 63 } 64 65 var space = username.value.indexOf(" "); 66 67 //alert('at: ' + atpos); 68 69 if ( space > 0 ) 70 { 71 alert('Username can not contain spaces'); 72 username.focus(); 73 return false; 74 } 75 76 //check email 77 var atpos = email.value.indexOf("@"); //indexOf find something in your JavaScript string 78 var dotpos = email.value.indexOf("."); 79 80 //alert('at: ' + atpos); 81 82 if ( atpos < 1 || dotpos < 1 || email.value.length < 5) 83 { 84 alert('Mmmm, this email ' + email.value + ' does not look as a valid email'); 85 email.focus(); 86 return false; 87 } 88 89 if (agree.checked == false) 90 { 91 alert('You must do agree'); 92 return false; 93 } 94 95 return true; 96 } 97 </script> -
trunk/app/views/messages/listing.ctp
r485 r488 2 2 // die(debug($data)); 3 3 echo $html->link($html->image('admin/compose_on.gif', array("alt"=>"Compose New Message", "title"=>"Compose New Message")), 4 '/messages/compose', null, false, false); 4 '/messages/compose', null, false, false) . ' '; 5 6 echo $html->link($html->image('static/sent_icon.gif', array("alt"=>"Sent Messages", "title"=>"Sent Messages")), 7 '/messages/sentmessages', null, false, false); 5 8 6 9 echo $form->create('Message', array('delete', 'onsubmit'=>'return chkList();', 'name'=>'privmsg_list'));
