Changeset 275
- Timestamp:
- 02/22/08 23:20:32 (9 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/news_controller.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/news_controller.php
r247 r275 13 13 public $helpers = array('Ajax', 'Fck', 'News', 'Time', 'Gags'); 14 14 15 //public $components = array('Portal'); 15 public $components = array('Portal'); 16 16 17 public function isAuthorized() 17 18 { 18 if (isset($this->params[Configure::read('Routing.admin')]))19 {20 if ($this->Auth->user('group_id') != 1)21 {22 return false;23 }24 }25 return true;19 if (isset($this->params[Configure::read('Routing.admin')])) 20 { 21 if ($this->Auth->user('group_id') != 1) 22 { 23 return false; 24 } 25 } 26 return true; 26 27 } 27 28 … … 40 41 $limit = 15; 41 42 42 $this->set('data', $this->News->findAll( ));43 44 // $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars43 $this->set('data', $this->News->findAll($conditions)); 44 45 $this->Portal->statics(); // Charge Portal components aka Sidebars 45 46 } 46 47 … … 53 54 54 55 $this->layout = 'portal'; 56 57 $this->pageTitle = '::News'; 55 58 56 59 $conditions = array("News.status"=>1, "News.id"=>$id); … … 58 61 $fields = array("News.id", "News.title", "News.comments", "News.body", "News.created", "News.reference", "News.theme_id", "News.user_id", "Theme.img", "Theme.theme", "User.username"); 59 62 60 $this->pageTitle = '::News';61 62 63 $this->set('data', $this->News->find($conditions, $fields)); 63 64 64 // $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars65 $this->Portal->statics(); // Charge Portal components aka Sidebars 65 66 } 66 67
