Changeset 412 for trunk/app/controllers/subjects_controller.php
- Timestamp:
- 04/18/08 20:25:00 (9 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/subjects_controller.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/subjects_controller.php
r328 r412 10 10 class SubjectsController extends AppController 11 11 { 12 public $helpers = array('Ajax');12 public $helpers = array('Ajax', 'Gags'); 13 13 14 public $components = array('Portal');14 public $components = array('Portal'); 15 15 16 public function isAuthorized() 17 { 16 public function beforeFilter() 17 { 18 $this->Auth->allow(array('display', 'view','show')); 19 parent::beforeFilter(); 20 } 21 22 public function isAuthorized() 23 { 18 24 if (isset($this->params[Configure::read('Routing.admin')])) 19 25 { … … 24 30 } 25 31 return true; 26 }32 } 27 33 28 public function display()29 {34 public function display() 35 { 30 36 $this->layout = 'ajax'; 31 37 … … 42 48 $this->render('qs', 'ajax'); 43 49 44 }50 } 45 51 46 public function view($code)47 {52 public function view($code) 53 { 48 54 $this->layout = 'portal'; 49 55 … … 55 61 56 62 $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars 57 }63 } 58 64 59 public function show($subject_id)60 {65 public function show($subject_id) 66 { 61 67 $this->pageTitle = 'Karamelo :: Subject'; 62 68 $this->layout = 'default'; //$this->Blog->field; … … 70 76 71 77 $this->set('data', $this->Subject->findAll($conditions, $fields, $order)); 72 73 } 78 } 74 79 75 /** ==== ADMIN METHODS ==== */80 /** ==== ADMIN METHODS ==== */ 76 81 77 public function admin_listing()78 {82 public function admin_listing() 83 { 79 84 $this->layout = 'admin'; 80 85 $this->pageTitle = 'Subjects'; … … 82 87 $conditions = null; 83 88 $fields = array("id", "title", "code"); 84 $order = "title DESC";89 $order = "title ASC"; 85 90 86 91 $this->set('data', $this->Subject->findAll($conditions, $fields, $order));
