Changeset 625

Show
Ignore:
Timestamp:
07/04/08 15:06:44 (3 months ago)
Author:
aarkerio
Message:

Internatiantilzation

Location:
trunk/app
Files:
5 modified

Legend:

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

    r540 r625  
    8787    $this->set('subjects', Set::combine($this->Lesson->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 
    8888     
    89      if (!empty($this->data["Lesson"])) 
    90      { 
     89    if (!empty($this->data['Lesson'])): 
     90 
    9191       $this->Sanitize = new Sanitize; 
    9292         
    93        $this->Sanitize->html($this->data["Lesson"]["title"]); 
     93       $this->Sanitize->html($this->data['Lesson']['title']); 
    9494         
    95        $this->Sanitize->html($this->data["Lesson"]["body"]); 
     95       $this->Sanitize->html($this->data['Lesson']['body']); 
    9696         
    97        $this->data["Lesson"]["user_id"] = $this->Auth->user('id');;  
     97       $this->data['Lesson']['user_id'] = $this->Auth->user('id');;  
    9898         
    99        if ($this->Lesson->save($this->data["Lesson"])) 
    100        { 
     99       if ($this->Lesson->save($this->data['Lesson'])): 
    101100           $this->msgFlash('Lesson saved', '/admin/lessons/edit/'.$this->Lesson->getLastInsertID()); 
    102        } 
    103     } 
     101       endif; 
     102    endif; 
    104103  } 
    105104  
     
    110109     $this->set('subjects', Set::combine($this->Lesson->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 
    111110      
    112      if ( empty( $this->data["Lesson"] ) ) 
    113      { 
     111     if ( empty( $this->data["Lesson"] ) ): 
     112 
    114113         $this->Lesson->id  = $id; 
    115114          
    116115         $this->data      = $this->Lesson->read(); 
    117      } 
    118      else 
    119      {    
     116     
     117     else: 
     118    
    120119         $this->Sanitize = new Sanitize; 
    121120          
    122          $this->Sanitize->html($this->data["Lesson"]["title"]); 
     121         $this->Sanitize->html($this->data['Lesson']['title']); 
    123122          
    124          $this->Sanitize->html($this->data["Lesson"]["body"]); 
     123         $this->Sanitize->html($this->data['Lesson']['body']); 
    125124          
    126          if ($this->Lesson->save($this->data["Lesson"])) 
    127          {    
    128              if ( $this->data["Lesson"]["end"] == 1 ) 
    129              { 
    130                                  $this->redirect('/admin/lessons/listing'); 
    131              } 
    132              else 
    133              { 
    134                                  $this->msgFlash('Your story has been saved!', '/admin/lessons/edit/'.$this->data["Lesson"]["id"]); 
    135              } 
    136         } 
    137      } 
     125         if ($this->Lesson->save($this->data['Lesson'])):    
     126         if ( $this->data['Lesson']['end'] == 1 ): 
     127                     $this->redirect('/admin/lessons/listing'); 
     128            
     129         else: 
     130                     $this->msgFlash(__('Data saved', true), '/admin/lessons/edit/'.$this->data["Lesson"]["id"]); 
     131         endif; 
     132      endif; 
     133      endif; 
    138134 } 
    139135 // change status enabled/disabled actived 
  • trunk/app/locale/spa/LC_MESSAGES/default.po

    r624 r625  
    22msgstr "Eliminar" 
    33 
     4msgid  "Data saved" 
     5msgstr "Datos guardados" 
     6 
    47msgid  "Starting date" 
    58msgstr "Fecha de inicio" 
    69 
     10msgid  "Add new" 
     11msgstr "Agregar" 
     12 
    713msgid  "Finishing date" 
    814msgstr "Fecha de fin de curso" 
     
    1925msgid  "Edit" 
    2026msgstr "Editar" 
     27 
     28msgid  "Allow comments" 
     29msgstr "Habilitar comentarios" 
     30 
     31msgid  "Lessons" 
     32msgstr "Lecciones" 
    2133 
    2234msgid  "New Lesson" 
  • trunk/app/views/lessons/admin_add.ctp

    r624 r625  
    11<?php 
    22 echo $javascript->link('myfunctions'); 
    3  echo $javascript->link('fckeditor/fckeditor');  
     3 echo $javascript->link('fckeditor/fckeditor'); 
     4  
     5 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 
     6 echo $html->addCrumb(__('Lessons', true), '/admin/lessons/listing'); 
     7 echo $html->getCrumbs(' / ');  
     8 
    49 echo $form->create('Lesson');  
    510?> 
     
    1015<tr><td> 
    1116<?php 
    12      echo $form->input('Lesson.title', array("size" => 50, "maxlength" => 120)); 
     17     echo $form->input('Lesson.title', array('size' => 50, 'maxlength' => 120, 'label'=>__('Title', true))); 
    1318     echo $form->error('Lesson.title', 'Title is required.');  
    1419?> 
     
    1924 <td> 
    2025     <?php 
    21       echo $form->label('Lesson.subject_id', 'Subject:'); 
     26      echo $form->label('Lesson.subject_id', __('Subject', true)); 
    2227      echo $form->select('Lesson.subject_id', $subjects, null, null, false); 
    2328     ?> 
     
    2631<tr> 
    2732  <td colspan="3"> 
    28   <?php  
    29       echo $form->label('Lesson.body', 'Body:' ); 
     33  <?php 
    3034      echo $form->textarea('Lesson.body', array("cols"=>80, "rows"=>20)); 
    3135      echo $fck->load('LessonBody', 'Karamelo', 800, 600); 
     
    3539  <tr><td> 
    3640  <?php  
    37      echo $form->label('Lesson.status', 'Published:' ); 
     41     echo $form->label('Lesson.status', __('Published',true) ); 
    3842     echo $form->checkbox('Lesson.status', array('value'=>1));  
    3943  ?> 
    4044  </td><td colspan="2"> 
    4145  <?Php  
    42       Echo $form->label('Lesson.disc', 'Comments enabled:' ); 
     46      Echo $form->label('Lesson.disc', __('Allow comments', true)); 
    4347      echo $form->checkbox('Lesson.disc', array('value'=>1));  
    4448  ?> 
  • trunk/app/views/lessons/admin_edit.ctp

    r624 r625  
    1 <script type="text/javascript"> 
    2    window.onload = timedMsg; 
    3 </script> 
    41<?php  
    5   $session->flash(); 
    6    
    7   echo $javascript->link('myfunctions'); 
    8   echo $javascript->link('fckeditor/fckeditor');  
     2 echo $javascript->link('myfunctions'); 
     3 echo $javascript->link('fckeditor/fckeditor');  
     4 
     5 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 
     6 echo $html->addCrumb(__('Lessons', true), '/admin/lessons/listing'); 
     7 echo $html->getCrumbs(' / ');  
    98   
    109  echo $form->create('Lesson'); 
     
    1514<table> 
    1615<tr><td> 
    17   <?php  echo $form->input('Lesson.title', array("size" => 50, "maxlength" => 120));  ?> 
     16  <?php  echo $form->input('Lesson.title', array('size' => 50, 'maxlength' => 120, 'label'=>__('Title', true)));  ?> 
    1817  </td> 
    1918  <td> 
     
    2221<td> 
    2322 <?php 
    24       echo $form->label('Lesson.subject_id', 'Subject:'); 
     23      echo $form->label('Lesson.subject_id', __('Subject', true)); 
    2524      echo $form->select('Lesson.subject_id', $subjects, null, null, false); 
    2625 ?> 
     
    3029<td colspan="3"> 
    3130 <?php  
    32       echo $form->label('Lesson.body', 'Body:' ); 
    3331      echo $form->textarea('Lesson.body', array('cols'=>80, 'rows'=>20)); 
    3432      echo $fck->load('LessonBody', 'Karamelo', 800, 600); 
     
    3735  <tr><td> 
    3836  <?php  
    39      echo $form->label( 'Lesson.status', 'Published:' ); 
    40      echo $form->checkbox('Lesson.status', array("value"=>1));  
     37     echo $form->label( 'Lesson.status', __('Published',true)); 
     38     echo $form->checkbox('Lesson.status', array('value'=>1));  
    4139  ?> 
    4240  </td><td> 
    4341  <?php  
    44       echo $form->label('Lesson.disc', 'Comments enabled:' ); 
    45       echo $form->checkbox('Lesson.disc', array("value"=>1)); 
     42      echo $form->label('Lesson.disc', __('Allow comments', true) ); 
     43      echo $form->checkbox('Lesson.disc', array('value'=>1)); 
    4644      ?> 
    4745      </td><td> 
    4846      <?php 
    49       echo $form->label('Lesson.end', 'End edition:' ); 
    50       echo $form->checkbox('Lesson.end', array("value"=>1));  
     47      echo $form->label('Lesson.end', __('End edition',true)); 
     48      echo $form->checkbox('Lesson.end', array('value'=>1));  
    5149     ?> 
    5250  </td></tr> 
     
    5654</td></tr> 
    5755</table> 
    58  
  • trunk/app/views/lessons/admin_listing.ctp

    r312 r625  
    1 <script type="text/javascript"> 
    2    window.onload = timedMsg; 
    3 </script> 
    4 <?php $session->flash(); ?> 
    5 <div class="title_section">Lessons</div> 
    6  
    7 <p><?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add new", "title"=>"Add new")), '/admin/lessons/add', null, false, false) ?></p> 
     1<?php 
     2echo $html->div('title_section', __('Lessons', true)); 
     3echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))), '/admin/lessons/add', null, null, false));  
     4?> 
    85 
    96<table class="tbadmin"> 
     7<?php 
    108 
    11 <?php 
    12 //die(print_r($data)); 
    13  
    14 $th = array ('Edit', 'Title', 'Status', 'Delete'); 
     9$th = array(__('Edit', true), __('Title', true), __('Status', true), __('Delete', true)); 
    1510 
    1611echo $html->tableHeaders($th);