Changeset 762 for trunk

Show
Ignore:
Timestamp:
09/07/08 21:53:53 (2 months ago)
Author:
aarkerio
Message:

Update models

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/chats_controller.php

    r738 r762  
    2222 
    2323    if ( $this->Auth->user() ): 
    24           $this->Auth->allow(array('display', 'add')); 
     24          $this->Auth->allow(array('display', 'getMessages')); 
    2525    endif; 
    2626 } 
     
    4444 } 
    4545 
     46 public function getMessages($vclassroom_id) 
     47 { 
     48   $conditions = array('Chat.vclassroom_id'=>$vclassroom_id); 
     49   $fields = array('Chat.message', 'Chat.created', 'User.username');; 
     50   $order = 'Chat.id DESC'; 
     51   $limit = 15; 
     52      
     53   $this->set('data', $this->Chat->findAll($conditions, $fields, $order, $limit)); 
     54   $this->render('getmessages', 'ajax'); 
     55 } 
    4656 /*=== ADMIN  METHODS ===*/ 
    4757 public function admin_listing()