Go to the documentation of this file.00001 <?php if(!empty($list)):?>
00002 <?php echo $hasMultiple ? '<form action="'.$multipleAction.'" method="post">' : null ?>
00003 <table class="dataTable <?php echo $tblName ?>List">
00004 <thead>
00005 <tr>
00006 <?php
00007 if ($hasMultiple)
00008 echo '<td class="checkCell checkHead"><input type="checkbox" name="checkAll" id="checkAll" /></td>';
00009 foreach($headers as $h) {
00010 if ($h['url']) {
00011 if ($h['name'] == $sortBy || $tblName.'.'.$h['name'] == $sortBy) {
00012 echo '<th class="'.$h['name'].'Cell '.$h['name'].'Head">
00013 <a href="'.$h['url'].'">'.$h['label'].'</a>
00014 '.($sortDir == 'asc' ? $sortIndicatorAsc : $sortIndicatorDesc).'
00015 </th>';
00016 } else
00017 echo '<th class="'.$h['name'].'Cell '.$h['name'].'Head"><a href="'.$h['url'].'">'.$h['label'].'</a></th>';
00018 } else
00019 echo '<th class="'.$h['name'].'Cell '.$h['name'].'Head">'.$h['label'].'</th>';
00020 if ($h['type'] == 'image')
00021 $imgHelper = factory::getHelper('image', array(
00022 'w'=>50,
00023 'h'=>50
00024 ));
00025 }
00026 if ($actions)
00027 echo '<th class="actionsCell actionsHead">Actions</th>';
00028 ?>
00029 </tr>
00030 </thead>
00031 <tbody>
00032 <?php
00033 $i = 0;
00034 foreach($list as $l) {
00035 echo '<tr>';
00036 if ($hasMultiple)
00037 echo '<td class="checkCell"><input type="checkbox" name="'.$multipleIdent.'[]" value="'.$l->get($multipleIdent).'" /></td>';
00038 foreach($headers as $h) {
00039 $val = $l->get($h['name'], 'flatReal');
00040 switch($h['type']) {
00041 case 'date':
00042 $val = $val ? utils::formatDate($val) : $val;
00043 break;
00044 case 'datetime':
00045 case 'timestamp':
00046 $val = $val ? utils::formatDate($val, 'datetime') : $val;
00047 break;
00048 case 'image':
00049 $val = $val ? $imgHelper->view($val) : $val;
00050 break;
00051 case 'tinyint':
00052 $val = ucfirst(tr::__($val ? 'yes' : 'no'));
00053 break;
00054 case 'enum':
00055 $tmp = $l->getTable()->getField($h['name']);
00056 $val = isset($tmp['precision'][$val]) ? $tmp['precision'][$val] : $val;
00057 break;
00058 }
00059 echo '<td class="'.$h['name'].'Cell">'.(is_array($val)? implode(', ', $val) : $val).'</td>';
00060 }
00061 if ($actions) {
00062 echo '<td class="actionsCell">';
00063 if (array_key_exists($i, $actions))
00064 foreach($actions[$i] as $a=>$v) {
00065 $img = $actionsImg[$a];
00066 echo '<a href="'.$v.'" class="'.$a.'">'.($img? $img : $a).'</a> ';
00067 }
00068 echo '</td>';
00069 }
00070 echo '</tr>';
00071 $i++;
00072 }
00073 ?>
00074 </tbody>
00075 </table>
00076 <?php
00077 if ($hasMultiple) {
00078 echo '<select name="action">
00079 <option value="">'.$multipleLabel.'</option>';
00080 foreach($multiple as $k=>$m)
00081 echo '<option value="'.$k.'">'.$m['label'].'</option>';
00082 echo '</select>
00083 <input type="submit" value="'.$multipleSubmit.'" />
00084 </form>';
00085 }
00086
00087 if ($nbPage > 1) {
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 echo 'Pages : <select onchange="javascript:location.href=this.value">';
00100 foreach($pageLinks as $i=>$l) {
00101 if ($i == $currentPage)
00102 echo '<option value="'.$l.'" selected="selected">'.$i.'</option>';
00103 else
00104 echo '<option value="'.$l.'">'.$i.'</option>';
00105 }
00106 echo '</select>';
00107
00108 }
00109 ?>
00110 <?php else: ?>
00111 <?php echo $noData ?>
00112 <?php endif; ?>