Changeset 81 for trunk/app/views/quotes

Show
Ignore:
Timestamp:
09/10/07 11:23:06 (15 months ago)
Author:
aarkerio
Message:

Quotes

Location:
trunk/app/views/quotes
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/quotes/admin_listing.thtml

    r18 r81  
    1 <?php 
    2 if ( isset($javascript) ): 
    3   echo $html->charsetTag('UTF-8'); 
    4   echo $javascript->link('prototype'); 
    5   echo $javascript->link('myfunctions'); 
    6   echo $javascript->link('scriptaculous.js?load=effects'); 
    7 endif; 
    8 ?> 
    9  
    10 <?php echo $html->addCrumb('Control Tools', '/entries/index'); ?>  
     1<?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?>  
    112<?php echo $html->getCrumbs(' / '); ?> 
    123 
    13 <div class="title_section">Quotes</div> 
    14 <p> 
    15  <?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add new quote", "title"=>"Add new quote")), '#', array("onclick"=>"showhide('add')"), null, false); ?> 
    16 </p> 
    17 <div id="add" style="margin:0;padding:0;padding-left:40px;width:80%;display:none;"> 
    18 <?php echo $html->formTag('/quotes/add/','post'); ?> 
     4<div class="title_section">Quick News</div> 
     5 
     6<script type="text/javascript">  
     7<!--  
     8function hU() { 
     9 
     10var tr = document.getElementById('trh'); 
     11 
     12  if (tr.style.display == 'none') 
     13  { 
     14            tr.style.display = 'table-row'; 
     15  } else { 
     16            tr.style.display = 'none'; 
     17  } 
     18} 
     19--> 
     20</script> 
     21 
     22<p><?php echo $html->link($html->image('admin/new.gif', array("alt"=>"Add new", "title"=>"Add new")), '#', array("onclick"=>"hU()"), false, false); ?></p> 
     23 
     24<div id="trh" style="margin:0;padding:0;padding-left:40px;width:80%;display:none;"> 
     25<?php echo $html->formTag('/admin/quotes/add/','post'); ?> 
    1926 <fieldset> 
    2027 <legend>New quote</legend> 
     
    3138</fieldset> 
    3239</form> 
    33 <?php echo $html->link('Cancel', '#', array("onclick"=>"showhide('add')")); ?> 
     40 
    3441</div> 
    3542 
    36 <table class="main_tabula"> 
     43<table style="width:100%"> 
     44<?php 
     45$th = array ('Edit', 'Quote', 'Author', 'Delete'); 
     46echo $html->tableHeaders($th); 
    3747 
    38 <tr id="table_header"> <td></td> <td>Quote</td>  <td>Author</td>  <td></td></tr> 
    39  
    40 <?php 
    4148//var_dump($data); 
    42 foreach ($data as $key=>$val) { 
    43      
    44           echo "<tr><td>"; 
    45              echo $html->formTag('/quotes/edit/'.$data[$key]['Quote']['id'], 'get'); 
    46              echo $html->submit('Edit'); 
    47              echo "</form>"; 
    48           echo "</td>"; 
    49              
    50           echo  "<td>" . $val['Quote']['quote']   . "</td>"; 
    51           echo  "<td>" . $val['Quote']['author']  . "</td>"; 
    52           echo "<td>"; 
    53             echo $html->formTag('/quotes/delete/', 'post', array("onsubmit"=>"return confirm('Are you sure?')")); 
    54             echo $html->hidden('Quote/id', array("value"=>$data[$key]['Quote']['id'])); 
    55             echo $html->submit('Delete'); 
    56             echo "</form>"; 
    57          echo "</td></tr>"; 
     49foreach ($data as $key=>$val)  
     50{    
     51    $tr = array ( 
     52        $gags->sendEdit($val['Quote']['id'], 'quotes'), 
     53        $val['Quote']['quote'], 
     54        $val['Quote']['author'], 
     55        $gags->confirmDel($val['Quote']['id'], 'quotes') 
     56        ); 
     57        
     58    echo $html->tableCells($tr, array("class"=>"altRow", "onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='altRow'"),  
     59                                array('class'=>'evenRow',"onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='evenRow'")); 
    5860    } 
    5961?>