Changeset 648

Show
Ignore:
Timestamp:
07/11/08 19:02:40 (3 months ago)
Author:
aarkerio
Message:

Feeders

Location:
trunk/app
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/sql/postgresql/podcasts.sql

    r446 r648  
    44"title" varchar(50) NOT NULL DEFAULT '',  
    55"description" varchar(255) NOT NULL DEFAULT '',  
    6 "keywords" varchar(100) NOT NULL,  
     6"keywords" varchar(100),  
    77"created" timestamp(0) with time zone DEFAULT now() NOT NULL,  
    88"length" varchar(10) NOT NULL DEFAULT 0, 
  • trunk/app/controllers/news_controller.php

    r647 r648  
    8686   $this->News->unbindModel(array('hasMany'=>array('Discussion'))); 
    8787 
    88    $news = $this->News->findAll($conditions, $fields, $order, $limit); 
     88   $newss = $this->News->findAll($conditions, $fields, $order, $limit); 
    8989    
    90    $this->set(compact('channelData', 'news'));     
     90   $this->set(compact('channelData', 'newss'));     
    9191 } 
    9292   
  • trunk/app/controllers/podcasts_controller.php

    r560 r648  
    6262  
    6363 public function rss($username)  
    64  {    
    65     $this->layout = "podfeeder"; 
    66      
    67     if ($username == null) 
    68     { 
    69         $this->redirect('/'); 
    70     } 
    71      
    72     $this->Podcast->User->unbindModel(array('hasMany'=>array('Entry', 'Lesson', 'Category', 'Vclassroom', 'Faq', 'Acquaintance'))); 
    73      
    74     $User = $this->Podcast->User->find(array('username'=>$username), array('id', 'username', 'email', 'name_blog', 'avatar')); 
     64 {  
     65   $channelData = array('title'       => 'Karamelo eLearning Portal ', 
     66                'link'        => array('controller' => 'news', 'action' => 'display'), 
     67                'url'         => array('controller' => 'news', 'action' => 'display'), 
     68                'description' => 'Latest news on Karamelo', 
     69                'language'    => 'en-us' 
     70               ); 
     71        
     72   $this->Podcast->User->unbindAll(); 
     73     
     74   $User = $this->Podcast->User->find(array('username'=>$username), array('id', 'username', 'email', 'name_blog', 'avatar')); 
    7575     
    7676    $conditions = array("status"=>1, "user_id"=>$User['User']['id']); 
     
    8484    $this->set('User', $User); 
    8585 
    86     $this->set('data', $this->Podcast->findAll($conditions, $fields, $order, $limit)); 
     86    $podcasts = $this->Podcast->findAll($conditions, $fields, $order, $limit); 
     87 
     88    $this->set(compact('channelData', 'podcasts')); 
    8789 } 
    8890    
  • trunk/app/models/podcast.php

    r535 r648  
    2020 
    2121   public $validate = array( 
    22       'login' => '/[a-z0-9\_\-]{3,}$/i', 
    23       'password' => VALID_NOT_EMPTY, 
    24       'username' => VALID_NOT_EMPTY, 
    25       'email' => VALID_EMAIL 
     22      'title'       => VALID_NOT_EMPTY, 
     23      'description' => VALID_NOT_EMPTY 
    2624   );  
    2725/* 
  • trunk/app/views/layouts/rubyx.ctp

    r646 r648  
    8686<?php 
    8787 e($html->link('Blog', '/entries/rss/'.$blog['User']['username'] . '.rss'). ' / ');  
    88  e($html->link('Podcast', '/podcasts/rss/'.$blog['User']['username'].'rss')); 
     88 e($html->link('Podcast', '/podcasts/rss/'.$blog['User']['username'].'.rss')); 
    8989?> 
    9090</div>  
  • trunk/app/views/news/rss/rss.ctp

    r647 r648  
    22function rss_transform($item) 
    33{ 
    4  die(debug()); 
     4  
    55 return array('title' => $item['News']['title'], 
    66             'link' => array('controller'=>'news', 'action' => 'view', $item['News']['id']), 
     
    1111} 
    1212 
    13 $this->set('items', $rss->items($news, 'rss_transform')); 
     13$this->set('items', $rss->items($newss, 'rss_transform')); 
    1414?> 
  • trunk/app/views/podcasts/admin_add.ctp

    r361 r648  
    11<?php  
    2   echo $html->addCrumb('Control Tools', '/admin/entries/start');  
     2  echo $html->addCrumb('Control Panel', '/admin/entries/start');  
    33  echo $html->addCrumb('Podcasts', '/admin/podcasts/listing'); 
    44  echo $html->getCrumbs(' / ');  
    55 
    6   echo $html->div('title_section', 'Add new podcast'); 
     6  echo $html->div('title_section', __('Add new podcast', true)); 
    77 
    88  echo $form->create('Podcast', array("enctype"=>"multipart/form-data") );  
    99?> 
    1010<fieldset> 
    11   <legend>New podcast</legend>   
    12  <?php  
    13   echo $form->label('Podcast.file', 'MP3 File:'); 
     11  <legend><?php __('New podcast'); ?></legend>   
     12<?php  
     13  echo $form->label('Podcast.file', __('MP3 File', true)); 
    1414  echo $form->file('Podcast.file'); 
    1515    
    16   echo $form->label('Podcast.status', 'Published:'); 
     16  echo $form->label('Podcast.status', __('Published', true)); 
    1717  echo $form->checkbox('Podcast.status', array('value'=>1));  
    1818   
    19   echo $form->label('Podcast.adult', 'Adult language:'); 
     19  echo $form->label('Podcast.adult', __('Adult language', true)); 
    2020  echo $form->checkbox('Podcast.adult', array('value'=>1));  
    2121   
    22   echo $form->label('Podcast.karanet', 'Karanet:'); 
     22  echo $form->label('Podcast.karanet', 'Karanet'); 
    2323  echo $form->checkbox('Podcast.karanet', array('value'=>1));    
    2424 
     
    2828  echo $form->year('Podcast.created', 1920, 2017, date("Y"), null, false); 
    2929   
    30   echo $form->label( 'Podcast.subject_id', 'Subject:' ) .'<br />'; 
     30  echo $form->label( 'Podcast.subject_id', __('Subject', true)) .'<br />'; 
    3131  echo $form->select('Podcast.subject_id', $subjects, null, null, null, false); 
    3232 
    33   echo $form->input('Podcast.title', array("size" => 25, "maxlength" => 50));  
     33  echo $form->input('Podcast.title', array('size' => 25, 'maxlength' => 50, 'label'=>__('Title', true)));  
    3434 
    35   echo $form->label('Podcast.description', 'Description:'); 
    36   echo $form->textarea('Podcast.description', array("rows"=>10, "cols"=>40)) . '</fieldset>'; 
     35  echo $form->label('Podcast.description', __('Description', true)); 
     36  echo $form->textarea('Podcast.description', array('rows'=>8, "cols"=>40)); 
    3737 
    38   echo $form->end('Upload');  
     38  echo $form->end(__('Upload', true));  
    3939?> 
     40</fieldset> 
  • trunk/app/views/podcasts/rss/rss.ctp

    r646 r648  
    22function rss_transform($item) 
    33{ 
    4  return array('title' => $item['Entry']['title'], 
    5              'link' => array('controller'=>'entries', 'action' => 'view', $item['User']['username'], $item['Entry']['id']), 
    6          'guid' => array('controller'=> 'entries','action' => 'view', $item['User']['username'], $item['Entry']['id']), 
    7            'description' => strip_tags($item['Entry']['body']), 
    8            'pubDate' => $item['Entry']['created'] 
     4 return array( 
     5      'title' => $item['Podcast']['title'], 
     6      'link' => array('controller'=> 'files', 'action' => 'podcasts', $item['Podcast']['filename']), 
     7      'guid' => array('controller'=> 'files', 'action' => 'podcasts', $item['Podcast']['filename']), 
     8      'description' => strip_tags($item['Podcast']['description']), 
     9      'pubDate' => $item['Podcast']['created'] 
    910           ); 
    1011} 
    1112 
    12 $this->set('items', $rss->items($entries, 'rss_transform')); 
     13$this->set('items', $rss->items($podcasts, 'rss_transform')); 
    1314?>