1<table> 2<tr> 3 <th>Polski</th> 4 <th>English</th> 5 <th colspan="3">References</th> 6</tr> 7<?php foreach ($tpl->get('types') as $type): ?> 8<tr> 9 <?php if ( in_array($tpl->param('action'), array('edit', 'update')) && 10 $tpl->param('id') === $type->id): ?> 11 <form action=" 12 <?php echo $tpl->url('types', 'action', 'update', 'id', $type->id) ?>" 13 method="POST"> 14 <td> 15 <input name="pl" value="<?php echo $tpl->value('pl') ?>" /> 16 </td> 17 <td> 18 <input name="en" value="<?php echo $tpl->value('en') ?>" /> 19 </td> 20 <td colspan="2"> 21 <input type="submit" 22 value="<?php echo $tpl->getLang('save') ?>" /> 23 <a href="<?php echo $tpl->url('types') ?>"> 24 <?php echo $tpl->getLang('cancel') ?> 25 </a> 26 </td> 27 </form> 28 <?php else: ?> 29 <td><?php echo $type->pl ?></td> 30 <td><?php echo $type->en ?></td> 31 <td <?php if ($type->refs !== '0') echo 'colspan="2"'; ?>> 32 <a href="<?php echo $tpl->url('types', 'action', 'edit', 'id', $type->id) ?>"> 33 <?php echo $tpl->getLang('edit') ?> 34 </a> 35 </td> 36 <?php if ($type->refs === '0'): ?> 37 <td> 38 <a onclick="return confirm('<?php echo $tpl->getLang('js')['remove_confirm'] ?>')" 39 href="<?php echo $tpl->url('types', 'action', 'remove', 'id', $type->id) ?>"> 40 <?php echo $tpl->getLang('delete') ?> 41 </a> 42 </td> 43 <?php endif ?> 44 <?php endif ?> 45 46 <td> 47 <a href="<?php echo $tpl->url('issues', 'type', $type->id) ?>"> 48 <?php echo $type->refs ?> 49 </a> 50 </td> 51</tr> 52<?php endforeach ?> 53<?php if ( $tpl->param('action') !== 'edit' && 54 $tpl->param('action') !== 'update'): ?> 55<form action="<?php echo $tpl->url('types', 'action', 'add') ?>" method="POST"> 56<tr> 57 <td><input name="pl" value="<?php echo $tpl->value('pl') ?>" /></td> 58 <td><input name="en" value="<?php echo $tpl->value('en') ?>" /></td> 59 <td colspan="3"><input type="submit" value="<?php echo $tpl->getLang('save') ?>" /></td> 60</tr> 61<?php endif ?> 62</form> 63</table> 64