Changeset 809 for trunk/app/controllers
- Timestamp:
- 10/11/08 22:19:40 (7 weeks ago)
- Location:
- trunk/app/controllers
- Files:
-
- 2 modified
-
news_controller.php (modified) (1 diff)
-
newsletters_controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/news_controller.php
r792 r809 15 15 16 16 public $name = 'News'; 17 18 public $helpers = array('Ajax', 'Fck', 'News', 'Time', 'Gags'); 19 17 public $helpers = array('Ajax', 'Fck', 'News', 'Time', 'Gags'); 20 18 public $components = array('Portal'); 21 22 19 public $paginate = array('limit' => 8, 'page' => 1, 'order' => array('News.id' => 'DESC')); 23 20 -
trunk/app/controllers/newsletters_controller.php
r785 r809 12 12 class NewslettersController extends AppController{ 13 13 14 public $helpers = array('Ajax', 'Fck', 'Gags'); 14 public $name = 'Newsletters'; 15 public $helpers = array('Ajax', 'Fck', 'Gags'); 16 public $components = array('Portal', 'Email'); 15 17 16 public $components = array('Portal', 'Email'); 17 18 public function beforeFiler() 18 public function beforeFilter() 19 19 { 20 parent::beforeFilter(); 21 $this->Auth->allow(array(' subscribe', 'display', 'view'));20 parent::beforeFilter(); 21 $this->Auth->allow(array('view', 'display', 'subscribe')); 22 22 } 23 23 24 24 public function subscribe() 25 25 { 26 $this->layout = 'portal'; 27 $this->Portal->statics(); // Charge Portal components aka Sidebars 26 $this->pageTitle = __('Newsletters', true); 27 $this->layout = 'portal'; 28 $this->Portal->statics(); // Charge Portal components aka Sidebars 28 29 } 29 30 30 public function display( $page=1)31 public function display() 31 32 { 32 $this->layout = 'portal'; 33 $this->pageTitle = __('Newsletters', true); 34 $this->layout = 'portal'; 35 $conditions = array('Newsletter.status'=>1); 36 $fields = array('Newsletter.id', 'Newsletter.title', 'Newsletter.body', 'Newsletter.created', 'Newsletter.user_id'); 37 $order = 'Newsletter.id DESC'; 38 $limit = 20; 33 39 34 $conditions = array("Newsletter.status"=>1); 35 $fields = array("Newsletter.id", "Newsletter.title", "Newsletter.body", "Newsletter.created", "Newsletter.user_id"); 36 $order = "Newsletter.id DESC"; 37 $limit = 20; 38 39 $this->set('data', $this->Newsletter->findAll($conditions, $fields, $order, $limit)); 40 41 $this->Portal->statics(); // Using Portal component 40 $this->set('data', $this->Newsletter->findAll($conditions, $fields, $order, $limit)); 41 $this->Portal->statics(); // Using Portal component 42 42 } 43 43 44 44 public function view($id) 45 45 { 46 $conditions = array("estado"=>1, "id"=>$id); 47 $fields = array("id", "title", "body", "fecha", "referencia", "subject_id", "iduser"); 48 $order = "id DESC"; 49 $limit = 10; 50 51 $this->pageTitle = 'Noticias'; 52 $this->set('data', $this->Newsletter->findAll($conditions, $fields)); 53 54 $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars 46 $this->pageTitle = __('Newsletter', true); 47 $conditions = array('status'=>1, 'id'=>$id); 48 $fields = array('id', 'title', 'body', 'created'); 49 $this->set('data', $this->Newsletter->find($conditions, $fields)); 50 $this->Portal->statics(); // Charge Portal components aka Sidebars 55 51 } 56 52
