Changeset 660 for trunk/app/controllers
- Timestamp:
- 07/21/08 18:29:34 (4 months ago)
- Location:
- trunk/app/controllers
- Files:
-
- 2 modified
-
shares_controller.php (modified) (1 diff)
-
subjects_controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/shares_controller.php
r557 r660 51 51 } 52 52 53 /** 54 === ADMIN METHOD === 55 **/ 53 /** === ADMIN METHOD === **/ 56 54 public function admin_listing() 57 55 { 58 $this->pageTitle = $this->Auth->user('username') . '\'s Shares'; 59 60 $this->layout = 'admin'; 61 62 $conditions = array("Share.user_id"=>$this->Auth->user('id')); 63 $fields = array("id", "file", "description", "created", "secret", "public"); 64 $order = "Share.id DESC"; 65 $limit = 20; 66 67 $this->set('data', $this->Share->findAll($conditions, $fields, $order, $limit)); 56 $this->pageTitle = $this->Auth->user('username') . '\'s Shares'; 57 58 $this->set('subjects',Set::combine($this->Share->Subject->find('all',array('order'=>'title')),"{n}.Subject.id","{n}.Subject.title")); 59 60 $this->layout = 'admin'; 61 62 $conditions = array("Share.user_id"=>$this->Auth->user('id')); 63 $fields = array("id", "file", "description", "created", "secret", "public"); 64 $order = "Share.id DESC"; 65 $limit = 20; 66 67 $this->set('data', $this->Share->findAll($conditions, $fields, $order, $limit)); 68 68 } 69 69 -
trunk/app/controllers/subjects_controller.php
r540 r660 3 3 * Karamelo E-Learning Platform 4 4 * Manuel Montoya 2002-2008 5 * GPLv3 manuel<a t>mononeurona<punto>org5 * GPLv3 manuel<arroba>mononeurona<punto>org 6 6 */ 7 7 … … 40 40 public function view($code) 41 41 { 42 $this->layout = 'portal'; 43 44 $this->title = 'Subject'; 42 $this->layout = 'portal'; 45 43 46 $conditions = array("Subject.code"=>$code); 44 $this->Portal->statics(); // Charge Portal components aka Sidebars 45 46 $this->title = __('Subject', true); 47 47 48 $this->set('data', $this->Subject->find($conditions, null, null, 2));49 50 $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars48 $conditions = array('Subject.code'=>$code); 49 50 $this->set('data', $this->Subject->find($conditions)); 51 51 } 52 52 53 public function show($subject_id)54 {55 $this->pageTitle = 'Karamelo :: Subject';56 $this->layout = 'default'; //$this->Blog->field;57 $conditions = array("Subject.id"=>$subject_id);58 $fields = array("Subject.id", "Subject.title", "Subject.code");59 $order = "Subject.title DESC";60 61 $this->set('subjects', $this->Portal->cms()); // Using Portal component62 63 $this->set('randomQuote', $this->Portal->quote()); // quote footer64 65 $this->set('data', $this->Subject->findAll($conditions, $fields, $order));66 }67 53 68 54 /** ==== ADMIN METHODS ==== */
