Changeset 437
- Timestamp:
- 04/28/08 13:00:06 (9 months ago)
- Location:
- trunk/app
- Files:
-
- 5 modified
-
controllers/treasures_controller.php (modified) (2 diffs)
-
views/helps/display.ctp (modified) (1 diff)
-
views/treasures/admin_add.ctp (modified) (1 diff)
-
views/treasures/admin_edit.ctp (modified) (3 diffs)
-
views/treasures/admin_listing.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/treasures_controller.php
r327 r437 76 76 77 77 78 /** 79 === ADMIN METHODS === 80 **/ 78 /** === ADMIN METHODS === **/ 81 79 public function admin_listing() 82 80 { … … 106 104 107 105 $this->data["Treasure"]["user_id"] = $this->Auth->user('id'); 108 106 //die(debug($this->data["Treasure"])); 109 107 $this->Treasure->create(); 110 108 -
trunk/app/views/helps/display.ctp
r435 r437 1 <div id="marco">2 1 <?php 3 echo $html->div('titulo', 'Karamelo Help'); 4 //die(print_r($data)); 5 echo $data['Help']['help'].'<br />'; 6 echo 'URL: ' . $data['Help']['url'].'<br />'; 7 echo 'Lang: ' . $data['Help']['lang'].'<br />'; 2 //die(debug($data)); 3 $tmp = $html->div('titulo', 'Karamelo Help'); 4 $tmp .= $data['Help']['help'].'<br />'; 5 $tmp .= 'URL: ' . $data['Help']['url'].'<br />'; 6 $tmp .= 'Lang: ' . $data['Help']['lang'].'<br />'; 7 8 echo $html->div('marco', $tmp); 8 9 ?> 9 </div> 10 -
trunk/app/views/treasures/admin_add.ctp
r253 r437 1 <?php echo $javascript->link('fckeditor/fckeditor'); ?> 1 <?php 2 echo $javascript->link('fckeditor/fckeditor'); 3 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 4 echo $html->addCrumb('Treasures', '/admin/treasures/listing'); 5 echo $html->getCrumbs(' / '); 2 6 3 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?> 4 <?php echo $html->addCrumb('News', '/admin/treasures/listing'); ?> 5 <?php echo $html->getCrumbs(' / '); ?> 7 echo $form->create('Treasure', array('onsubmit'=>'return validateNew()')); 8 ?> 6 9 7 <?php echo $html->formTag('/admin/treasures/add/','post', array("onsubmit"=>"return validateNew()")); ?> 8 9 <table> 10 <table style="width:100%;"> 10 11 <tr> 11 12 <td colspan="2"> 12 <?php echo $form->labelTag('Treasure/title', 'Title:' ); ?> 13 <?php echo $html->input('Treasure/title', array("size" => 40, "maxlength" => 120)); ?> 14 <?php echo $html->tagErrorMsg('Treasure/title', 'Title is required.'); ?> 15 </td> 13 <?php echo $form->input('Treasure.title', array("size" => 40, "maxlength" => 120)); ?> 14 </td> 16 15 <td> 17 16 <?php 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); ?> 18 19 17 </td></tr> 20 18 21 19 <tr><td colspan="3"> 22 <?php echo $form->labelTag('Treasure/intructions', 'Instructions:' );?><br /> 23 <?php echo $html->textarea('Treasure/instructions', array("cols"=>80, "rows"=>45)) ?> 24 <?php echo $fck->load('Treasure/instructions', 'Karamelo'); ?> 25 <?php echo $html->tagErrorMsg('Treasure/instructions', 'Instructions is required.'); ?> 20 <?php 21 echo $form->label('Treasure.intructions', 'Instructions:' ); 22 echo $form->textarea('Treasure.instructions', array('cols'=>80, 'rows'=>45)); 23 echo $fck->load('TreasureInstructions', 'Karamelo'); 24 ?> 25 26 26 </td></tr> 27 27 <tr><td colspan="2"> 28 <?php29 echo $form->label Tag('Treasure/status', 'Published:');30 echo $ html->checkbox('Treasure/status', null, array("value"=>1));31 ?>28 <?php 29 echo $form->label('Treasure.status', 'Published:'); 30 echo $form->checkbox('Treasure.status', array("value"=>1)); 31 ?> 32 32 </td> 33 33 <td> 34 34 <?php 35 echo $form->label Tag('Treasure/end', 'Finish editing:');36 echo $ html->checkbox('Treasure/end', null, array("value"=>1));37 ?>35 echo $form->label('Treasure.end', 'Finish editing:'); 36 echo $form->checkbox('Treasure.end', null, array("value"=>1)); 37 ?> 38 38 </td> 39 39 </tr> 40 40 41 <tr><td colspan="3"> <?php echo $ html->submit('Add'); ?> </form></td></tr>41 <tr><td colspan="3"> <?php echo $form->end('Save'); ?> </td></tr> 42 42 </table> 43 43 -
trunk/app/views/treasures/admin_edit.ctp
r253 r437 1 <?php echo $javascript->link('fckeditor/fckeditor'); ?>1 <?php echo $javascript->link('fckeditor/fckeditor'); 2 2 3 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?> 4 <?php echo $html->addCrumb('News', '/admin/treasures/listing'); ?> 5 <?php echo $html->getCrumbs(' / '); ?> 6 7 <?php 8 echo $html->formTag('/admin/treasures/edit/','post', array("onsubmit"=>"return chkForm()")); 9 echo $html->hidden('Treasure/id'); 3 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 4 echo $html->addCrumb('News', '/admin/treasures/listing'); 5 echo $html->getCrumbs(' / '); 6 echo $form->create('Treasure',array('onsubmit'=>'return chkForm()')); 7 echo $form->hidden('Treasure.id'); 10 8 ?> 11 9 … … 13 11 <tr> 14 12 <td colspan="2"> 15 <?php echo $form->labelTag('Treasure/title', 'Title:' ); ?> 16 <?php echo $html->input('Treasure/title', array("size" => 40, "maxlength" => 120)); ?> 17 <?php echo $html->tagErrorMsg('Treasure/title', 'Title is required.'); ?> 13 <?php echo $form->input('Treasure.title', array('size' => 40, 'maxlength' => 120)); ?> 18 14 </td> 19 15 <td> … … 23 19 24 20 <tr><td colspan="3"> 25 <?php echo $form->labelTag('Treasure/intructions', 'Instructions:' );?><br /> 26 <?php echo $html->textarea('Treasure/instructions', array("cols"=>80, "rows"=>45)) ?> 27 <?php echo $fck->load('Treasure/instructions', 'Karamelo'); ?> 28 <?php echo $html->tagErrorMsg('Treasure/instructions', 'Instructions is required.'); ?> 21 <?php echo $form->label('Treasure.intructions', 'Instructions:');?><br /> 22 <?php echo $form->textarea('Treasure.instructions', array("cols"=>80, "rows"=>25)) ?> 23 <?php echo $fck->load('TreasureInstructions', 'Karamelo'); ?> 29 24 </td></tr> 30 25 <tr><td colspan="2"> 31 <?php32 echo $form->label Tag('Treasure/status', 'Published:' );33 echo $ html->checkbox('Treasure/status', null, array("value"=>1));34 ?>26 <?php 27 echo $form->label('Treasure.status', 'Published:' ); 28 echo $form->checkbox('Treasure.status', array('value'=>1)); 29 ?> 35 30 </td> 36 31 <td> 37 <?php38 echo $form->label Tag('Treasure/end', 'Finish editing:' );39 echo $ html->checkbox('Treasure/end', null, array("value"=>1));40 ?>32 <?php 33 echo $form->label('Treasure.end', 'Finish editing:' ); 34 echo $form->checkbox('Treasure.end', array('value'=>1)); 35 ?> 41 36 </td> 42 37 </tr> 43 38 44 <tr><td colspan="3"> <?php echo $html->submit('Add'); ?> </form></td></tr>39 <tr><td colspan="3"> <?php echo $form->end('Save'); ?> </td></tr> 45 40 </table> 46 41 -
trunk/app/views/treasures/admin_listing.ctp
r253 r437 1 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?> 2 <?php echo $html->addCrumb('Treasures', '/admin/treasures/listing'); ?> 3 <?php echo $html->getCrumbs(' / '); ?> 1 <?php 2 //die( debug( $data )); 4 3 5 <div class="title_section"> Treasure </div> 4 echo $html->div('title_section', 'Treasures'); 6 5 7 <?php 8 echo $html->link($html->image('actions/new.png', array("alt"=>"Add Treasure", "title"=>"Add Treasure")), 9 '/admin/treasures/add', null, false, false); 10 ?> 11 </div> 6 echo $html->para(null, 7 $html->link($html->image('actions/new.png', array("alt"=>"Add treasure", "title"=>"Add treasure")), '/admin/treasures/add', null, false, false) 8 ); 12 9 13 <table class="tbadmin">14 <?php15 10 //die(print_r($data)); 16 17 $th = array ('Edit', 'Title', 'Status', 'Delete');18 19 echo $html->tableHeaders($th);20 11 21 12 foreach ($data as $val) 22 13 { 23 $status = $gags->setStatus($val['Treasure']['status']); 24 25 $tr = array ( 26 $gags->sendEdit($val['Treasure']['id'], 'treasures'), 27 $val['Treasure']['title'], 28 $html->link($status, '/admin/treasures/change/'.$val['Treasure']['id'] .'/'. $val['Treasure']['status']), 29 $gags->confirmDel($val['Treasure']['id'], 'treasures') 30 ); 31 32 echo $html->tableCells($tr, array("class"=>"altRow", "onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='altRow'"), 33 array('class'=>'evenRow',"onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='evenRow'")); 14 $s = ($val['Treasure']['status'] == 1) ? 'Published': 'Draft'; 15 16 echo '<div class="grayblock">'; 17 echo $html->div('butonright', $gags->sendEdit($val['Treasure']['id'], 'treasures')); 18 echo $html->div('div_title', $val['Treasure']['title']); 19 echo $html->para(null, '<b>Treasure description:</b> '.$val['Treasure']['description']); 20 21 echo $html->link('Questions', '/admin/treasures/questions/'.$val['Treasure']['id']); 22 echo $html->link($html->image('admin/questions_icon.gif', array('alt'=>'Questions', 'title'=>'Questions')), 23 '/admin/treasures/questions/'.$val['Treasure']['id'], null, null, false) . '<br />'; 24 if ( count($val['Vclassroom']) < 1 ) 25 { 26 27 echo $html->para(null, $html->link( 28 $html->image('admin/vgroups-gray.gif', array( 29 'alt' =>'There is no class assigned for this test', 30 'title'=>'There is no class assigned for this test' 31 ) 32 ), 33 '/admin/treasures/vclassrooms/'.$val['Treasure']['id'], null, null, false)); 34 } 35 else 36 { 37 echo $html->para(null, $html->link( 38 $html->image('static/vgroups.gif', array( 39 'alt' =>'Assign this test to new class', 40 'title'=>'Assign this test to new class' 41 ) 42 ), 43 '/admin/treasures/vclassrooms/'.$val['Treasure']['id'], null, null, false)); 44 45 foreach($val['Vclassroom'] as $class): 46 echo $html->para(null, 'This test had been assigned to class: '. $html->link($class['name'], '/admin/vclassrooms/members/'.$class['id']) . '</b>'); 47 endforeach; 48 } 49 50 echo $html->para(null, $html->link($s, '/admin/treasures/change/'.$val['Treasure']['id'].'/'.$val['Treasure']['status'])); 51 echo $html->div('butonright', $gags->confirmDel($val['Treasure']['id'], 'treasures')); 52 echo '</div>'; 34 53 } 35 ?> 36 </table> 37 38 <?php 39 //echo $pagination; 40 ?> 41 54 ?>
