Changeset 54 for trunk/app/views/lessons

Show
Ignore:
Timestamp:
08/09/07 12:55:08 (16 months ago)
Author:
aarkerio
Message:

General update

Location:
trunk/app/views/lessons
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/lessons/admin_add.thtml

    r19 r54  
    44?> 
    55 
    6 <div class="title_section">Add new Lesson</div> 
    7  
    8 <div class="spaced"> 
    9  
    10 <?php echo $html->formTag('/lessons/add/','post'); ?> 
     6<?php echo $html->formTag('/admin/lessons/add/','post'); ?> 
    117<fieldset> 
    12   <p> 
    13   <?php echo $form->labelTag( 'Lesson/title', 'Title:' );?><br /> 
    14   <?php echo $html->input('Lesson/title', array("size" => 50, "maxlength" => 120, "class"=>"formas")); ?> 
    15   <?php echo $html->tagErrorMsg('Lesson/title', 'Title is required.'); ?> 
    16   <br /><br /> 
    17    
    18   <p><?php echo $form->labelTag( 'Lesson/body', 'Body:' );?><br /> 
    19   <?php echo $html->textarea('Lesson/body', array("class"=>"formas", "cols"=>80, "rows"=>45)) ?> 
    20   <?php echo $fck->load('Lesson/body', 'Karamelo'); ?>  
    21   <?php echo $html->tagErrorMsg('Lesson/body', 'Body is required.'); ?> 
    22   <br /> 
    23   </p> 
    24    
    25   <p><?php echo $form->labelTag( 'Lesson/status', 'Published:' );?><br /> 
    26   <?php echo $html->checkbox('Lesson/status'); ?> 
    27   <br /><br /> 
    28    
    29   <p><?php echo $form->labelTag( 'Lesson/disc', 'Comments allowed to this Lesson:' );?><br /> 
    30   <?php echo $html->checkbox('Lesson/disc'); ?> 
    31   <br /><br /> 
    32    
    33   <?php echo $html->hiddenTag('Lesson/user_id', $othAuth->user('id')) ?> 
    34    
    35    
    36   <br /> 
    37   <?php echo $html->submit('Send'); ?> 
     8<legend>Add Lesson</legend> 
     9<table> 
     10<tr><td> 
     11  <?php  
     12     echo $form->labelTag( 'Lesson/title', 'Title:' ); 
     13     echo $html->input('Lesson/title', array("size" => 50, "maxlength" => 120, "class"=>"formas")); 
     14     echo $html->tagErrorMsg('Lesson/title', 'Title is required.');  
     15  ?> 
     16  </td> 
     17  <td> 
     18  <?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) ?> 
     19</td> 
     20</tr> 
     21<tr> 
     22  <td colspan="2"> 
     23  <?php  
     24      echo $form->labelTag( 'Lesson/body', 'Body:' ); 
     25      echo $html->textarea('Lesson/body', array("class"=>"formas", "cols"=>80, "rows"=>45)); 
     26      echo $fck->load('Lesson/body', 'Karamelo'); 
     27      echo $html->tagErrorMsg('Lesson/body', 'Body is required.');  
     28  ?> 
     29  </td></tr> 
     30  <tr><td> 
     31  <?php  
     32     echo $form->labelTag( 'Lesson/status', 'Published:' ); 
     33     echo $html->checkbox('Lesson/status');  
     34  ?> 
     35  </td><td> 
     36  <?php  
     37      echo $form->labelTag( 'Lesson/disc', 'Comments allowed to this Lesson:' ); 
     38      echo $html->checkbox('Lesson/disc');  
     39  ?> 
     40  </td></tr> 
     41  <tr><td colspan="2">  
     42  <?php echo $html->submit('Save'); ?> 
     43</td></tr> 
     44</table> 
    3845</fieldset> 
    3946</form> 
    40 </div> 
  • trunk/app/views/lessons/admin_listing.thtml

    r19 r54  
    1 <div class="title_section"><?php echo $othAuth->user('name'); ?> Lessons</div> 
     1<script type="text/javascript"> 
     2   window.onload = timedMsg; 
     3</script> 
     4<?php $session->flash(); ?> 
     5<div class="title_section">Lessons</div> 
    26 
    3 <p> 
    4   <?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add Lesson", "title"=>"Add Lesson")), '/lessons/add/', null, false, false) ?> 
    5 </p> 
     7<p><?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add new", "title"=>"Add new")), '/admin/lessons/add', null, false, false) ?></p> 
    68 
     9<table class="tbadmin"> 
    710 
    8 <table class="main_tabula"> 
    911<?php 
     12//die(print_r($data)); 
    1013 
    11 if ( count($data) > 0 ) 
    12 { 
    13   echo '<tr><td></td>'; 
    14   echo '<td>'. $html->link('Title', '/lessons/listing/title')        .  '</td>'; 
    15   echo '<td>'. $html->link('Created', '/lessons/listing/created')    .  '</td>'; 
    16   echo '<td>'. $html->link('Status', '/lessons/listing/status')      .  '</td>'; 
    17   echo '<td></td></tr>'; 
    18 } 
     14$th = array ('Edit', 'Title', 'Status', 'Delete'); 
    1915 
    20 foreach ($data as $key => $val) { 
    21        
    22       $status = ($data[$key]['Lesson']['status'] == 1 ) ? 'Published' : 'No published'; 
    23        
    24       echo "<tr><td>";  
    25       echo $html->formTag('/lessons/delete/'.$data[$key]['Lesson']['id'], 'get', array("onsubmit"=>"return confirm('Are you sure?')")); 
    26       echo $html->submit('Delete'); 
    27       echo "</form>"; 
    28        
    29       echo '</td><td>'; 
    30       echo $data[$key]['Lesson']['title'] . '</td><td>' . $data[$key]['Lesson']['created'] . '</td>'; 
    31       echo '<td>' . $html->link($status, '/lessons/change/'.$data[$key]['Lesson']['id']); 
    32        
    33       echo "</td><td>"; 
    34        
    35       echo $html->formTag('/lessons/edit/'.$data[$key]['Lesson']['id'], 'get'); 
    36       echo $html->submit('Edit'); 
    37       echo "</form>"; 
    38       echo "</td></tr>"; 
    39 } 
     16echo $html->tableHeaders($th); 
     17 
     18foreach ($data as $val) 
     19{       
     20       $status = $gags->setStatus($val['Lesson']['status']); 
     21        
     22       $tr = array ( 
     23        $gags->sendEdit($val['Lesson']['id'], 'lessons'), 
     24        $html->link($val['Lesson']['title'], '/lessons/display/'.$val['Lesson']['id']), 
     25        $html->link($status, '/admin/lessons/change/'.$val['Lesson']['id'] .'/'. $val['Lesson']['status']), 
     26        $gags->confirmDel($val['Lesson']['id'], 'lessons') 
     27        ); 
     28        
     29    echo $html->tableCells($tr, array("class"=>"altRow", "onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='altRow'"),  
     30                                array('class'=>'evenRow',"onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='evenRow'")); 
     31     
     32 } 
    4033?> 
    4134</table> 
    4235 
     36<?php //echo $pagination;  
     37?> 
     38