Changeset 340

Show
Ignore:
Timestamp:
03/24/08 18:37:16 (10 months ago)
Author:
aarkerio
Message:

Webquest imprvements

Location:
trunk/app
Files:
1 added
11 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/sql/karamelo_postgres.sql

    r339 r340  
    328328  "title" varchar(110) NOT NULL, 
    329329  "description" text, 
    330   "code" varchar(15),  -- secret code to allow students join to the ecourse,  voM121x for instance 
    331330  "created" timestamp(0) with time zone DEFAULT now() NOT NULL, 
    332331  "status" smallint DEFAULT 0 NOT NULL, 
  • trunk/app/controllers/ecourses_controller.php

    r301 r340  
    1111{ 
    1212 public $helpers      = array('Fck', 'Gags', 'Paginator'); 
    13    
     13  
     14 public function beforeFilter()  
     15 { 
     16    $this->Auth->allow(array('display')); 
     17    parent::beforeFilter(); 
     18 } 
    1419 public function isAuthorized()  
    1520 {       
     
    3338             
    3439       $conditions   =  array("user_id"=>$this->Auth->user('id')); 
    35        $fields       =  array('id', 'title', 'access',  'status', 'code', 'description'); 
     40       $fields       =  array('id', 'title', 'access',  'status', 'description'); 
    3641       $order        =  "Ecourse.title DESC"; 
    3742             
     
    4348         
    4449        $conditions   =  array("user_id"=>$this->Auth->user('id')); 
    45         $fields       =  array('id', 'title', 'status', 'code', 'description'); 
     50        $fields       =  array('id', 'title', 'status', 'description'); 
    4651        $order        =  "Ecourse.id DESC"; 
    4752        $limit        =  10; 
     
    5762         
    5863        $conditions   =  array("Ecourse.user_id"=>$this->Auth->user('id'), "Ecourse.id"=>$ecourse_id); 
    59         $fields       =  array('id', 'title', 'status', 'code'); 
     64        $fields       =  array('id', 'title', 'status'); 
    6065        $order        =  "Ecourse.id DESC"; 
    6166 
  • trunk/app/controllers/webquests_controller.php

    r339 r340  
    33*  Karamelo E-Learning Platform 
    44*  Manuel Montoya 2002-2008  
    5 *  GPL manuel<at>mononeurona.org 
     5*  GPLv3 manuel<arroba>mononeurona<punto>org 
    66*/  
    77 
     
    5757      $limit      = 20; 
    5858       
    59       $this->set('username',$username); 
    6059      $this->set('data', $this->Webquest->findAll($conditions, $fields, $order, $limit));  
    6160 } 
     
    120119         $this->Sanitize = new Sanitize; 
    121120          
    122          $this->Sanitize->paranoid($this->data["Webquest"]["title"]);  
     121         $this->Sanitize->clean($this->data["Webquest"]["title"]);  
    123122 
    124123         $this->data["Webquest"]["user_id"] = $this->Auth->user('id'); 
     
    210209    */ 
    211210    exit(var_dump($this->data["Webquest"])); 
    212          if ($this->Webquest->save($this->data["Webquest"])) 
    213          { 
     211     
     212     
     213        if ($this->Webquest->save($this->data["Webquest"])) 
     214        { 
    214215            $this->msgFlash('Webquest saved', '/admin/webquests/edit/'.$this->data["Webquest"]["id"]); 
    215216            exit(); 
  • trunk/app/models/vclassroom.php

    r282 r340  
    33*  Karamelo E-Learning Platform 
    44*  Manuel Montoya 2002-2008  
    5 *  Chipotle Software 
     5*  Chipotle Software TM 
    66*  GPLv3 manuel<at>mononeurona<punto>org 
    77*/  
  • trunk/app/views/ecourses/admin_add.ctp

    r301 r340  
    1 <?php echo $form->create('Ecourse', array('action'=>'admin_add', 'onsubmit'=>'return chkForm()'));  ?> 
     1<?php echo $form->create('Ecourse', array('onsubmit'=>'return chkForm()'));  ?> 
    22<fieldset> 
    33  <legend>New Course</legend> 
     
    1111 
    1212 echo $form->input('Ecourse.code', array("size" => 12, "maxlenght" => 12))  . ' max. 12 characters, ie.ROM2121'; 
    13  echo $form->error('Ecourse/code', 'A category description is required.'); 
     13 echo $form->error('Ecourse.code', 'A category description is required.'); 
    1414  
    1515 echo $form->label('Ecourse.subject_id', 'Subject:'); 
     
    2727<script type="text/javascript"> 
    2828/* <![CDATA[ */ 
    29 function mostrar(a) 
    30 { 
    31   var Div = document.getElementById(a); 
    32  
    33   if (Div.style.display == "none") 
    34   { 
    35        Div.style.display = "block"; 
    36   } 
    37   else 
    38   {  
    39            Div.style.display = "none"; 
    40   } 
    41  } 
    4229 
    4330function chkForm() 
  • trunk/app/views/ecourses/admin_edit.ctp

    r268 r340  
    11<?php  
    2 echo $html->formTag('/admin/ecourses/edit','post', array("onsubmit"=>"return chkForm();"));  
    3 echo $html->hidden('Ecourse/id'); 
     2echo $form->create('Ecourse',array("onsubmit"=>"return chkForm();"));  
     3echo $form->hidden('Ecourse.id'); 
    44?> 
    55<fieldset> 
     
    77<p>By default, your course is accessible to everybody. If you want some c0onfidentiality, the simplest way is to open registration during one week, ask the students to register themselves, then close registration and check for possible intruders in the user list.</p> 
    88  <?php  
    9     echo $form->labelTag('Ecourse/title', 'Title:'); 
    10     echo $html->input('Ecourse/title', array("size" => 30, "maxlength" => 90)) . ' e.g. History of Literature'; 
    11     echo $html->tagErrorMsg('Ecourse/title', 'A FAQ title is required.'); 
    12      
    13     echo $form->labelTag('Ecourse/description', 'Description:'); 
    14     echo $html->textarea('Ecourse/description', array("cols" => 40, "rows" =>4)); 
    15    
    16   
    17     echo $form->labelTag('Ecourse/code', 'Code:' ); 
    18     echo $html->input('Ecourse/code', array("size" => 12, "maxlenght" => 12))  . ' max. 12 characters, ie.ROM2121'; 
    19     echo $html->tagErrorMsg('Ecourse/code', 'A category description is required.'); 
     9    echo $form->input('Ecourse.title', array("size" => 30, "maxlength" => 90)) . ' e.g. History of Literature'; 
     10    echo $form->error('Ecourse.title', 'A FAQ title is required.'); 
     11     
     12    echo $form->label('Ecourse.description', 'Description:'); 
     13    echo $form->textarea('Ecourse.description', array("cols" => 40, "rows" =>4)); 
     14     
     15     
     16    echo $form->input('Ecourse.code', array("size" => 12, "maxlenght" => 12))  . ' max. 12 characters, ie.ROM2121'; 
     17    echo $form->error('Ecourse.code', 'A category description is required.'); 
    2018  ?> 
    2119  <br /><br /> 
    2220<?php 
    23     echo $form->labelTag('Ecourse/subject_id', 'Subject:'); 
    24     echo $html->selectTag('Ecourse/subject_id', $subjects, null, null, null, false); 
     21    echo $form->label('Ecourse.subject_id', 'Subject:'); 
     22    echo $form->select('Ecourse.subject_id', $subjects, null, null, null, false); 
    2523 
    26     echo $form->labelTag('Ecourse/lang_id', 'Lang:'); 
    27     echo $html->selectTag('Ecourse/lang_id', $langs, null, null, null, false); 
     24    echo $form->label('Ecourse.lang_id', 'Lang:'); 
     25    echo $form->select('Ecourse.lang_id', $langs, null, null, null, false); 
    2826?> 
    2927  <div style="clear:both"></div> 
    30   <?php echo $form->labelTag('Ecourse/status', 'Activate:' );?><br /> 
    31   <?php echo $html->checkbox('Ecourse/status', null, array("value"=>1)); ?><br /> 
     28  <?php echo $form->label('Ecourse.status', 'Activate:' );?><br /> 
     29  <?php echo $form->checkbox('Ecourse.status', null, array("value"=>1)); ?><br /> 
    3230  <br /><br /> 
    33   <?php echo $form->labelTag('Ecourse/access', 'Restricted access:' );?><br /> 
    34   <?php echo $html->checkbox('Ecourse/access', null, array("value"=>1, "onclick" => "mostrar('invi_code')")); ?><br /> 
    35  
    36 <div id="invi_code" style="display:none;"> 
    37 <?php 
    38     echo $form->labelTag('Ecourse/secret', 'Secret:' ); 
    39     echo $html->input('Ecourse/secret', array("size" => 6, "maxlength" => 6)) . 'The code to allow students register by themselves'; 
    40 ?> 
    41 </div> 
    4231 
    4332  <div style="clear:both"></div> 
    4433  <br /> 
    45   <?php echo $html->submit('Save') ?> 
     34  <?php echo $form->submit('Save') ?> 
    4635</fieldset> 
    4736</form> 
    4837<script type="text/javascript"> 
    4938/* <![CDATA[ */ 
    50 function mostrar(a) 
    51 { 
    52   var Div = document.getElementById(a); 
    53  
    54   if (Div.style.display == "none") 
    55   { 
    56        Div.style.display = "block"; 
    57    } 
    58    else 
    59    {  
    60            Div.style.display = "none"; 
    61     } 
    62  } 
    63  
    6439function chkForm() 
    6540{  
  • trunk/app/views/ecourses/admin_listing.ctp

    r301 r340  
    2323      echo $html->link($val['Ecourse']['title'], '/admin/ecourses/vclassrooms/'.$val['Ecourse']['id']); 
    2424      echo '<p>' . $val['Ecourse']['description']  . '</p>'; 
    25       echo '<p style="margin-left:15px;">Code:'. $val['Ecourse']['code']  . '</p>'; 
    2625      echo '<div class="butonright">'. $gags->confirmDel($val['Ecourse']['id'], 'ecourses') .'</div>'; 
    2726 echo '</div>'; 
  • trunk/app/views/users/login.ctp

    r339 r340  
    22<?php 
    33echo $form->create('User', array('action' => 'login')); 
    4 echo $form->input('email', array('size' => 20, 'maxlength'=> 50)); 
     4echo $form->input('email', array('size' => 40, 'maxlength'=> 50)); 
    55echo $form->label('pwd', 'Password:'); 
    66echo $form->password('pwd') . '<br />'; 
  • trunk/app/views/webquests/admin_edit.ctp

    r270 r340  
    44 echo $html->addCrumb('Control Tools', '/admin/entries/start');   
    55 echo $html->addCrumb('Webquest', '/admin/webquests/listing');  
    6 ?>  
    7 <?php echo $html->getCrumbs(' / '); ?> 
     6 echo $html->getCrumbs(' / ');  
     7?> 
    88<div style="clear:both"></div> 
    99<h2>Editing: <?php echo $wq_title; ?></h2> 
     
    1414    echo $html->link($html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#', array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false); 
    1515     
    16     echo $html->link($html->image('static/eye_icon.gif', array("alt"=>"See webquest", "title"=>"See webquest")), '#', array("onclick"=>"javascript:window.open('/webquests/display/".$othAuth->user('username')."/".$id."', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false); 
     16    echo $html->link($html->image('static/eye_icon.gif', array("alt"=>"See webquest", "title"=>"See webquest")), '#', array("onclick"=>"javascript:window.open('/webquests/display/".$cU['User']['username']."/".$id."', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false); 
    1717   ?> 
    1818</p> 
     
    5757 
    5858<?php 
    59  echo $ajax->div('setform', array("style"=>"padding:6px;")); 
    60  echo $ajax->divEnd('setform'); 
     59 echo $ajax->div('setform', array("style"=>"padding:6px;")) . $ajax->divEnd('setform'); 
    6160  
    6261 echo $fck->fckAjax();  
  • trunk/app/views/webquests/admin_listing.ctp

    r270 r340  
    1  
    2  
    31<div class="title_section"> Webquest </div> 
    42 
    53<?php 
    6 echo $ajax->div('loading', array("style"=>"display: none")); 
    7                   echo $html->image("static/loading.gif", array("alt"=>"Loading")); 
    8 echo $ajax->divEnd('loading'); 
     4echo $ajax->div('loading', array("style"=>"display: none")) . $html->image("static/loading.gif", array("alt"=>"Loading")) . $ajax->divEnd('loading'); 
    95 
    106echo $ajax->div('envelope'); 
     
    1612); 
    1713 
    18 echo $ajax->div('setform'); 
    19 echo $ajax->divEnd('setform'); 
     14echo $ajax->div('setform') . $ajax->divEnd('setform'); 
    2015 
    2116echo $ajax->divEnd('envelope'); 
  • trunk/app/views/webquests/admin_start.ctp

    r270 r340  
    1 <?php echo $html->formTag('/admin/webquests/add','post', array("onsubmit"=>"return validateWebquest();")); ?> 
     1<?php echo $form->create('Webquest', array('onsubmit'=>'return validateWebquest()', 'action'=>'admin_add')); ?> 
    22<fieldset> 
    33  <legend>New Webquest</legend> 
    44  <?php  
    5     echo $form->labelTag('Webquest/title', 'Title:' ); 
    6     echo $html->input('Webquest/title', array("size" => 40, "maxlength" => 150)); 
    7     echo $html->tagErrorMsg('Webquest/title', 'A title is required.'); 
     5    echo $form->input('Webquest.title', array("size" => 40, "maxlength" => 150)); 
     6    echo $form->error('Webquest.title', 'A title is required.'); 
    87  ?> 
    98  <div style="clear:both"></div> 
    10   <br /> 
    11   <?php echo $html->submit('Save') ?> 
    12 </fieldset> 
    13 </form> 
     9  <br /></fieldset> 
     10  <?php echo $form->end('Save'); ?>