Changeset 418
- Timestamp:
- 04/22/08 00:33:07 (9 months ago)
- Location:
- trunk/app
- Files:
-
- 4 modified
-
config/sql/karamelo_postgres.sql (modified) (1 diff)
-
controllers/webquests_controller.php (modified) (3 diffs)
-
views/webquests/admin_edit.ctp (modified) (2 diffs)
-
views/webquests/admin_vclassrooms.ctp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/sql/karamelo_postgres.sql
r416 r418 518 518 "user_id" int REFERENCES users(id) ON DELETE CASCADE, 519 519 "status" smallint NOT NULL DEFAULT 0, 520 "value" smallint NOT NULL DEFAULT 10, 520 521 "karanet" smallint NOT NULL DEFAULT 0 -- share karanet? 521 522 ); -
trunk/app/controllers/webquests_controller.php
r417 r418 208 208 } 209 209 */ 210 exit(var_dump($this->data["Webquest"]));210 //exit(var_dump($this->data["Webquest"])); 211 211 212 212 213 if ($this->Webquest->save($this->data[ "Webquest"]))213 if ($this->Webquest->save($this->data['Webquest'])) 214 214 { 215 $this->msgFlash('Webquest saved', '/admin/webquests/edit/'.$this->data["Webquest"]["id"]); 216 exit(); 217 } 218 else 219 { 215 $this->msgFlash('Webquest saved', '/admin/webquests/edit/'.$this->data['Webquest']['id']); 216 } 217 else 218 { 220 219 $this->msgFlash('Database error!', '/admin/webquests/listing'); 221 }220 } 222 221 } 223 222 else … … 300 299 $this->Webquest->VclassroomsWebquest->create(); 301 300 302 if ( $this->Webquest->VclassroomsWebquest->save($this->data['VclassroomsWebquest'])) 303 { 304 $this->msgFlash('Webquest assigned', '/admin/tests/vclassrooms/'.$this->data['VclassroomsWebquest']['webquest_id']); 305 } 306 else 307 { 301 if ( $this->Webquest->VclassroomsWebquest->save($this->data['VclassroomsWebquest'])): 302 $this->msgFlash('Webquest assigned', '/admin/webquests/vclassrooms/'.$this->data['VclassroomsWebquest']['webquest_id']); 303 else: 308 304 die('Something is wrong, please report this bug'); 309 }305 endif; 310 306 } 311 307 } … … 323 319 if ( $this->Webquest->VclassroomsWebquest->delete($this->data['VclassroomsWebquest']['id'])) 324 320 { 325 $this->msgFlash('Webquest unlinked', '/admin/ tests/vclassrooms/'.$this->data['VclassroomsWebquest']['webquest_id']);321 $this->msgFlash('Webquest unlinked', '/admin/webquests/vclassrooms/'.$this->data['VclassroomsWebquest']['webquest_id']); 326 322 } 327 323 else -
trunk/app/views/webquests/admin_edit.ctp
r340 r418 7 7 ?> 8 8 <div style="clear:both"></div> 9 <h2>Editing: <?php echo $wq_title; ?></h2> 10 9 <h2>Editing: <?php echo $wq_title . ' ' . $html->link('Edit', '#', array('onclick'=>'hU()')); ?></h2> 10 11 <div id="tit" style="margin:0;padding:0;padding-left:40px;width:80%;display:none;"> 12 <?php 13 echo $form->create('Webquest'); 14 echo $form->input('Webquest.title', array('size'=>60,'maxlength'=>160,'value'=>$wq_title)); 15 echo $form->hidden('Webquest.id', array('value'=>$id)); 16 echo $form->end('Save'); 17 ?> 18 </div> 11 19 <!--my images window --> 12 20 <p style="text-align:right;"> … … 61 69 echo $fck->fckAjax(); 62 70 ?> 71 72 <script type="text/javascript"> 73 <!-- 74 function hU() { 63 75 76 var Div = document.getElementById('tit'); 77 78 if (Div.style.display == 'none') 79 Div.style.display = 'block'; 80 else 81 Div.style.display = 'none'; 82 83 } 84 --> 85 </script> 86 -
trunk/app/views/webquests/admin_vclassrooms.ctp
r417 r418 16 16 if ( !in_array($val['Vclassroom']['id'], $vclasses) ): 17 17 $tmp = $html->para(null, $html->image('admin/link.gif').$val['Vclassroom']['name']); 18 $tmp .= $form->create(' Test', array('action'=>'link2class'));18 $tmp .= $form->create('Webquest', array('action'=>'link2class')); 19 19 $tmp .= $form->hidden('VclassroomsWebquest.webquest_id', array('value'=>$webquest_id)); 20 20 $tmp .= $form->hidden('VclassroomsWebquest.vclassroom_id', array('value'=>$val['Vclassroom']['id'])); … … 25 25 $tmp = $html->para(null, $html->image('admin/unlink.gif').'This test is already assigned to <b>'.$val['Vclassroom']['name'].'</b>'); 26 26 27 foreach ( $webquests as $test): 28 if ($test['VclassroomsWebquest']['vclassroom_id'] == $val['Vclassroom']['id']) 29 { 30 $webquestsvclasroom_id = $test['VclassroomsWebquest']['id']; 31 } 27 foreach ( $webquests as $wq): 28 if ($wq['VclassroomsWebquest']['vclassroom_id'] == $val['Vclassroom']['id']): 29 $id = $wq['VclassroomsWebquest']['id']; 30 endif; 32 31 endforeach; 33 32 34 33 35 $tmp .= $form->create(' Test', array('action'=>'unlink2class'));36 $tmp .= $form->hidden('VclassroomsWebquest.id', array('value'=>$ webquestsvclasroom_id));37 $tmp .= $form->hidden('VclassroomsWebquest.webquest_id', array('value'=>$webquest_id)); 34 $tmp .= $form->create('Webquest', array('action'=>'unlink2class')); 35 $tmp .= $form->hidden('VclassroomsWebquest.id', array('value'=>$id)); 36 $tmp .= $form->hidden('VclassroomsWebquest.webquest_id', array('value'=>$webquest_id)); //used for return here 38 37 $tmp .= $form->end('Unlink this test'); 39 38 endif;
