Changeset 759 for trunk/app

Show
Ignore:
Timestamp:
09/07/08 18:55:25 (2 months ago)
Author:
aarkerio
Message:

Update models

Location:
trunk/app
Files:
4 modified

Legend:

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

    r758 r759  
    416416 
    417417 public function admin_deliver() 
    418  { 
    419     $this->layout = 'ajax'; 
    420      
     418 {   
    421419    if (!empty($this->data['Message'])): 
    422420 
    423            $this->Sanitize = new Sanitize; 
    424             
    425            $this->Sanitize->html($this->data['Message']["title"]); 
    426             
    427            $this->Sanitize->html($this->data['Message']["body"]); 
    428             
    429            $this->Message->create(); 
    430             
    431            if ($this->Message->save($this->data['Message'])): 
    432                 $this->__sendMail($this->data['Message']["user_id"]); 
    433            endif; 
     421        $this->Sanitize = new Sanitize; 
     422 
     423        $this->Sanitize->html($this->data['Message']['title']); 
     424            
     425        $this->Sanitize->html($this->data['Message']['body']); 
     426            
     427        $this->data['Message']['sender_id'] = $this->Auth->user('id'); 
     428            
     429        if ($this->Message->save($this->data)): 
     430                $this->__sendMail($this->data['Message']['user_id']); 
     431        endif; 
     432        $this->msgFlash(__('Message sent', true), '/admin/vclassrooms/members/'.$this->data['Message']['vclassroom_id']);     
    434433   endif; 
    435434 } 
     
    520519 } 
    521520 
    522  public function admin_write($user_id) 
     521 public function admin_write($user_id, $vclassroom_id) 
    523522 {     
    524         $this->layout    = 'admin'; 
    525          
    526         $this->pageTitle = 'Write Message'; 
    527  
    528         $this->set('user_id', $user_id); 
    529  } 
    530  
     523   $this->layout    = 'admin'; 
     524   $this->pageTitle = __('Write message', true); 
     525   $this->set('user_id', $user_id); 
     526   $this->set('vclassroom_id', $vclassroom_id); 
     527 } 
     528  
    531529 private function __sendMessage($email, $vclassroom_id) 
    532530 {    
  • trunk/app/views/messages/admin_listing.ctp

    r758 r759  
    1616//exit(print_r($data)); 
    1717 
    18 $th = array('Flag', 'Subject', 'From', 'Date', 'Mark'); 
     18$th = array(__('Flag', true), __('Subject', true), __('From', true), __('Date', true), __('Mark', true)); 
    1919echo '<table class="tbadmin">'; 
    2020echo $html->tableHeaders($th); 
     
    2424  { 
    2525           case 0: 
    26                 $status = 'New'; 
     26                $status = __('New', true); 
    2727                $img    = 'message_n.gif'; 
    2828                break; 
    2929           case 1: 
    30                 $status = 'Readed'; 
     30                $status = __('Readed', true); 
    3131                $img    = 'message_r.gif'; 
    3232                break; 
    3333           case 2: 
    34                 $status = 'Reply'; 
     34                $status = __('Reply', true); 
    3535                $img    = 'message_e.gif'; 
    3636                break; 
     
    5353  
    5454 if ( count($data) > 0 ): 
    55     echo $html->link(__('Mark all', true), "javascript:select_switch(true)", array("style"=>"font-size:7pt")) . ' | '; 
    56     echo $html->link(__('Unmark all', true), "javascript:select_switch(false)", array("style"=>"font-size:7pt")) . '<br /><br />'; 
    57      
     55    echo $html->link(__('Mark all', true), "javascript:select_switch(true)", array('style'=>'font-size:7pt')) . ' | '; 
     56    echo $html->link(__('Unmark all', true), "javascript:select_switch(false)", array('style'=>'font-size:7pt')) . '<br /><br />'; 
    5857    echo $form->end(__('Delete marked', true)); 
    5958 endif; 
  • trunk/app/views/messages/admin_write.ctp

    r541 r759  
    11<?php  
    2   echo $html->div('sec_title', 'Write message');  
     2  echo $html->div('title_section', __('Write message', true));  
    33  echo $form->create('Message', array('action'=>'deliver','onsubmit'=>'return chkForm()'));  
    44  echo $form->hidden('Message.user_id', array('value'=> $user_id)); 
     5  echo $form->hidden('Message.vclassroom_id', array('value'=> $vclassroom_id)); 
    56?> 
    67<fieldset> 
    7 <legend>Write Message:</legend> 
     8<legend><?php __('Write message'); ?></legend> 
    89 <?php    
    9    echo $session->read('Auth.User.username') . " writes: <br />"; 
     10   echo $session->read('Auth.User.username') . ' '. __('writes', true).': <br />'; 
    1011   echo $form->input('Message.title', array('size'=> 35, 'maxlength'=>50)) . "<br />"; 
    1112 
    12    echo $form->label('Message.body', 'Message:' ); 
     13   echo $form->label('Message.body', __('Message', true) ); 
    1314   echo $form->textarea('Message.body', array('cols'=>30, 'rows'=>10)); 
    1415  
    15    echo $form->end('Send message');  
     16   echo $form->end(__('Send', true));  
    1617?> 
    1718</fieldset> 
  • trunk/app/views/vclassrooms/admin_members.ctp

    r739 r759  
    2020 
    2121 echo $html->link( 
    22          $html->image('static/icon_webquest.jpg', array("alt"=>"Link webquest", "title"=>"Link webquest", "style"=>"margin-right:12px") 
     22         $html->image('static/icon_webquest.jpg', array('alt'=>'Link webquest', 'title'=>'Link webquest', 'style'=>'margin-right:12px') 
    2323     ), '#', array("onclick"=>$w), null, null, false); 
    2424 
    2525 echo $html->link( 
    26         $html->image('static/icon_treasure.jpg', array("alt"=>"Link Treasure", "title"=>"Link Treasure", "style"=>"margin-right:12px") 
     26        $html->image('static/icon_treasure.jpg', array('alt'=>'Link Treasure', 'title'=>'Link Treasure', 'style'=>'margin-right:12px') 
    2727        ), '#', array("onclick"=>$r), null, null, false); 
    2828 
    2929 echo $html->link( 
    30         $html->image('admin/forums_icon.png', array("alt"=>"Add forum", "title"=>"Add forum", "style"=>"margin-right:12px") 
     30        $html->image('admin/forums_icon.png', array('alt'=>'Add forum', 'title'=>'Add forum', 'style'=>'margin-right:12px') 
    3131        ), '#', array("onclick"=>$r), null, null, false);  
    3232 
     
    8585             $html->link($val['email'], 'mailto:'.$val['email']), 
    8686                 $html->link($html->image('admin/compose_on.gif', array('alt'=>__('Compose to', true) .' '.$val['username'], 'title'=>__('Compose to', true) .' '.$val['username'])),  
    87                              '/admin/messages/write/'.$val['id'], null, null, false), 
     87                             '/admin/messages/write/'.$val['id'].'/'.$data['Vclassroom']['id'], null, null, false), 
    8888         $html->link($html->image('static/unlink.png', array('alt'=>__('Unlink', true), 'title'=>__('Unlink', true))), 
    8989'/admin/vclassrooms/unlink/'.$val['id'].'/'.$data['Vclassroom']['id'], null, null, false),