Changeset 365

Show
Ignore:
Timestamp:
04/03/08 10:43:08 (9 months ago)
Author:
aarkerio
Message:

Locale and test improvements

Location:
trunk/app
Files:
6 modified

Legend:

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

    r364 r365  
    4444   { 
    4545     $conditions = array("Answer.question_id" => $this->data['Answer']['question_id']); 
    46      $fields     = array("Answer.id", "Answer.answer", "Answer.correct"); 
     46     $fields     = array("Answer.id", "Answer.answer", "Answer.correct", "Answer.question_id"); 
    4747     $order      = "Answer.id"; 
    4848                     
  • trunk/app/controllers/vclassrooms_controller.php

    r352 r365  
    227227            $this->msgFlash('Your virtual classroom  has been updated.', '/admin/vclassrooms/edit/'.$this->data['Vclassroom']['id']); 
    228228       } 
     229    } 
     230 } 
     231 
     232 // change status published/draft 
     233 public function admin_change($id, $status, $ecourse_id) 
     234 { 
     235    $this->data['Vclassroom']['status'] = ($status == 0 ) ? 1 : 0; 
     236    
     237    $this->data['Vclassroom']['id']     = $id; 
     238      
     239    if ($this->Vclassroom->save($this->data['Vclassroom'])) 
     240    { 
     241         $this->msgFlash('Clasroom status changed', '/admin/ecourses/vclassrooms/'.$ecourse_id); 
    229242    } 
    230243 } 
  • trunk/app/models/answer.php

    r363 r365  
    33*  Chipotle Software TM 
    44*  Manuel Montoya 2002-2008 
    5 *  GPLv3 manuel<at>mononeurona<dot>org 
     5*  GPLv3 manuel<arroba>mononeurona<punto>org 
    66**/ 
    77 
     
    1010  public $belongsTo = array('Question' => 
    1111                                    array('className'  => 'Question', 
    12                                           'conditions' => '', 
    13                                           'order'      => '', 
    14                                           'foreignKey' => 'question_id' 
     12                                          'conditions' => '', 
     13                                      'order'      => '', 
     14                                                  'foreignKey' => 'question_id' 
    1515                                          ) 
    1616                          ); 
    1717  
    1818  public $validate = array( 
    19                 'comment'  => VALID_NOT_EMPTY,         //'/[a-z0-9\_\-]{3,}$/i', 
     19                'comment'  => VALID_NOT_EMPTY,  
    2020                'user_id'  => VALID_NOT_EMPTY, 
    2121                'entry_id' => VALID_NOT_EMPTY, 
  • trunk/app/views/answers/questions.ctp

    r251 r365  
    11<?php 
    2 foreach ($data as $val)  
    3 {       
    4     echo '<div style="padding:5px;border:1px dotted gray;margin:4px;">'; 
    5        echo "Answer: "      . $val["Answer"]["answer"]       . "<br />"; 
    6        echo "Correct: "     . $val["Answer"]["correct"]      . "<br />"; 
    7     echo '</div>'; 
     2// die( debug( $data )); 
     3foreach ($data as $val)    
     4{ 
     5  $st = ($val['Answer']['correct']==1) ? 'Yes' : 'No';       
     6  $tmp  = $html->div(null, $html->link('Delete', '/admin/answers/delete/'.$val['Answer']['id'].'/'.$val['Answer']['question_id'])); 
     7  $tmp .= $html->div(null, $html->link('Edit',   '/admin/answers/edit/'  .$val['Answer']['id'])); 
     8  $tmp .= "Answer:  "     .    $val['Answer']['answer']       . "<br />"; 
     9  $url  = '/admin/answers/change/'.$val['Answer']['id'].'/'.$val['Answer']['correct'].'/'.$val['Answer']['question_id']; 
     10  $tmp .= "Correct: "     . $html->link($st, $url) . "<br />"; 
     11 
     12  echo $html->div('adminblock', $tmp); 
    813} 
    914?> 
  • trunk/app/views/ecourses/admin_edit.ctp

    r354 r365  
    11<?php  
    22 echo $javascript->link('fckeditor/fckeditor'); 
     3 
     4 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
     5 echo $html->addCrumb('Ecourses', '/admin/ecourses/listing'); 
     6 echo $html->getCrumbs(' / '); 
     7 
    38 echo $form->create('Ecourse',array("onsubmit"=>"return chkForm();"));  
    49 echo $form->hidden('Ecourse.id'); 
  • trunk/app/views/ecourses/admin_vclassrooms.ctp

    r352 r365  
    2828      $tmp  =  $html->div('butonright', $gags->sendEdit($val['id'], 'Vclassroom')); 
    2929      $tmp .=  $html->link($val['name'], '/admin/vclassrooms/members/'.$val['id']); 
    30       $tmp .=  $html->para(null, 'Status: '. $html->link($s, '/admin/vclassroom/change/'.$val['id'].'/'.$val['status'])); 
     30      $tmp .=  $html->para(null, 'Status: '.$html->link($s,'/admin/vclassrooms/change/'.$val['id'].'/'.$val['status'].'/'.$val['ecourse_id'])); 
    3131      $tmp .=  $html->div('butonright', $gags->confirmDel($val['id'], 'Vclassroom')); 
    3232