Changeset 809 for trunk

Show
Ignore:
Timestamp:
10/11/08 22:19:40 (7 weeks ago)
Author:
aarkerio
Message:

Little changes

Location:
trunk/app
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/app_controller.php

    r787 r809  
    1616 public $components = array('Auth', 'Cookie', 'Session'); // set Security component later 
    1717  
    18  public $helpers    = array('Html', 'Form', 'Session'); 
     18 public $helpers    = array('Html', 'Form', 'Session'); // 'Cache' 
    1919  
    2020 public function beforeFilter() 
    2121 { 
     22   //$this->cacheAction = true; 
     23     
    2224   //set locale (es or en by now) 
    2325   $this->__setLocale(); 
     
    4345   endif; 
    4446  
    45    return true; 
     47   return false; 
    4648 } 
    4749 
     
    6668        $this->Session->write('lang',$lang); 
    6769     endif; */ 
    68      $lang = 'en'; 
     70     $lang = 'es'; 
    6971     $this->L10n->get($lang); 
    7072     Configure::write('Config.language', $lang); 
  • trunk/app/config/core.php

    r731 r809  
    5656 * 
    5757 */ 
    58     //Configure::write('Cache.check', true); 
     58//   Configure::write('Cache.check', true); 
    5959/** 
    6060 * Defines the default error type when using the log() function. Used for 
     
    199199 *                  ); 
    200200 */ 
    201  Cache::config('default', array('engine' => 'File')); 
     201  Cache::config('default', array('engine' => 'File')); 
     202 
    202203  
    203204/* Cache::config('default', array('engine' => 'Xcache', //[required] 
     
    205206                      'probability'=> 100, //[optional] 
    206207                      'user' => 'aarkerio', //user from xcache.admin.user settings 
    207                       'password' => 'kunst99' //plaintext password (xcache.admin.pass) 
     208                      'password' => 'dfdgdf' //plaintext password (xcache.admin.pass) 
    208209                 ) 
    209210         ); */ 
  • trunk/app/controllers/news_controller.php

    r792 r809  
    1515 
    1616 public $name = 'News'; 
    17   
    18  public $helpers          = array('Ajax', 'Fck', 'News', 'Time', 'Gags'); 
    19    
     17 public $helpers          = array('Ajax', 'Fck', 'News', 'Time', 'Gags');   
    2018 public $components       = array('Portal'); 
    21  
    2219 public $paginate = array('limit' => 8, 'page' => 1, 'order' => array('News.id' => 'DESC')); 
    2320   
  • trunk/app/controllers/newsletters_controller.php

    r785 r809  
    1212class NewslettersController extends AppController{ 
    1313 
    14   public $helpers          = array('Ajax', 'Fck', 'Gags'); 
     14  public $name       = 'Newsletters'; 
     15  public $helpers    = array('Ajax', 'Fck', 'Gags'); 
     16  public $components = array('Portal', 'Email'); 
    1517   
    16   public $components       = array('Portal', 'Email'); 
    17    
    18   public function beforeFiler() 
     18  public function beforeFilter() 
    1919  { 
    20     parent::beforeFilter();    
    21     $this->Auth->allow(array('subscribe', 'display', 'view')); 
     20    parent::beforeFilter(); 
     21    $this->Auth->allow(array('view', 'display', 'subscribe')); 
    2222  } 
    2323  
    2424  public function subscribe() 
    2525  { 
    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 
    2829  } 
    2930 
    30   public function display($page=1) 
     31  public function display() 
    3132  {   
    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; 
    3339      
    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 
    4242  } 
    4343       
    4444  public function view($id) 
    4545  { 
    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 
    5551  } 
    5652 
  • trunk/app/locale/spa/LC_MESSAGES/default.po

    r806 r809  
    44msgid  "Yes" 
    55msgstr "Si" 
     6 
     7msgid  "No published newsletters yet" 
     8msgstr "Aún no se han publicado boletines" 
     9 
     10msgid  "Subscribe to newsletter" 
     11msgstr "Suscríbase al boletín" 
    612 
    713msgid  "Search Results" 
     
    788794msgstr "Subir" 
    789795 
     796msgid  "Sent" 
     797msgstr "Enviado" 
     798 
     799msgid  "New newsletter" 
     800msgstr "Nuevo boletín" 
     801 
    790802msgid  "Teacher tools" 
    791803msgstr "Herramientas pedagógicas" 
  • trunk/app/views/newsletters/admin_add.ctp

    r794 r809  
    11<?php  
    2     echo $javascript->link('myfunctions'); 
    32    echo $javascript->link('fckeditor/fckeditor');  
    43 
    5     echo $html->addCrumb('Control Tools', '/admin/entries/start');  
    6     echo $html->addCrumb('Entries', '/admin/newsletters/listing');  
    7     echo $html->getCrumbs(' / ');  
     4    echo $html->addCrumb('Control Panel', '/admin/entries/start');  
     5    echo $html->addCrumb(__('Newsletters', true), '/admin/newsletters/listing');  
     6    echo $html->getCrumbs('/');  
    87 
    98    echo $form->create('Newsletter');  
    109?> 
    11  
    1210<fieldset> 
    13 <legend>New newsletter</legend> 
     11<legend><?php __('New newsletter'); ?></legend> 
    1412 
    1513<table style="margin:0 auto 0 auto;"> 
    16 <tr> 
    17    <td> 
    18     <?php 
    19       echo $form->input('Newsletter.title', array("size" => 50, "maxlength" => 50)); 
    20     ?> 
     14<tr><td> 
     15    <?php  echo $form->input('Newsletter.title', array('size'=>50, 'maxlength' => 50, 'label'=>__('Title', true))); ?> 
    2116  </td> 
    22    <td> 
     17  <td> 
    2318    <?php  
    24         echo $html->link($html->image('admin/myimages.jpg', array('alt'=>'My Images', 'title'=>'My Images')),  
     19        echo $html->link($html->image('admin/myimages.jpg', array('alt'=>__('My Images', true), 'title'=>__('My Images', true))),  
    2520                         '#',  
    26                          array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false); ?></p> 
     21                         array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false); ?> 
    2722  </td> 
    28   </tr> 
    29   <tr><td colspan="2"> 
    30   <?php  
    31     echo $form->label('Newsletter.Body', 'Text:'); 
    32     echo $form->textarea('Newsletter.body', array('cols'=>60, 'rows'=>17));  
    33     echo $fck->load('NewsletterBody', 'Karamelo');  
    34   ?> 
    35   </td> 
     23</tr> 
     24<tr><td colspan="2"> 
     25<?php  
     26  echo $form->textarea('Newsletter.body', array('cols'=>60, 'rows'=>17));  
     27  echo $fck->load('NewsletterBody', 'Karamelo');  
     28?> 
     29 </td> 
    3630</tr>  
    3731<tr> 
    38   <td> 
    39        <?php 
    40             echo $form->label('Newsletter.status', 'Published:'); 
    41             echo $form->checkbox('Newsletter.status');  
    42         ?> 
    43   </td> 
    44    <td> 
    45        <?php  
    46             echo $form->label('Newsletter.end', 'Finish edition:' ); 
    47             echo $form->checkbox('Newsletter.end');  
    48        ?> 
    49    </td> 
    50   </tr> 
    51   <tr><td colspan="2"></fieldset> 
    52   <?php echo $form->end('Save'); ?> 
     32 <td> 
     33  <?php 
     34   echo $form->label('Newsletter.status', __('Published', true)); 
     35   echo $form->checkbox('Newsletter.status');  
     36  ?> 
     37</td> 
     38<td> 
     39 <?php  
     40   echo $form->label('Newsletter.end', __('Finish edition', true) ); 
     41   echo $form->checkbox('Newsletter.end');  
     42 ?> 
     43 </td> 
     44</tr> 
     45<tr><td colspan="2"> 
     46  <?php echo $form->end(__('Save', true)); ?> 
     47</fieldset> 
    5348</td></tr> 
    5449</table> 
  • trunk/app/views/newsletters/admin_listing.ctp

    r277 r809  
    1 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?>  
     1<?php  
     2 echo $html->addCrumb('Control Panel', '/admin/entries/start');  
     3 echo $html->getCrumbs(' / ');  
    24 
    3 <?php echo $html->getCrumbs(' / '); ?> 
     5 echo $html->div('title_section', __('Newsletters', true)); 
    46 
    5 <div class="title_section">Newsletters</div> 
    6  
    7 <p> 
    8 <?php  
    9   echo $html->link($html->image('actions/new.png', array("alt"=>"Add entry", "title"=>"Add entry")), '/admin/newsletters/add', null, false, false); 
     7 echo $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))), '/admin/newsletters/add', null, false, false); 
    108?> 
    11 </p> 
    129<table class="tbadmin"> 
    1310<?php 
    14 $th = array ('Edit', 'Title', 'Status', 'Delivered', 'Send', 'Delete'); 
     11$th = array(__('Edit', true), __('Title', true), 'Status', __('Delivered', true), __('Sent', true), __('Delete', true)); 
    1512echo $html->tableHeaders($th);   
    16 foreach ($data as $val) { 
    17        $delivered = ($val['Newsletter']['delivered'] == 0) ? 'No' : 'Yes'; 
     13foreach ($data as $val): 
     14       $delivered = ($val['Newsletter']['delivered'] == 0) ? 'No' : __('Yes', true); 
    1815       $tr = array ( 
    1916        $gags->sendEdit($val['Newsletter']['id'], 'newsletters'), 
     
    2118        $gags->setStatus($val['Newsletter']['status']), 
    2219        $delivered, 
    23         $html->link($html->image('admin/send.gif', array("alt"=>"Send", "title"=>"Send")), 
     20        $html->link($html->image('admin/send.gif', array('alt'=>__('Send', true), 'title'=>__('Send', true))), 
    2421                    '/admin/newsletters/send/'.$val['Newsletter']['id'], null, null, false), 
    2522        $gags->confirmDel($val['Newsletter']['id'], 'newsletters') 
     
    2825    echo $html->tableCells($tr, array("class"=>"altRow", "onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='altRow'"),  
    2926                                array('class'=>'evenRow',"onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='evenRow'"));  
    30 } 
     27endforeach; 
    3128?> 
    3229</table> 
    33  
    3430<?php  
    3531//echo $pagination; 
  • trunk/app/views/newsletters/display.ctp

    r541 r809  
    11<?php 
    22 
    3 echo $html->div('title_section', 'Newsletters'); 
     3echo $html->div('title_portal', __('Newsletters', true)); 
    44 
    5 if ( count($data) == 0): 
    6     echo $html->div('notice', 'Newsletter not yet done'); 
     5if ( count($data) === 0): 
     6    echo $html->para('notice', __('No published newsletters yet', true)); 
    77endif; 
    88//die(var_dump($data)); 
    99 
    10  foreach ($data as $val): 
     10foreach ($data as $val): 
    1111      $tmp  = $html->div('news_title', $val['Newsletter']['title']); 
    1212      $tmp .= $html->div('news_date',  $val['Newsletter']['created']); 
    1313      $tmp .= $html->div('news_body',  $val['Newsletter']['body']); 
    14  
    1514      echo $html->div('wrapnew', $tmp); 
    1615 endforeach; 
    1716 
    1817 if ( $session->check('Auth.User') ): 
    19     echo $html->para(null, $html->link('Subscribe to newsletter', '/newsletters/subscribe')); 
     18    echo $html->para(null, $html->link(__('Subscribe to newsletter', true), '/newsletters/subscribe')); 
    2019 endif;  
    2120?>