Changeset 494 for trunk/app/controllers/components/portal.php
- Timestamp:
- 05/16/08 01:20:37 (7 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/components/portal.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/components/portal.php
r289 r494 14 14 App::import('Model', 'Banner'); 15 15 App::import('Model', 'User'); 16 16 App::import('Model', 'Vclassroom'); 17 17 18 class PortalComponent extends Object { 18 19 19 20 public function startup(&$controller) 20 21 { … … 26 27 public function statics() 27 28 { 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 32 35 $this->controller->set('Element', $Element); 33 36 34 37 return true; 35 38 } 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 37 50 private function lastEntries() { 38 51 … … 47 60 $this->Entry = new Entry; 48 61 49 return $this->Entry->findAll($conditions, $fields, $order, $limit); 50 62 return $this->Entry->findAll($conditions, $fields, $order, $limit); 51 63 } 52 64
