Changeset 340
- Timestamp:
- 03/24/08 18:37:16 (10 months ago)
- Location:
- trunk/app
- Files:
-
- 1 added
- 11 modified
-
config/sql/karamelo_postgres.sql (modified) (1 diff)
-
controllers/ecourses_controller.php (modified) (4 diffs)
-
controllers/webquests_controller.php (modified) (4 diffs)
-
models/vclassroom.php (modified) (1 diff)
-
views/ecourses/admin_add.ctp (modified) (3 diffs)
-
views/ecourses/admin_edit.ctp (modified) (2 diffs)
-
views/ecourses/admin_listing.ctp (modified) (1 diff)
-
views/layouts/email/text/confirmation.ctp (added)
-
views/users/login.ctp (modified) (1 diff)
-
views/webquests/admin_edit.ctp (modified) (3 diffs)
-
views/webquests/admin_listing.ctp (modified) (2 diffs)
-
views/webquests/admin_start.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/sql/karamelo_postgres.sql
r339 r340 328 328 "title" varchar(110) NOT NULL, 329 329 "description" text, 330 "code" varchar(15), -- secret code to allow students join to the ecourse, voM121x for instance331 330 "created" timestamp(0) with time zone DEFAULT now() NOT NULL, 332 331 "status" smallint DEFAULT 0 NOT NULL, -
trunk/app/controllers/ecourses_controller.php
r301 r340 11 11 { 12 12 public $helpers = array('Fck', 'Gags', 'Paginator'); 13 13 14 public function beforeFilter() 15 { 16 $this->Auth->allow(array('display')); 17 parent::beforeFilter(); 18 } 14 19 public function isAuthorized() 15 20 { … … 33 38 34 39 $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'); 36 41 $order = "Ecourse.title DESC"; 37 42 … … 43 48 44 49 $conditions = array("user_id"=>$this->Auth->user('id')); 45 $fields = array('id', 'title', 'status', ' code', 'description');50 $fields = array('id', 'title', 'status', 'description'); 46 51 $order = "Ecourse.id DESC"; 47 52 $limit = 10; … … 57 62 58 63 $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'); 60 65 $order = "Ecourse.id DESC"; 61 66 -
trunk/app/controllers/webquests_controller.php
r339 r340 3 3 * Karamelo E-Learning Platform 4 4 * Manuel Montoya 2002-2008 5 * GPL manuel<at>mononeurona.org5 * GPLv3 manuel<arroba>mononeurona<punto>org 6 6 */ 7 7 … … 57 57 $limit = 20; 58 58 59 $this->set('username',$username);60 59 $this->set('data', $this->Webquest->findAll($conditions, $fields, $order, $limit)); 61 60 } … … 120 119 $this->Sanitize = new Sanitize; 121 120 122 $this->Sanitize-> paranoid($this->data["Webquest"]["title"]);121 $this->Sanitize->clean($this->data["Webquest"]["title"]); 123 122 124 123 $this->data["Webquest"]["user_id"] = $this->Auth->user('id'); … … 210 209 */ 211 210 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 { 214 215 $this->msgFlash('Webquest saved', '/admin/webquests/edit/'.$this->data["Webquest"]["id"]); 215 216 exit(); -
trunk/app/models/vclassroom.php
r282 r340 3 3 * Karamelo E-Learning Platform 4 4 * Manuel Montoya 2002-2008 5 * Chipotle Software 5 * Chipotle Software TM 6 6 * GPLv3 manuel<at>mononeurona<punto>org 7 7 */ -
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()')); ?> 2 2 <fieldset> 3 3 <legend>New Course</legend> … … 11 11 12 12 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.'); 14 14 15 15 echo $form->label('Ecourse.subject_id', 'Subject:'); … … 27 27 <script type="text/javascript"> 28 28 /* <![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 else38 {39 Div.style.display = "none";40 }41 }42 29 43 30 function chkForm() -
trunk/app/views/ecourses/admin_edit.ctp
r268 r340 1 1 <?php 2 echo $ html->formTag('/admin/ecourses/edit','post',array("onsubmit"=>"return chkForm();"));3 echo $ html->hidden('Ecourse/id');2 echo $form->create('Ecourse',array("onsubmit"=>"return chkForm();")); 3 echo $form->hidden('Ecourse.id'); 4 4 ?> 5 5 <fieldset> … … 7 7 <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> 8 8 <?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.'); 20 18 ?> 21 19 <br /><br /> 22 20 <?php 23 echo $form->label Tag('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); 25 23 26 echo $form->label Tag('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); 28 26 ?> 29 27 <div style="clear:both"></div> 30 <?php echo $form->label Tag('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 /> 32 30 <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 <?php38 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>42 31 43 32 <div style="clear:both"></div> 44 33 <br /> 45 <?php echo $ html->submit('Save') ?>34 <?php echo $form->submit('Save') ?> 46 35 </fieldset> 47 36 </form> 48 37 <script type="text/javascript"> 49 38 /* <![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 else59 {60 Div.style.display = "none";61 }62 }63 64 39 function chkForm() 65 40 { -
trunk/app/views/ecourses/admin_listing.ctp
r301 r340 23 23 echo $html->link($val['Ecourse']['title'], '/admin/ecourses/vclassrooms/'.$val['Ecourse']['id']); 24 24 echo '<p>' . $val['Ecourse']['description'] . '</p>'; 25 echo '<p style="margin-left:15px;">Code:'. $val['Ecourse']['code'] . '</p>';26 25 echo '<div class="butonright">'. $gags->confirmDel($val['Ecourse']['id'], 'ecourses') .'</div>'; 27 26 echo '</div>'; -
trunk/app/views/users/login.ctp
r339 r340 2 2 <?php 3 3 echo $form->create('User', array('action' => 'login')); 4 echo $form->input('email', array('size' => 20, 'maxlength'=> 50));4 echo $form->input('email', array('size' => 40, 'maxlength'=> 50)); 5 5 echo $form->label('pwd', 'Password:'); 6 6 echo $form->password('pwd') . '<br />'; -
trunk/app/views/webquests/admin_edit.ctp
r270 r340 4 4 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 5 5 echo $html->addCrumb('Webquest', '/admin/webquests/listing'); 6 ?>7 <?php echo $html->getCrumbs(' / ');?>6 echo $html->getCrumbs(' / '); 7 ?> 8 8 <div style="clear:both"></div> 9 9 <h2>Editing: <?php echo $wq_title; ?></h2> … … 14 14 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); 15 15 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); 17 17 ?> 18 18 </p> … … 57 57 58 58 <?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'); 61 60 62 61 echo $fck->fckAjax(); -
trunk/app/views/webquests/admin_listing.ctp
r270 r340 1 2 3 1 <div class="title_section"> Webquest </div> 4 2 5 3 <?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'); 4 echo $ajax->div('loading', array("style"=>"display: none")) . $html->image("static/loading.gif", array("alt"=>"Loading")) . $ajax->divEnd('loading'); 9 5 10 6 echo $ajax->div('envelope'); … … 16 12 ); 17 13 18 echo $ajax->div('setform'); 19 echo $ajax->divEnd('setform'); 14 echo $ajax->div('setform') . $ajax->divEnd('setform'); 20 15 21 16 echo $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')); ?> 2 2 <fieldset> 3 3 <legend>New Webquest</legend> 4 4 <?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.'); 8 7 ?> 9 8 <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'); ?>
