Changeset 437

Show
Ignore:
Timestamp:
04/28/08 13:00:06 (9 months ago)
Author:
aarkerio
Message:

Treasures changes

Location:
trunk/app
Files:
5 modified

Legend:

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

    r327 r437  
    7676 
    7777 
    78  /** 
    79     === ADMIN METHODS  === 
    80   **/  
     78 /**    === ADMIN METHODS  === **/  
    8179 public function admin_listing() 
    8280 {    
     
    106104          
    107105          $this->data["Treasure"]["user_id"] = $this->Auth->user('id'); 
    108  
     106          //die(debug($this->data["Treasure"])); 
    109107          $this->Treasure->create(); 
    110108          
  • trunk/app/views/helps/display.ctp

    r435 r437  
    1 <div id="marco"> 
    21<?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); 
    89?> 
    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(' / ');  
    26 
    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?> 
    69 
    7 <?php echo $html->formTag('/admin/treasures/add/','post', array("onsubmit"=>"return validateNew()")); ?> 
    8  
    9 <table> 
     10<table style="width:100%;"> 
    1011<tr> 
    1112<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> 
    1615<td> 
    1716  <?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  
    1917</td></tr> 
    2018 
    2119<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 
    2626</td></tr> 
    2727<tr><td colspan="2"> 
    28               <?php  
    29               echo $form->labelTag('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           ?> 
    3232</td> 
    3333<td> 
    3434            <?php  
    35               echo $form->labelTag('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            ?> 
    3838</td> 
    3939</tr> 
    4040   
    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> 
    4242</table> 
    4343 
  • trunk/app/views/treasures/admin_edit.ctp

    r253 r437  
    1 <?php echo $javascript->link('fckeditor/fckeditor'); ?>  
     1<?php echo $javascript->link('fckeditor/fckeditor');  
    22 
    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'); 
    108?> 
    119 
     
    1311<tr> 
    1412<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)); ?> 
    1814</td> 
    1915<td> 
     
    2319 
    2420<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'); ?>  
    2924</td></tr> 
    3025<tr><td colspan="2"> 
    31               <?php  
    32               echo $form->labelTag('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         ?> 
    3530</td> 
    3631<td> 
    37             <?php  
    38               echo $form->labelTag('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       ?> 
    4136</td> 
    4237</tr> 
    4338   
    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> 
    4540</table> 
    4641 
  • 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 )); 
    43 
    5 <div class="title_section"> Treasure </div> 
     4echo $html->div('title_section', 'Treasures'); 
    65 
    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> 
     6echo $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                );  
    129 
    13 <table class="tbadmin"> 
    14 <?php 
    1510//die(print_r($data)); 
    16  
    17 $th = array ('Edit', 'Title', 'Status', 'Delete'); 
    18  
    19 echo $html->tableHeaders($th);   
    2011 
    2112foreach ($data as $val)  
    2213{ 
    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>'; 
    3453} 
    35 ?> 
    36 </table> 
    37  
    38 <?php  
    39 //echo $pagination;  
    40 ?> 
    41  
     54?>