- Timestamp:
- 09/23/08 22:04:26 (2 months ago)
- Location:
- trunk/app
- Files:
-
- 5 modified
-
controllers/comments_controller.php (modified) (2 diffs)
-
controllers/entries_controller.php (modified) (1 diff)
-
models/entry.php (modified) (2 diffs)
-
views/entries/admin_comments.ctp (modified) (2 diffs)
-
views/entries/admin_listing.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/comments_controller.php
r775 r776 37 37 } 38 38 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 { 60 43 $this->data['Comment']['status'] = ($status == 0 ) ? 1 : 0; 61 44 … … 87 70 { 88 71 if ($this->Comment->del($comment_id)): 89 $this->msgFlash( 'Comment deleted', '/admin/comments/listing');72 $this->msgFlash(__('Comment deleted', true), '/admin/entries/comments/'); 90 73 endif; 91 74 } -
trunk/app/controllers/entries_controller.php
r750 r776 95 95 $order = 'Entry.id DESC'; 96 96 $limit = 20; 97 97 98 98 $entries = $this->Entry->findAll($conditions, $fields, $order, $limit); 99 100 99 $this->set(compact('channelData', 'entries')); 101 102 100 } 103 101 -
trunk/app/models/entry.php
r734 r776 24 24 public $hasMany = array('Comment' => 25 25 array('className' => 'Comment', 26 'conditions' => null,26 'conditions' => 'Comment.status = 1', 27 27 'order' => 'Comment.created', 28 28 'limit' => null, … … 52 52 public function getComments($blogger_id) 53 53 { 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 54 68 $conditions = array('Entry.user_id'=>$blogger_id); 55 69 $fields = array('Entry.title', 'Entry.id'); -
trunk/app/views/entries/admin_comments.ctp
r594 r776 3 3 //debug($data); 4 4 foreach($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 7 7 foreach($v['Comment'] as $c): 8 8 $st = $c['status'] == 1 ? __('Published', true) : __('Hidden', true); … … 15 15 endforeach; 16 16 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;')); 18 18 endforeach; 19 19 ?> -
trunk/app/views/entries/admin_listing.ctp
r637 r776 4 4 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 5 5 echo $html->getCrumbs(' / '); 6 7 6 echo $html->div('title_section', __('Entries', true)); 8 7 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));8 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', true),'title'=>__('See comments', true))), '/admin/entries/comments', null, false, false)); 10 9 11 10 ?>
