Changeset 349

Show
Ignore:
Timestamp:
03/26/08 12:41:46 (10 months ago)
Author:
aarkerio
Message:

Newsletter fixed

Location:
trunk/app
Files:
4 modified

Legend:

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

    r328 r349  
    33*  Karamelo E-Learning Platform 
    44*  Manuel Montoya 2002-2008  
    5 *  GPLv3 manuel<at>mononeurona<punto>org 
     5*  GPLv3 manuel<arroba>mononeurona<punto>org 
    66*/  
    77 
     
    1313 public $helpers    = array('Javascript', 'Ajax', 'User', 'Gags'); 
    1414 
     15 public $components = array('Portal', 'Edublog'); 
     16 
     17 public function beforeFilter()  
     18 { 
     19    $this->Auth->allow(array('display', 'rss', 'show')); 
     20    parent::beforeFilter(); 
     21 } 
     22 
     23 public function isAuthorized()  
     24 {       
     25    if (isset( $this->params[Configure::read('Routing.admin')] ))  
     26    { 
     27           if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 )  // admin and teachers 
     28           { 
     29            return true; 
     30       }  
     31    }  
     32        return false;  // go away !! 
     33 } 
     34 
     35 public function display() 
     36 {    
     37     $this->Portal->statics(); 
     38 
     39     $this->layout    = 'portal';         
     40         
     41     $this->pageTitle = 'Podcasts'; 
     42         
     43     $conditions = array("Podcast.status"=>1); 
     44         
     45     $fields     = array("id", "title", "description", "created", "filename", "length", "duration"); 
     46      
     47     $order      = 'Podcast.id DESC'; 
     48         
     49     $limit      = 20; 
     50 
     51     $this->set('data', $this->Podcast->findAll($conditions, $fields, $order, $limit)); 
     52  } 
    1553 public function rss($username)  
    1654 {    
  • trunk/app/views/newsletters/display.ctp

    r278 r349  
    1 <div class="title_section">Newsletters</div> 
     1<?php 
    22 
    3 <?php 
     3echo $html->div('title_section', 'Newsletters'); 
     4 
    45if ( count($data) == 0) 
    56{ 
    6    echo '<div style="font-weigth:bold;font-size:14pt;padding:15px;">Newsletter not yet done</div>'; 
     7   echo $html->div('notice', 'Newsletter not yet done'); 
    78} 
    89//die(var_dump($data)); 
     
    1011 foreach ($data as $val) 
    1112 { 
    12    echo '<div class="wrapnew">'; 
    13       echo '<div class="news_title">'. $val['Newsletter']['title']   . "</div>"; 
    14       echo '<div class="news_date">' . $val['Newsletter']['created'] . "</div>"; 
    15       echo '<div class="news_body">' . $val['Newsletter']['body']    . "</div>"; 
    16    echo "</div>"; 
     13      $tmp  = $html->div('news_title', $val['Newsletter']['title']); 
     14      $tmp .= $html->div('news_date',  $val['Newsletter']['created']); 
     15      $tmp .= $html->div('news_body',  $val['Newsletter']['body']); 
     16 
     17      echo $html->div('wrapnew', $tmp); 
    1718 } 
    1819 
    1920 if ( isset( $cU['User']['id'] )) 
    2021 { 
    21    echo $html->para(null, $html->link('Subscribe to newsletter', '/newsletter/subscribe')); 
     22   echo $html->para(null, $html->link('Subscribe to newsletter', '/newsletters/subscribe')); 
    2223 }  
    2324?> 
  • trunk/app/views/newsletters/subscribe.ctp

    r278 r349  
    1 <h1>Susbscribe Newsletters </h1> 
     1<h1>Subscribe Newsletters </h1> 
    22 
    33<p>Keep informed about our activities</p> 
     
    1414echo $ajax->div('updater'); 
    1515 
    16 echo $ajax->form(null, 'post');  
     16echo $ajax->form();  
    1717?> 
    1818<fieldset> 
  • trunk/app/views/podcasts/display.ctp

    r272 r349  
    1  
    2 <div style="font-size:18pt;padding:5px;boder:1px solid #c0c0c0"> <?php echo $blog["User"]["username"]; ?>'s Podcasts</div>  
    3  
    41<?php 
    52//die(var_dump($data)); 
    63 
    7 foreach ($data as $val) 
    8 { 
    9   echo '<div style="padding:4px;border:1px dotted gray;margin:5px;">'; 
    10   echo "<h2>". $val['Podcast']['title']   . "</h2>"; 
    11   echo '<p style="font-size:7pt;">' . $val['Podcast']['created'] . '</p>';   
    12   echo  '<p>' . $val['Podcast']['description']   . '</p>'; 
    13   echo  '<p>' . $html->link($html->image('static/dec_mp3.gif', array("alt"=>"Download Podcast to Mp3 player", "alt"=>"Download Podcast to Mp3 player")), '/files/podcasts/'.$val['Podcast']['filename'], null, false, false)   . '</p>'; 
    14    
    15   echo '</div>'; 
     4 echo $html->div('title_section', 'Last Podcasts'); 
     5 
     6 foreach ($data as $val) 
     7 { 
     8    $tmp  =  $html->div('news_title', $val['Podcasts']['title']); 
     9    $tmp .=  $html->div('news_date',  $val['Podcasts']['created']); 
     10    $tmp .=  $html->div('news_body',  $val['Podcasts']['description']); 
     11    echo $html->div('wrapnew', $tmp);  
    1612 } 
    1713?> 
    1814 
     15 
     16 
     17