Show
Ignore:
Timestamp:
04/18/08 20:25:00 (9 months ago)
Author:
aarkerio
Message:

Discussions fixed

Files:
1 modified

Legend:

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

    r328 r412  
    1010class SubjectsController extends AppController 
    1111 
    12    public $helpers       = array('Ajax'); 
     12 public $helpers       = array('Ajax', 'Gags'); 
    1313    
    14    public $components    = array('Portal'); 
     14 public $components    = array('Portal'); 
    1515    
    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 { 
    1824       if (isset($this->params[Configure::read('Routing.admin')])) 
    1925       { 
     
    2430       } 
    2531   return true; 
    26    } 
     32 } 
    2733                                                             
    28    public function display() 
    29     
     34 public function display() 
     35  
    3036      $this->layout    = 'ajax'; 
    3137       
     
    4248      $this->render('qs', 'ajax'); 
    4349       
    44    } 
     50 } 
    4551    
    46    public function view($code) 
    47     
     52 public function view($code) 
     53  
    4854      $this->layout    = 'portal'; 
    4955      
     
    5561       
    5662      $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars 
    57    } 
     63 } 
    5864    
    59    public function show($subject_id) 
    60     {    
     65 public function show($subject_id) 
     66 {    
    6167        $this->pageTitle = 'Karamelo :: Subject'; 
    6268        $this->layout    = 'default'; //$this->Blog->field; 
     
    7076         
    7177        $this->set('data', $this->Subject->findAll($conditions, $fields, $order)); 
    72          
    73     } 
     78  } 
    7479    
    75    /** ==== ADMIN METHODS ==== */ 
     80  /** ==== ADMIN METHODS ==== */ 
    7681    
    77    public function admin_listing() 
    78    { 
     82  public function admin_listing() 
     83  { 
    7984      $this->layout    = 'admin'; 
    8085      $this->pageTitle = 'Subjects'; 
     
    8287      $conditions = null; 
    8388      $fields     = array("id", "title", "code"); 
    84       $order      = "title DESC"; 
     89      $order      = "title ASC"; 
    8590       
    8691      $this->set('data', $this->Subject->findAll($conditions, $fields, $order));