- Timestamp:
- 04/09/08 23:53:39 (9 months ago)
- Location:
- trunk/app
- Files:
-
- 17 modified
-
. (modified) (1 prop)
-
config (modified) (1 prop)
-
controllers/images_controller.php (modified) (2 diffs)
-
controllers/vclassrooms_controller.php (modified) (3 diffs)
-
models/vclassroom.php (modified) (1 diff)
-
tmp (modified) (1 prop)
-
tmp/cache (modified) (1 prop)
-
tmp/cache/models (modified) (1 prop)
-
views/images/admin_listing.ctp (modified) (1 diff)
-
views/vclassrooms/admin_members.ctp (modified) (1 diff)
-
views/vclassrooms/show.ctp (modified) (3 diffs)
-
webroot/files/podcasts (modified) (1 prop)
-
webroot/files/userfiles (modified) (1 prop)
-
webroot/img/avatars (modified) (1 prop)
-
webroot/img/imgusers (modified) (1 prop)
-
webroot/img/imgusers/aarkerio_9.jpg (modified) (previous)
-
webroot/img/imgusers/thumbs (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app
- Property svn:ignore deleted
-
trunk/app/config
- Property svn:ignore deleted
-
trunk/app/controllers/images_controller.php
r346 r375 4 4 * Manuel Montoya 2002-2008 5 5 * Chipotle Software TM 6 * GPL manuel<arroba>mononeurona<punto>org6 * GPLv3 manuel<arroba>mononeurona<punto>org 7 7 */ 8 8 … … 113 113 if ( $type != "image/jpeg" && $type != "image/pjpeg" && $type != "image/png" && $type != "image/gif") 114 114 { /** is this a valid file? */ 115 $ErrMsg = "<h1>ERROR</h1> the file $imgfile_name $imgfile is not valid.<br>";116 $ErrMsg .= "<p>Only .jpg, .gif or .png files<br ><br>";115 $ErrMsg = "<h1>ERROR</h1> the file $imgfile_name is not valid.<br />"; 116 $ErrMsg .= "<p>Only .jpg, .gif or .png files<br /><br />"; 117 117 $ErrMsg .= "Current type file: " . $type . "</p>\n"; 118 118 -
trunk/app/controllers/vclassrooms_controller.php
r370 r375 31 31 return false; 32 32 } 33 33 34 34 public function show($user_id, $id) 35 35 { … … 41 41 $fields = array("Vclassroom.id", "Vclassroom.name", "Vclassroom.description", "Vclassroom.subject_id", "Vclassroom.created", "Vclassroom.user_id", "Subject.title"); 42 42 43 $this->set('data', $this->Vclassroom->find($conditions , null, null, 2));43 $this->set('data', $this->Vclassroom->find($conditions)); 44 44 } 45 45 46 46 public function jointoclass() 47 47 { 48 if (!empty($this->data[ "Vclassroom"]))48 if (!empty($this->data['UsersVclassroom'])) 49 49 { 50 50 // get the secret code by this classroom 51 $code = $this->Vclassroom->field('secret', array("Vclassroom.id"=>$this->data[' Vclassroom']['vclassroom_id']));52 53 if ($code != $this->data[' Vclassroom']['code'] || $code == null) //code is correct ?51 $code = $this->Vclassroom->field('secret', array("Vclassroom.id"=>$this->data['UsersVclassroom']['vclassroom_id'])); 52 53 if ($code != $this->data['UsersVclassroom']['code'] || $code == null) //code is correct ? 54 54 { 55 55 $this->set('msg', 'Code is incorrect'); 56 56 $this->render('jointoclass', 'ajax'); 57 exit(); 58 } 59 elseif($this->chkMember($this->data['Vclassroom']['vclassroom_id'])) // the student is already member in this class? 57 } 58 elseif($this->Vclassroom->chkMember($this->data['UsersVclassroom']['vclassroom_id'], $this->Auth->user('id'))) // the student is already member in this class? 60 59 { 61 60 $this->set('msg', 'You are already member of this class!'); 62 61 $this->render('jointoclass', 'ajax'); 63 exit();64 65 62 } 66 63 else 67 64 { 68 if ($this->Vclassroom->addAssoc('User', $this->Auth->user('id'), $this->data["Vclassroom"]["vclassroom_id"])) 65 $this->data['UsersVclassroom']['user_id'] = $this->Auth->user('id'); 66 67 $this->Vclassroom->UsersVclassroom->create(); 68 69 if ($this->Vclassroom->UsersVclassroom->save($this->data['UsersVclassroom'])) 69 70 { 70 71 $this->set('msg', 'You have joined to this class succesfully!'); 71 72 $this->render('jointoclass', 'ajax'); 72 exit();73 73 } 74 74 } … … 178 178 $this->set('data', $this->Vclassroom->find($conditions)); 179 179 } 180 180 public function admin_unlinkstudent() 181 { 182 183 } 181 184 public function admin_add($ecourse_id=null) 182 185 { -
trunk/app/models/vclassroom.php
r370 r375 39 39 ) 40 40 ); 41 /*42 'Webquest' =>43 array('className' => 'Webquest',44 'joinTable' => 'vclassrooms_webquests',45 'foreignKey' => 'vclassroom_id',46 'associationForeignKey' => 'webquest_id',47 'conditions' => '',48 'order' => '',49 'limit' => '',50 'unique' => true,51 'finderQuery' => '',52 'deleteQuery' => ''53 ),54 'Treasure' =>55 array('className' => 'Treasure',56 'joinTable' => 'treasures_vclassrooms',57 'foreignKey' => 'vclassroom_id',58 'associationForeignKey' => 'treasure_id',59 'conditions' => '',60 'order' => '',61 'limit' => '',62 'unique' => true,63 'finderQuery' => '',64 'deleteQuery' => ''65 ),66 'User' =>67 array('className' => 'User',68 'joinTable' => 'vclassrooms_users',69 'foreignKey' => 'vclassroom_id',70 'associationForeignKey' => 'user_id',71 'conditions' => '',72 'order' => '',73 'limit' => '',74 'unique' => true,75 'finderQuery' => '',76 'deleteQuery' => ''77 )78 );*/79 41 //Check if the user already exist in the classroom 80 p rotected function chkMember($vclassroom_id)42 public function chkMember($vclassroom_id, $user_id) 81 43 { 82 $already_member = false;83 84 $conditions = array('"Vclassroom"."id"'=>$vclassroom_id);85 44 86 $data = $this->find($conditions); 45 $conditions = array('"UsersVclassroom"."vclassroom_id"'=>$vclassroom_id, '"UsersVclassroom"."user_id"'=>$user_id); 46 47 $data = $this->UsersVclassroom->field('user_id', $conditions); 87 48 88 foreach ($data['User'] as $user)49 if ($data == null) 89 50 { 90 if ($user['id'] == $this->Auth->user('id')) 91 { 92 $already_member = true; // yes, is already member 93 } 51 return false; 94 52 } 95 return $already_member; 53 else 54 { 55 return true; 56 } 96 57 } 97 58 98 public $validate = array(59 public $validate = array( 99 60 'name' => VALID_NOT_EMPTY, 100 61 'user_id' => VALID_NOT_EMPTY, -
trunk/app/tmp
- Property svn:ignore deleted
-
trunk/app/tmp/cache
- Property svn:ignore deleted
-
trunk/app/tmp/cache/models
- Property svn:ignore deleted
-
trunk/app/views/images/admin_listing.ctp
r352 r375 19 19 <td style="text-align:left;" colspan="5"> 20 20 <?php 21 echo $form->create('Image', array( ""=>"admin_add", "enctype"=>"multipart/form-data"));21 echo $form->create('Image', array('action'=>'add', 'enctype'=>'multipart/form-data')); 22 22 echo $form->hidden('Image.return', array('value'=>'/admin/images/listing/'.$return)); 23 23 ?> -
trunk/app/views/vclassrooms/admin_members.ctp
r370 r375 44 44 { 45 45 // die(debug($val)); 46 echo '<div style="padding:6px 3px 28px 4px;margin:10px 0 5px 0;border:1px dotted gray;">';47 echo '<b>Name</b>: ' . $val['name'] . ' ' . '<b> Username</b>:' . $val['username']. '<br />';48 echo 'Email: ' . $html->link($val['email'], 'mailto:'.$val['email']) . '<br />';49 echo $html->div('butonright', $gags->confirmDel($val['id'], 'vclassmembers'));50 echo '</div>';46 $tmp = '<b>Name</b>: ' . $val['name'] . ' ' . '<b> Username</b>:' . $val['username'] . '<br />'; 47 $tmp .= 'Email: ' . $html->link($val['email'], 'mailto:'.$val['email']) . '<br />'; 48 $tmp .= $html->div('butonright', $gags->confirmDel($val['id'], 'Vclassroom')); 49 50 echo $html->div('divgray', $tmp); 51 51 } 52 52 -
trunk/app/views/vclassrooms/show.ctp
r346 r375 1 1 <?php 2 //exit(var_dump($data));2 exit(debug($data)); 3 3 ?> 4 4 <h2>Classrooms</h2> … … 6 6 <?php 7 7 echo '<h1>' . $data['Vclassroom']['name'] . '</h1>'; 8 echo '<p style="font-size:7pt;"><b>Created:</b> ' . $data['Vclassroom']['created'] . '</p> '; 9 echo '<p><b>Subject</b>: ' .$data['Ecourse']['Subject']['title'] . "</p>"; 10 11 echo '<p><b>Course description</b>: <br />'; 8 echo $html->para(null, '<b>Created:</b> ' . $data['Vclassroom']['created']); 9 echo $html->para(null, '<b>Subject</b>: ' .$data['Ecourse']['Subject']['title']); 10 echo $html->para(null, '<b>Course description</b>:'. $data['Ecourse']['description']); 12 11 13 echo $data['Ecourse']['description'] . "</p>"; 14 15 if ( isset( $cU['User']['id'] ) ) // a student is login in so, show "Join" button 12 if ( isset( $cU['User']['id'] ) && $cU['User']['group_id'] == 3 ) // a student is login in so, show "Join" button 16 13 { 17 14 echo $ajax->form(); 18 15 19 echo $html->hidden('Vclassroom/vclassroom_id', array("value" => $data['Vclassroom']['id'])); 20 21 echo '<p><p>'; 22 23 echo $html->input('Vclassroom/code', array("size" => 6, "maxlength"=>6)); 24 16 echo $form->hidden('UsersVclassroom.vclassroom_id', array('value'=>$data['Vclassroom']['id'])); 17 echo $form->input('UsersVclassroom.code', array('size' => 6, 'maxlength'=>6, 'title'=>'Secret code', 'between'=>': ')); 25 18 echo $ajax->submit('Join to this class '.$cU['User']['username'], array("url" => "/vclassrooms/jointoclass/", 26 19 "update"=>"updater", … … 28 21 "complete" => "Element.hide('charging');Effect.Appear('updater')" 29 22 )); 30 echo $ajax->div('updater'); 31 echo $ajax->divEnd('updater'); 23 24 // empty ajax div 25 echo $ajax->div('updater') . $ajax->divEnd('updater'); 32 26 } 33 27 else -
trunk/app/webroot/files/podcasts
- Property svn:ignore deleted
-
trunk/app/webroot/files/userfiles
- Property svn:ignore deleted
-
trunk/app/webroot/img/avatars
- Property svn:ignore deleted
-
trunk/app/webroot/img/imgusers
- Property svn:ignore deleted
-
trunk/app/webroot/img/imgusers/thumbs
- Property svn:ignore deleted
