Show
Ignore:
Timestamp:
05/16/08 01:20:37 (7 months ago)
Author:
aarkerio
Message:

Message interfase

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/components/portal.php

    r289 r494  
    1414App::import('Model', 'Banner'); 
    1515App::import('Model', 'User'); 
    16   
     16App::import('Model', 'Vclassroom');  
     17 
    1718class PortalComponent extends Object { 
    18   
     19 
    1920 public function startup(&$controller)  
    2021 { 
     
    2627 public function statics()  
    2728 { 
    28      $Element["Lentry"]      = $this->lastEntries(); 
    29      $Element["Quote"]       = $this->randomQuote(); 
    30      $Element["rankLessons"] = $this->rankLessons(); 
    31      $Element["Poll"]        = $this->poll(); 
     29     $Element['Lentry']       = $this->lastEntries(); 
     30     $Element['Quote']        = $this->randomQuote(); 
     31     $Element['rankLessons']  = $this->rankLessons(); 
     32     $Element['Poll']         = $this->poll(); 
     33     $Element['Vclassrooms']  = $this->vclassrooms(); 
     34 
    3235     $this->controller->set('Element', $Element); 
    3336 
    3437     return true; 
    3538 } 
    36   
     39 
     40 private function vclassrooms()  
     41 { 
     42   if ( $this->controller->Auth->user() && $this->controller->Auth->user('group_id') == 3): 
     43           $this->Vclassroom = new Vclassroom; 
     44           return $this->Vclassroom->getList( $this->controller->Auth->user('id') ); 
     45   else: 
     46           return null; 
     47   endif; 
     48 } 
     49 
    3750 private function lastEntries() { 
    3851    
     
    4760   $this->Entry = new Entry; 
    4861    
    49    return $this->Entry->findAll($conditions, $fields, $order, $limit); 
    50   
     62   return $this->Entry->findAll($conditions, $fields, $order, $limit);  
    5163 } 
    5264