Changeset 640
- Timestamp:
- 07/10/08 22:51:44 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 7 modified
-
controllers/forums_controller.php (modified) (1 diff)
-
controllers/topics_controller.php (modified) (2 diffs)
-
controllers/vclassrooms_controller.php (modified) (1 diff)
-
models/vclassroom.php (modified) (2 diffs)
-
views/elements/lastentries.ctp (modified) (1 diff)
-
views/entries/display.ctp (modified) (1 diff)
-
views/topics/display.ctp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/forums_controller.php
r627 r640 44 44 { 45 45 // student belongst to this class? 46 if ( $this->Auth->user() && $this->Auth->user('group_id') == 3):46 if ( $this->Auth->user() ): 47 47 $this->set('belongs', $this->Forum->Vclassroom->belongs($this->Auth->user('id'), $vclassroom_id)); 48 48 else: -
trunk/app/controllers/topics_controller.php
r564 r640 25 25 public function display($user_id, $forum_id, $topic_id) 26 26 { 27 $this->pageTitle = 'Discussion';27 $this->pageTitle = __('Discussion', true); 28 28 29 $this->layout = $this->Edublog->layout($user_id);29 $this->layout = $this->Edublog->layout($user_id); 30 30 31 $this->Edublog->blog($user_id); 32 31 $this->Edublog->blog($user_id); 32 33 $vclassroom_id = $this->Topic->Forum->field('vclassroom_id', array('Forum.id'=>$forum_id)); 34 // student belongst to this class? 35 if ( $this->Auth->user() ): 36 $this->set('belongs', $this->Topic->Forum->Vclassroom->belongs($this->Auth->user('id'), $vclassroom_id)); 37 else: 38 $this->set('belongs', false); 39 endif; 40 33 41 $conditions = array("Topic.status"=>1, "Topic.id"=>$topic_id); 34 42 $fields = null; … … 38 46 $this->Topic->Forum->unbindModel(array('hasMany'=>array('Topic'))); 39 47 $data = $this->Topic->find($conditions, $fields, $order, 2); 40 //die(debug($data));48 41 49 $this->set('data',$data); 42 50 -
trunk/app/controllers/vclassrooms_controller.php
r624 r640 71 71 72 72 // student belongs to this class? 73 if ( $this->Auth->user() && $this->Auth->user('group_id') == 3):73 if ( $this->Auth->user()): 74 74 $this->set('belongs', $this->Vclassroom->belongs($this->Auth->user('id'), $vclassroom_id)); 75 75 else: -
trunk/app/models/vclassroom.php
r619 r640 20 20 21 21 public $hasMany = array('Forum' => 22 array('className' => 'Forum',22 array('className' => 'Forum', 23 23 'conditions' => null, 24 24 'order' => null, … … 509 509 */ 510 510 public function belongs($user_id, $vclassroom_id) 511 { 512 $conditions = array("UsersVclassroom.user_id"=>$user_id, "UsersVclassroom.vclassroom_id"=>$vclassroom_id); 511 { 512 $conditions = array('Vclassroom.id'=>$vclassroom_id); 513 514 $teacher_id = $this->field('Vclassroom.user_id',$conditions); 515 516 if ($teacher_id == $user_id ): // teacher wnats to see his/her own vclass 517 return true; 518 endif; 519 520 $conditions = array('UsersVclassroom.user_id'=>$user_id, 'UsersVclassroom.vclassroom_id'=>$vclassroom_id); 513 521 514 522 $data = $this->UsersVclassroom->field('UsersVclassroom.user_id',$conditions); -
trunk/app/views/elements/lastentries.ctp
r240 r640 1 1 <?php 2 echo $html->image('static/blogactiv.gif', array("alt"=>"Teachers Blogging", "title"=>"Teachers Blogging", "style"=>"margin-right:5px 0 10px 0")); 2 if ( count($Element['Lentry']) > 0): 3 echo $html->image('static/blogactiv.gif',array("alt"=>"Teachers Blogging", "title"=>"Teachers Blogging", "style"=>"margin-right:5px 0 15px 0")); 4 endif; 3 5 4 echo "<br />"; 5 6 foreach ($Element["Lentry"] as $key => $val)7 { 8 echo '<div style="margin-top:3px;padding-left:2px;">' . $html->link($val['Entry']['title'], '/users/entry/'.$val['User']['username'].'/'.$val['Entry']['id']) . " ";9 echo '<span style="font-size:6pt">'.$val['User']['username'].'</span></div>';10 } 6 foreach ($Element['Lentry'] as $val): 7 echo $html->div(null, $html->link($val['Entry']['title'], 8 '/entries/view/'.$val['User']['username'].'/'.$val['Entry']['id']) . 9 ' <span style="font-size:6pt">'.$val['User']['username'].'</span>', 10 aa('style', 'margin-top:4px;padding-left:2px') 11 ); 12 endforeach; 11 13 ?> -
trunk/app/views/entries/display.ctp
r635 r640 22 22 endforeach; 23 23 24 $paginator->options(array('url' => $ val['User']['username']));24 $paginator->options(array('url' => $blog['User']['username'])); 25 25 26 26 $t = $html->div(null,$paginator->prev('« Previous ',null,null,array('class'=>'disabled')),array('style'=>'width:100px;float:left')); -
trunk/app/views/topics/display.ctp
r562 r640 12 12 echo $html->para(null, '<b>Discussion topic:</b> '.$data['Topic']['message']); 13 13 14 if ( $ session->check('Auth.User')):14 if ( $belongs === true ): 15 15 /* 16 16 $tmp = $html->link( // add topic … … 49 49 $int = 1; 50 50 51 foreach ($data['Reply'] as $val) 52 { 51 foreach ($data['Reply'] as $val): 53 52 $i = $int++; 54 53 $tmp = '<b>'. $i . '.-</b> '; … … 60 59 echo $html->div('reply', $tmp); 61 60 62 }61 endforeach; 63 62 echo '</div>'; 64 63
