| 1 | <?php |
|---|
| 2 | echo $html->addCrumb('Control Panel', '/admin/entries/start'); |
|---|
| 3 | echo $html->getCrumbs(' / '); |
|---|
| 4 | |
|---|
| 5 | echo $html->div('title_section', __('Quotes', true)); |
|---|
| 6 | |
|---|
| 7 | echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true),'title'=>__('Add new', true))), '#', array("onclick"=>"hU()"), false, false)); ?> |
|---|
| 8 | |
|---|
| 9 | <div id="trh" style="margin:0;padding:0;padding-left:40px;width:80%;display:none;"> |
|---|
| 10 | <?php echo $form->create('Quote', array('action'=>'add', 'onsubmit'=>'return chkData()')); ?> |
|---|
| 11 | <fieldset> |
|---|
| 12 | <legend><?php __('New quote'); ?></legend> |
|---|
| 13 | <?php |
|---|
| 14 | echo $form->input('Quote.quote', array('size'=> 60, 'maxlength'=>130)); |
|---|
| 15 | echo $form->input('Quote.author', array('size' => 60, 'maxlength'=>130)); |
|---|
| 16 | echo $form->end(__('Save', true)); |
|---|
| 17 | ?> |
|---|
| 18 | </fieldset> |
|---|
| 19 | </div> |
|---|
| 20 | |
|---|
| 21 | <table style="width:100%"> |
|---|
| 22 | <?php |
|---|
| 23 | $th = array (__('Edit', true), __('Quote', true), __('Author', true), __('Delete', true)); |
|---|
| 24 | |
|---|
| 25 | echo $html->tableHeaders($th, array('style'=>'text-align:center')); |
|---|
| 26 | //var_dump($data); |
|---|
| 27 | foreach ($data as $key=>$val) |
|---|
| 28 | { |
|---|
| 29 | $tr = array ( |
|---|
| 30 | $gags->sendEdit($val['Quote']['id'], 'quotes'), |
|---|
| 31 | $val['Quote']['quote'], |
|---|
| 32 | $val['Quote']['author'], |
|---|
| 33 | $gags->confirmDel($val['Quote']['id'], 'quotes') |
|---|
| 34 | ); |
|---|
| 35 | |
|---|
| 36 | echo $html->tableCells($tr, array("class"=>"altRow", "onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='altRow'"), |
|---|
| 37 | array('class'=>'evenRow',"onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='evenRow'")); |
|---|
| 38 | } |
|---|
| 39 | ?> |
|---|
| 40 | </table> |
|---|
| 41 | <script type="text/javascript"> |
|---|
| 42 | <!-- |
|---|
| 43 | function hU() { |
|---|
| 44 | |
|---|
| 45 | var tr = document.getElementById('trh'); |
|---|
| 46 | |
|---|
| 47 | if (tr.style.display == 'none') |
|---|
| 48 | { |
|---|
| 49 | tr.style.display = 'block'; |
|---|
| 50 | } else { |
|---|
| 51 | tr.style.display = 'none'; |
|---|
| 52 | } |
|---|
| 53 | } |
|---|
| 54 | --> |
|---|
| 55 | </script> |
|---|