Changeset 776 for trunk

Show
Ignore:
Timestamp:
09/23/08 22:04:26 (2 months ago)
Author:
aarkerio
Message:

Test Unit fixed

Location:
trunk/app
Files:
5 modified

Legend:

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

    r775 r776  
    3737  } 
    3838  
    39   /**    ===== 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  } 
    56   
    57   // change status enabled/disabled actived 
    58   public function admin_change($comment_id, $status) 
    59   {  
     39 /**    ===== ADMIN METHODS ====== **/ 
     40 // change status enabled/disabled actived 
     41 public function admin_change($comment_id, $status) 
     42 {  
    6043    $this->data['Comment']['status'] = ($status == 0 ) ? 1 : 0; 
    6144      
     
    8770  { 
    8871    if ($this->Comment->del($comment_id)): 
    89        $this->msgFlash('Comment deleted', '/admin/comments/listing'); 
     72       $this->msgFlash(__('Comment deleted', true), '/admin/entries/comments/'); 
    9073    endif; 
    9174  } 
  • trunk/app/controllers/entries_controller.php

    r750 r776  
    9595  $order           = 'Entry.id DESC'; 
    9696  $limit           = 20; 
    97        
     97   
    9898  $entries = $this->Entry->findAll($conditions, $fields, $order, $limit); 
    99    
    10099  $this->set(compact('channelData', 'entries')); 
    101  
    102100 } 
    103101  
  • trunk/app/models/entry.php

    r734 r776  
    2424 public $hasMany = array('Comment' => 
    2525                         array('className'     => 'Comment', 
    26                                'conditions'    =>  null, 
     26                               'conditions'    => 'Comment.status = 1', 
    2727                               'order'         => 'Comment.created', 
    2828                               'limit'         => null, 
     
    5252 public function getComments($blogger_id) 
    5353 { 
     54  $this->unbindAll(); 
     55   
     56  $this->bindModel(array('hasMany' => array('Comment' => 
     57                         array('className'     => 'Comment', 
     58                               'conditions'    => null, 
     59                               'order'         => 'Comment.created', 
     60                               'limit'         => null, 
     61                               'foreignKey'    => 'entry_id', 
     62                               'dependent'     => true, 
     63                               'exclusive'     => false, 
     64                               'finderQuery'   => '' 
     65                         ) 
     66                  ))); 
     67 
    5468  $conditions   = array('Entry.user_id'=>$blogger_id); 
    5569  $fields       = array('Entry.title', 'Entry.id'); 
  • trunk/app/views/entries/admin_comments.ctp

    r594 r776  
    33//debug($data); 
    44foreach($data as $v): 
    5  $tmp  = $html->para(null, $html->link($v['Entry']['title'], 'http://'.$_SERVER['HTTP_HOST'].'/users/entry/'.$session->read('Auth.User.username').'/'.$v['Entry']['id'])); 
    6  
     5 $tmp  = $html->para(null, 'Entry: '.$html->link($v['Entry']['title'], 'http://'.$_SERVER['HTTP_HOST'].'/entries/view/'.$session->read('Auth.User.username').'/'.$v['Entry']['id']), array('style'=>'font-size:14pt;font-weigth:bold;')); 
     6  
    77 foreach($v['Comment'] as $c): 
    88   $st = $c['status'] == 1 ? __('Published', true) : __('Hidden', true); 
     
    1515 endforeach; 
    1616 
    17  echo $html->div(null, $tmp, array('style'=>'border:2px solid gray;margin-top:14px;padding:4px;')); 
     17 echo $html->div(null, $tmp, array('style'=>'border:1px dotted gray;margin-top:14px;padding:4px;')); 
    1818endforeach; 
    1919?> 
  • trunk/app/views/entries/admin_listing.ctp

    r637 r776  
    44echo $html->addCrumb('Control Panel', '/admin/entries/start'); 
    55echo $html->getCrumbs(' / ');  
    6  
    76echo $html->div('title_section', __('Entries', true));  
    87 
    9 echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))), '/admin/entries/add', null, false, false) . '     '.$html->link($html->image('static/forum.gif', array("alt"=>"See comments", "title"=>"See comments")), '/admin/comments/listing', null, false, false)); 
     8echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))), '/admin/entries/add', null, false, false) . '     '.$html->link($html->image('static/forum.gif', array('alt'=>__('See comments', true),'title'=>__('See comments', true))), '/admin/entries/comments', null, false, false)); 
    109 
    1110?>