_leading_context_lines = $context_lines; $this->_trailing_context_lines = $context_lines; $this->_words = $words; } protected function _startDiff() { ob_start(); //echo ''; } protected function _endDiff() { $val = ob_get_contents(); ob_end_clean(); return $val; } protected function _blockHeader($xbeg, $xlen, $ybeg, $ylen) { return "$xbeg,$xlen,$ybeg,$ylen"; } protected function _startBlock($header) { $h = explode(",", $header); echo ''; } protected function _endBlock() { } protected function _lines($lines, $prefix = '', $suffix = '', $type = '') { // MODIFIED BY THE TIKI PROJECT if ($type == 'context') { foreach ($lines as $line) { if (! empty($line)) { echo "\n"; } } } elseif ($type == 'added') { foreach ($lines as $line) { if (! empty($line)) { echo "\n"; } } } elseif ($type == 'deleted') { foreach ($lines as $line) { if (! empty($line)) { echo "\n"; } } } elseif ($type == 'change-deleted') { echo '\n"; } elseif ($type == 'change-added') { echo '\n"; } } protected function _context($lines) { $this->_lines($lines, '', '', 'context'); } protected function _added($lines, $changemode = false) { if ($changemode) { $this->_lines($lines, '+', '', 'change-added'); } else { $this->_lines($lines, '+', '', 'added'); } } protected function _deleted($lines, $changemode = false) { if ($changemode) { $this->_lines($lines, '-', '', 'change-deleted'); } else { $this->_lines($lines, '-', '', 'deleted'); } } protected function _changed($orig, $final) { $lines = diffChar($orig, $final, $this->_words); $this->_deleted([$lines[0]], true); $this->_added([$lines[1]], true); /* switch with these lines for no character diff $this->_deleted($orig, TRUE); $this->_added($final, TRUE); */ } }
'; if ($h[1] == 1) { echo tra('Line:') . " " . $h[0]; } else { $h[1] = $h[0] + $h[1] - 1; echo tra('Lines:') . " " . $h[0] . '-' . $h[1]; } echo ''; if ($h[3] == 1) { echo tra('Line:') . " " . $h[2]; } else { $h[3] = $h[2] + $h[3] - 1; echo tra('Lines:') . " " . $h[2] . '-' . $h[3]; } echo '
 " . htmlspecialchars($line) . " " . htmlspecialchars($line) . "
 $prefix" . htmlspecialchars($line) . "
$prefix" . htmlspecialchars($line) . " 
' . $prefix . '' . implode("
", $lines) . "
' . $prefix . '' . implode("
", $lines) . "