Changeset 278
- Timestamp:
- 02/23/08 18:14:56 (11 months ago)
- Location:
- trunk/app
- Files:
-
- 1 removed
- 5 modified
-
app_controller.php (modified) (1 diff)
-
controllers/newsletters_controller.php (modified) (3 diffs)
-
views/elements/menu_b.ctp (modified) (1 diff)
-
views/newsletters/display.ctp (modified) (1 diff)
-
views/newsletters/subscribe.ctp (modified) (3 diffs)
-
views/podcasts/all.ctp (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/app_controller.php
r246 r278 20 20 $this->Auth->loginError = 'Invalid e-mail / password combination. Please try again'; 21 21 $this->Auth->authorize = 'controller'; 22 $this->Auth->allow( array(' display', 'view', 'register', 'recover', 'sendmail') );22 $this->Auth->allow( array('view', 'display', 'subscribe', 'recover') ); 23 23 24 24 $this->set('cU', $this->Auth->user()); // $cU current user array to use in the views if user logged -
trunk/app/controllers/newsletters_controller.php
r276 r278 17 17 public function beforeFiler() 18 18 { 19 $this->Auth->allow( 'subscribe');19 $this->Auth->allow(array('subscribe')); 20 20 parent::beforeFilter(); 21 21 } 22 22 23 23 public function isAuthorized() 24 24 { … … 32 32 return true; 33 33 } 34 34 35 35 public function subscribe() 36 36 { 37 37 $this->layout = 'portal'; 38 $this-> set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars38 $this->Portal->statics(); // Charge Portal components aka Sidebars 39 39 } 40 40 … … 50 50 $this->set('data', $this->Newsletter->findAll($conditions, $fields, $order, $limit)); 51 51 52 $this-> set('Element', $this->Portal->statics()); // Using Portal component52 $this->Portal->statics(); // Using Portal component 53 53 } 54 54 -
trunk/app/views/elements/menu_b.ctp
r240 r278 4 4 <ul> 5 5 <li><?php echo $html->link('Edublogs', '/users/bloggers/', array('title'=>'eduBlogs')); ?> </li> 6 <li><?php echo $html->link('Podcasts', '/podcasts/ all', array('title'=>'Download and hear')); ?> </li>6 <li><?php echo $html->link('Podcasts', '/podcasts/display', array('title'=>'Download and hear')); ?> </li> 7 7 <li><?php echo $html->link('Directory', '/users/directory/', array('title'=>'Staff')); ?> </li> 8 <li><?php echo $html->link('Newsletter', '/newsletters/ subscribe/', array('title'=>'Keep in touch')); ?> </li>8 <li><?php echo $html->link('Newsletter', '/newsletters/display/', array('title'=>'Keep in touch')); ?> </li> 9 9 <li><?php echo $html->link('Library', '/medias/display/', array('title'=>'Resources')); ?> </li> 10 10 -
trunk/app/views/newsletters/display.ctp
r277 r278 16 16 echo "</div>"; 17 17 } 18 19 if ( isset( $cU['User']['id'] )) 20 { 21 echo $html->para(null, $html->link('Subscribe to newsletter', '/newsletter/subscribe')); 22 } 18 23 ?> -
trunk/app/views/newsletters/subscribe.ctp
r277 r278 7 7 <?php 8 8 9 if ( ! $othAuth->sessionValid() )9 if ( !isset( $cU['User']['id'] ) ) 10 10 { 11 echo '<p>'. $html->link('You must be logged to subscribe to newsletter', '/users/login') . '</p>';11 echo $html->para(null, $html->link('You must be logged to subscribe to newsletter', '/users/login')); 12 12 } 13 13 … … 18 18 <fieldset> 19 19 <legend>Subscribe:</legend> 20 <?php echo $form->labelTag('Subscribers/email', 'Email:'); ?><br />21 <?php20 <?php echo $ajax->form(); 21 22 22 $options = array("size"=>25, "maxlength"=>50); 23 23 24 if ( ! $othAuth->sessionValid() )24 if ( !isset( $cU['User']['id'] ) ) 25 25 { 26 26 $options["readonly"]="readonly"; //if user no logged, no subscription available 27 27 } 28 28 29 echo $ html->input('Subscribers/email', $options); ?>29 echo $form->input('Subscribers.email', $options); ?> 30 30 <br /><br /> 31 31 <?php … … 44 44 <?php 45 45 echo $ajax->divEnd('updater'); 46 echo $html->link('View pass newsletters', '/newsletters/ all');46 echo $html->link('View pass newsletters', '/newsletters/display'); 47 47 ?> 48 48 <script type="text/javascript">
