Changeset 485
- Timestamp:
- 05/14/08 00:45:34 (8 months ago)
- Location:
- trunk/app
- Files:
-
- 2 added
- 3 modified
-
controllers/messages_controller.php (modified) (2 diffs)
-
views/messages/autocomplete.ctp (added)
-
views/messages/compose.ctp (added)
-
views/messages/listing.ctp (modified) (1 diff)
-
views/users/register.ctp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/messages_controller.php
r484 r485 16 16 public function beforeFilter() 17 17 { 18 $this->Auth->allow(array('message', 'deliver', 'listing', 'compose', 'display', 'add', 'send' ));18 $this->Auth->allow(array('message', 'deliver', 'listing', 'compose', 'display', 'add', 'send', 'autocomplete')); 19 19 parent::beforeFilter(); 20 20 } … … 111 111 112 112 $this->Portal->statics(); // Charge Portal components aka Sidebars 113 } 114 115 public function autocomplete() 116 { 117 //Partial strings will come from the autocomplete field as 118 //$this->data['Post']['subject'] 119 120 $this->set('users', $this->Message->User->findAll("username LIKE '{$this->data['Message']['sendern']}%'")); 121 122 $this->layout = 'ajax'; 113 123 } 114 124 -
trunk/app/views/messages/listing.ctp
r483 r485 1 1 <?php 2 2 // die(debug($data)); 3 echo $html->link($html->image('admin/compose_on.gif', array("alt"=>"Compose New Message", "title"=>"Compose New Message")), '/messages/add', null, false, false); 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 5 5 6 echo $form->create('Message', array('delete', 'onsubmit'=>'return chkList();', 'name'=>'privmsg_list')); -
trunk/app/views/users/register.ctp
r415 r485 37 37 <br /><br /> 38 38 <?php echo $form->label('User.description', 'About you and your interests:' );?><br /> 39 <?php echo $form->textarea('User.description', array("rows"=> "4", "cols"=>"50")) ?>39 <?php echo $form->textarea('User.description', array("rows"=>4, "cols"=>50)) ?> 40 40 <br /><br /> 41 41 <?php echo $form->label('User.agree', 'I read the terms:' );?><br /> 42 <?php echo $form->checkbox('User.agree', array("value"=>1)); ?> 43 42 44 <?php echo $ajax->submit('Send', array("url" => "/users/insert/", 43 45 "update"=>"updater", 46 "before" => "return validateData();", 44 47 "loading" => "Element.show('charging');Element.hide('updater')", 45 48 "complete" => "Element.hide('charging');Effect.Appear('updater')" … … 49 52 </div> 50 53 51 <p>Please contact <a href="mailto:webmaster@conrad-college.edu">webmaster@conrad-college.edu</a> if you have doubts or comments about this registration process.</p> 54 <?php 55 echo $html->para(null, 56 'Please contact <a href="mailto:webmaster@conrad-college.edu">webmaster@conrad-college.edu</a> if you have doubts or comments about this registration process.'); 57 ?> 58 59 <script type="text/javascript"> 60 function validateData() 61 { 62 var pwd = document.getElementById("UserPwd"); 63 var name = document.getElementById("UserName"); 64 var username = document.getElementById("UserUsername"); 65 var email = document.getElementById("UserEmail"); 66 var agree = document.getElementById("UserAgree"); 67 68 if (name.value.length < 5) 69 { 70 alert('Name must have five letters at least'); 71 name.focus(); 72 return false; 73 74 } 75 76 if (username.value.length < 5) 77 { 78 alert('Username must have five letters at least'); 79 username.focus(); 80 return false; 81 } 82 83 var space = username.value.indexOf(" "); 84 85 //alert('at: ' + atpos); 86 87 if ( space > 0 ) 88 { 89 alert('Username can not contain spaces'); 90 username.focus(); 91 return false; 92 } 93 94 //check email 95 var atpos = email.value.indexOf("@"); //indexOf find something in your JavaScript string 96 var dotpos = email.value.indexOf("."); 97 98 //alert('at: ' + atpos); 99 100 if ( atpos < 1 || dotpos < 1 || email.value.length < 5) 101 { 102 alert('Mmmm, this email ' + email.value + ' does not look as a valid email'); 103 email.focus(); 104 return false; 105 } 106 107 if (agree.checked == false) 108 { 109 alert('You must do agree'); 110 return false; 111 } 112 113 return true; 114 } 115 </script>
