示例#1
0
 public function render($tab)
 {
     $tab = coopy_Coopy::tablify($tab);
     if ($tab->get_width() === 0 || $tab->get_height() === 0) {
         return $this;
     }
     $render = $this;
     $render->beginTable();
     $change_row = -1;
     $cell = new coopy_CellInfo();
     $view = $tab->getCellView();
     $corner = $view->toString($tab->getCell(0, 0));
     $off = null;
     if ($corner === "@:@") {
         $off = 1;
     } else {
         $off = 0;
     }
     if ($off > 0) {
         if ($tab->get_width() <= 1 || $tab->get_height() <= 1) {
             return $this;
         }
     }
     $_g1 = 0;
     $_g = $tab->get_height();
     while ($_g1 < $_g) {
         $row = $_g1++;
         $open = false;
         $txt = $view->toString($tab->getCell($off, $row));
         if ($txt === null) {
             $txt = "";
         }
         coopy_DiffRender::examineCell($off, $row, $view, $txt, "", $txt, $corner, $cell, $off);
         $row_mode = $cell->category;
         if ($row_mode === "spec") {
             $change_row = $row;
         }
         if ($row_mode === "header" || $row_mode === "spec" || $row_mode === "index" || $row_mode === "meta") {
             $this->setSection("head");
         } else {
             $this->setSection("body");
         }
         $render->beginRow($row_mode);
         $_g3 = 0;
         $_g2 = $tab->get_width();
         while ($_g3 < $_g2) {
             $c = $_g3++;
             coopy_DiffRender::examineCell($c, $row, $view, $tab->getCell($c, $row), $change_row >= 0 ? $view->toString($tab->getCell($c, $change_row)) : "", $txt, $corner, $cell, $off);
             $render->insertCell(coopy_DiffRender_0($this, $_g, $_g1, $_g2, $_g3, $c, $cell, $change_row, $corner, $off, $open, $render, $row, $row_mode, $tab, $txt, $view), $cell->category_given_tr);
             unset($c);
         }
         unset($_g3, $_g2);
         $render->endRow();
         unset($txt, $row_mode, $row, $open);
     }
     $render->endTable();
     return $this;
 }
示例#2
0
 static function compareTables3($parent, $local, $remote, $flags = null)
 {
     $comp = new coopy_TableComparisonState();
     $comp->p = coopy_Coopy::tablify($parent);
     $comp->a = coopy_Coopy::tablify($local);
     $comp->b = coopy_Coopy::tablify($remote);
     $comp->compare_flags = $flags;
     $ct = new coopy_CompareTable($comp);
     return $ct;
 }
示例#3
0
 public function hilite($output)
 {
     $output = coopy_Coopy::tablify($output);
     return $this->hiliteSingle($output);
 }