function drawTable($navbar = 1) { echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" class=\"listinfos\">\n"; echo "<thead><tr>"; foreach ($this->description as $key => $desc) { if (isset($this->col_width[$key])) { $width_styl = 'width: ' . $this->col_width[$key] . ';'; } else { $width_styl = ''; } if (!isset($first)) { if (!isset($this->first_elt_padding)) { $this->first_elt_padding = 32; } echo "<td style=\"{$width_styl}\"><span style=\"color: #777; padding-left: " . $this->first_elt_padding . "px;\">{$desc}</span></td>"; $first = 1; } else { echo "<td style=\"{$width_styl}\"><span style=\"color: #777;\">{$desc}</span></td>"; } } if (count($this->arrAction) != 0) { //if we have actions echo "<td style=\"text-align:right;\"><span style=\"color: #AAA;\" >Actions</span></td>"; } echo "</tr></thead>"; for ($idx = $this->start; $idx < count($this->arrInfo) && $idx <= $this->end; $idx++) { if (($this->start - $idx) % 2) { echo '<tr class="'; } else { echo '<tr class="alternate '; } if ($this->arrCommit[$idx] == 0) { echo 'error'; } echo '">'; //link to first action (if we have an action) if (count($this->arrAction) && $this->firstColumnActionLink) { $this->drawMainAction($idx); } else { echo "<td>"; echo $this->arrInfo[$idx]; echo "</td>"; } if ($this->extraInfo) { foreach ($this->extraInfo as $arrayTMP) { echo "<td>"; if (trim($arrayTMP[$idx]) != "") { echo_obj($arrayTMP[$idx]); } else { echo " "; } echo "</td>"; } } if (count($this->arrAction) != 0) { echo "<td class=\"action\">"; echo "<ul class=\"action\">"; foreach ($this->arrAction as $objActionItem) { if (is_a($objActionItem, 'ActionItem')) { $objActionItem->display($this->arrInfo[$idx], $this->paramInfo[$idx]); } else { if (is_array($objActionItem)) { $obj = $objActionItem[$idx]; $obj->display($this->arrInfo[$idx], $this->paramInfo[$idx]); } } } echo "</ul>"; echo "</td>"; } echo "</tr>\n"; } echo "</table>\n"; $this->displayNavbar($navbar); if (false) { /* Code disabled because not used and make javavascript errors */ print '<script type="text/javascript"><!--'; print '$(\'help\').innerHTML=\'\'' . "\n"; print '$(\'help\').innerHTML+=\'<ul>\'' . "\n"; print '$(\'help\').innerHTML+=\'<li><h3>Aide contextuelle</h3></li>\'' . "\n"; foreach ($this->arrAction as $objActionItem) { $content = $objActionItem->strHelp(); print '$(\'help\').innerHTML+=\'' . $content . '\';' . "\n"; } print '$(\'help\').innerHTML+=\'</ul>\'' . "\n"; print '--></script>'; } }
function drawTable($navbar = 1) { echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" class=\"listinfos\">\n"; echo "<thead><tr>"; $first = False; foreach ($this->description as $key => $desc) { if (isset($this->col_width[$key])) { $width_styl = 'width: ' . $this->col_width[$key] . ';'; } else { $width_styl = ''; } if (!$first) { if (!isset($this->first_elt_padding)) { $this->first_elt_padding = 32; } echo "<td style=\"{$width_styl}\"><span style=\" padding-left: " . $this->first_elt_padding . "px;\">{$desc}</span></td>"; $first = True; } else { /* Draw table header line */ /* Add a tooltip to the column name if there is one set */ if (!empty($this->tooltip[$key])) { $tooltipbegin = "<a href=\"#\" class=\"tooltip\">"; $tooltipend = "<span>" . $this->tooltip[$key] . "</span></a>"; } else { $tooltipbegin = ""; $tooltipend = ""; } echo "<td style=\"{$width_styl}\"><span style=\" \">{$tooltipbegin}{$desc}{$tooltipend}</span></td>"; } } if (count($this->arrAction) != 0) { //if we have actions if (!empty($this->col_width)) { $width_styl = $this->col_width[count($this->col_width) - 1]; } $width_styl = isset($width_styl) ? sprintf('width: %s;', $width_styl) : ''; echo "<td style=\"text-align: right; {$width_styl}\"><span>Actions</span></td>"; } echo "</tr></thead>"; for ($idx = $this->start; $idx < count($this->arrInfo) && $idx <= $this->end; $idx++) { if (($this->start - $idx) % 2) { echo "<tr"; if (!empty($this->cssClasses[$idx])) { echo " class=\"" . $this->cssClasses[$idx] . "\""; } echo ">"; } else { echo "<tr class=\"alternate"; if (!empty($this->cssClasses[$idx])) { echo " " . $this->cssClasses[$idx]; } echo "\">"; } //link to first action (if we have an action) if (count($this->arrAction) && $this->firstColumnActionLink) { $this->drawMainAction($idx); } else { if (!empty($this->cssClass)) { echo "<td class=\"" . $this->cssClass . "\">"; } else { if (!empty($this->mainActionClasses)) { echo "<td class=\"" . $this->mainActionClasses[$idx] . "\">"; } else { echo "<td>"; } } echo $this->arrInfo[$idx]; echo "</td>"; } if ($this->extraInfo) { foreach ($this->extraInfo as $arrayTMP) { echo "<td>"; if (isset($arrayTMP[$idx]) && is_object($arrayTMP[$idx]) && is_subclass_of($arrayTMP[$idx], "HtmlContainer")) { $arrayTMP[$idx]->display(); } else { if (isset($arrayTMP[$idx]) && trim($arrayTMP[$idx]) != "") { echo_obj($arrayTMP[$idx]); } else { echo " "; } } echo "</td>"; } } if (count($this->arrAction) != 0) { echo "<td class=\"action\">"; echo "<ul class=\"action\">"; foreach ($this->arrAction as $objActionItem) { if (is_a($objActionItem, 'ActionItem')) { $objActionItem->display($this->arrInfo[$idx], $this->paramInfo[$idx]); } else { if (is_array($objActionItem)) { $obj = $objActionItem[$idx]; $obj->display($this->arrInfo[$idx], $this->paramInfo[$idx]); } } } echo "</ul>"; echo "</td>"; } echo "</tr>\n"; } echo "</table>\n"; $this->displayNavbar($navbar); if (false) { /* Code disabled because not used and make javavascript errors */ print '<script type="text/javascript"><!--'; print "jQuery('#help').html('');\n"; print '$(\'help\').innerHTML+=\'<ul>\'' . "\n"; print '$(\'help\').innerHTML+=\'<li><h3>Aide contextuelle</h3></li>\'' . "\n"; foreach ($this->arrAction as $objActionItem) { $content = $objActionItem->strHelp(); print '$(\'help\').innerHTML+=\'' . $content . '\';' . "\n"; } print '$(\'help\').innerHTML+=\'</ul>\'' . "\n"; print '--></script>'; } }