Changeset 660 for trunk/app/controllers

Show
Ignore:
Timestamp:
07/21/08 18:29:34 (4 months ago)
Author:
aarkerio
Message:

Update general

Location:
trunk/app/controllers
Files:
2 modified

Legend:

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

    r557 r660  
    5151    } 
    5252 
    53   /** 
    54    === ADMIN METHOD === 
    55   **/ 
     53 /**   === ADMIN METHOD ===  **/ 
    5654 public function admin_listing() 
    5755 {    
    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));  
    6868 } 
    6969     
  • trunk/app/controllers/subjects_controller.php

    r540 r660  
    33*  Karamelo E-Learning Platform 
    44*  Manuel Montoya 2002-2008 
    5 *  GPLv3 manuel<at>mononeurona<punto>org 
     5*  GPLv3 manuel<arroba>mononeurona<punto>org 
    66*/  
    77  
     
    4040 public function view($code) 
    4141 {   
    42       $this->layout    = 'portal'; 
    43       
    44       $this->title     = 'Subject'; 
     42   $this->layout    = 'portal'; 
    4543       
    46       $conditions = array("Subject.code"=>$code); 
     44   $this->Portal->statics(); // Charge Portal components aka Sidebars 
     45 
     46   $this->title     = __('Subject', true); 
    4747       
    48       $this->set('data', $this->Subject->find($conditions, null, null, 2)); 
    49        
    50       $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars 
     48   $conditions = array('Subject.code'=>$code); 
     49    
     50   $this->set('data', $this->Subject->find($conditions)); 
    5151 } 
    5252    
    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 component 
    62          
    63         $this->set('randomQuote', $this->Portal->quote()); // quote footer 
    64          
    65         $this->set('data', $this->Subject->findAll($conditions, $fields, $order)); 
    66   } 
    6753    
    6854  /** ==== ADMIN METHODS ==== */