4 * Parallel diff renderer for HTML tables with original text on left,
5 * new text on right, and changed text highlighted with appropriate classes.
7 class Text_Diff_Renderer_parallel
extends Text_Diff_Renderer
9 /** String header for left column */
10 var $original = 'Original';
11 /** String header for right column */
13 var $_leading_context_lines = 10000; // these are big to ensure entire string is output
14 var $_trailing_context_lines = 10000;
15 function _blockHeader() {}
16 function _startDiff() {
17 return '<table class="diff"><thead><tr><th>'. $this->original
.'</th><th>'. $this->final .'</th></tr></thead><tbody>';
20 return '</tbody></table>';
22 function _context($lines) {
23 return '<tr><td><pre>'. htmlspecialchars(implode("\n", $lines)) .'</pre></td>
24 <td><pre>'. htmlspecialchars(implode("\n", $lines)) .'</pre></td></tr>';
26 function _added($lines) {
27 return '<tr><td> </td><td class="added"><pre>'. htmlspecialchars(implode("\n", $lines)) .'</pre></td></tr>';
29 function _deleted($lines) {
30 return '<tr><td class="deleted"><pre>'. htmlspecialchars(implode("\n", $lines)) .'</pre></td><td> </td></tr>';
32 function _changed($orig, $final) {
33 return '<tr class="changed"><td><pre>'. htmlspecialchars(implode("\n", $orig)) .'</pre></td>
34 <td><pre>'. htmlspecialchars(implode("\n", $final)) .'</pre></td></tr>';