Changeset 775 for trunk/app/controllers

Show
Ignore:
Timestamp:
09/23/08 21:41:15 (2 months ago)
Author:
aarkerio
Message:

Test Unit fixed

Location:
trunk/app/controllers
Files:
2 modified

Legend:

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

    r696 r775  
    3333      if ($this->Comment->save($this->data)): 
    3434           $this->msgFlash(__('Comment added', true), $this->data['Comment']['redirect_to'].'/#comments'); 
    35       else: 
    36            $this->flash('Problem, please report', $this->data['Comment']['redirect_to'].'/#comments'); 
    3735      endif; 
    3836    endif; 
     
    4038  
    4139  /**    ===== ADMIN METHODS ====== **/ 
     40 public function admin_listing($paginate=0, $limit=20) 
     41 { 
     42   $this->layout    = 'admin'; 
     43 
     44   $this->pageTitle = __('Comments on entries', true); 
     45 
     46   //$this->Comment->bindModel(array('belongsTo'=> array('News' =>array('className'=> 'News', 'foreignKey'=> 'new_id' ))));    
     47    
     48   $this->paginate['fields'] = array('Comment.id','Entry.id','Entry.title','Comment.id','Comment.comment', 'Comment.created', 'Comment.user_id', 'Comment.status', 'User.username');  
     49   $this->paginate['conditions']   = null; 
     50   $this->paginate['order']        = "Comment.id DESC"; 
     51   $this->paginate['limit']        = 30; 
     52   $data = $this->paginate('Comment'); 
     53   $this->set(compact('data')); 
     54     
     55 } 
    4256  
    4357  // change status enabled/disabled actived 
  • trunk/app/controllers/discussions_controller.php

    r696 r775  
    8989 
    9090    //Do not pass any args to send()  
    91     if ( $this->Email->send() )  
    92     { 
    93             return true;  
    94     }  
    95     else 
    96     { 
    97             return false; 
    98     } 
     91    if ( $this->Email->send() ): 
     92        return true; 
     93    else: 
     94         return false; 
     95    endif; 
    9996 } 
    10097