ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
TableDiffFormatter Class Reference
+ Inheritance diagram for TableDiffFormatter:
+ Collaboration diagram for TableDiffFormatter:

Public Member Functions

 TableDiffFormatter ()
 
 _block_header ( $xbeg, $xlen, $ybeg, $ylen)
 
 _start_block ( $header)
 
 _end_block ()
 
 _lines ( $lines, $prefix=' ', $color='white')
 
 addedLine ( $line)
 
 deletedLine ( $line)
 
 contextLine ( $line)
 
 emptyLine ()
 
 _added ( $lines)
 
 _deleted ($lines)
 
 _context ( $lines)
 
 _changed ( $orig, $closing)
 
- Public Member Functions inherited from DiffFormatter
 format ($diff)
 Format a diff. More...
 
 _block ($xbeg, $xlen, $ybeg, $ylen, &$edits)
 
 _start_diff ()
 
 _end_diff ()
 
 _block_header ($xbeg, $xlen, $ybeg, $ylen)
 
 _start_block ($header)
 
 _end_block ()
 
 _lines ($lines, $prefix=' ')
 
 _context ($lines)
 
 _added ($lines)
 
 _deleted ($lines)
 
 _changed ($orig, $closing)
 

Additional Inherited Members

- Data Fields inherited from DiffFormatter
 $leading_context_lines = 0
 Number of leading context "lines" to preserve. More...
 
 $trailing_context_lines = 0
 Number of trailing context "lines" to preserve. More...
 

Detailed Description

Definition at line 1720 of file class.WordLevelDiff.php.

Member Function Documentation

◆ _added()

TableDiffFormatter::_added (   $lines)

Reimplemented from DiffFormatter.

Definition at line 1762 of file class.WordLevelDiff.php.

1762 {
1763 foreach ($lines as $line) {
1764 echo '<tr>' . $this->emptyLine() .
1765 $this->addedLine( htmlspecialchars ( $line ) ) . "</tr>\n";
1766 }
1767 }

References addedLine(), and emptyLine().

+ Here is the call graph for this function:

◆ _block_header()

TableDiffFormatter::_block_header (   $xbeg,
  $xlen,
  $ybeg,
  $ylen 
)

Reimplemented from DiffFormatter.

Definition at line 1727 of file class.WordLevelDiff.php.

1727 {
1728 $r = '<tr><td colspan="2" align="left"><strong><!--LINE '.$xbeg."--></strong></td>\n" .
1729 '<td colspan="2" align="left"><strong><!--LINE '.$ybeg."--></strong></td></tr>\n";
1730 return $r;
1731 }
$r
Definition: example_031.php:79

References $r.

◆ _changed()

TableDiffFormatter::_changed (   $orig,
  $closing 
)

Reimplemented from DiffFormatter.

Definition at line 1784 of file class.WordLevelDiff.php.

1784 {
1785 $fname = 'TableDiffFormatter::_changed';
1786 //wfProfileIn( $fname );
1787
1788 $diff = new WordLevelDiff( $orig, $closing );
1789 $del = $diff->orig();
1790 $add = $diff->closing();
1791
1792 # Notice that WordLevelDiff returns HTML-escaped output.
1793 # Hence, we will be calling addedLine/deletedLine without HTML-escaping.
1794
1795 while ( $line = array_shift( $del ) ) {
1796 $aline = array_shift( $add );
1797 echo '<tr>' . $this->deletedLine( $line ) .
1798 $this->addedLine( $aline ) . "</tr>\n";
1799 }
1800 foreach ($add as $line) { # If any leftovers
1801 echo '<tr>' . $this->emptyLine() .
1802 $this->addedLine( $line ) . "</tr>\n";
1803 }
1804 //wfProfileOut( $fname );
1805 }

References addedLine(), deletedLine(), and emptyLine().

+ Here is the call graph for this function:

◆ _context()

TableDiffFormatter::_context (   $lines)

Reimplemented from DiffFormatter.

Definition at line 1776 of file class.WordLevelDiff.php.

1776 {
1777 foreach ($lines as $line) {
1778 echo '<tr>' .
1779 $this->contextLine( htmlspecialchars ( $line ) ) .
1780 $this->contextLine( htmlspecialchars ( $line ) ) . "</tr>\n";
1781 }
1782 }

References contextLine().

+ Here is the call graph for this function:

◆ _deleted()

TableDiffFormatter::_deleted (   $lines)

Reimplemented from DiffFormatter.

Definition at line 1769 of file class.WordLevelDiff.php.

1769 {
1770 foreach ($lines as $line) {
1771 echo '<tr>' . $this->deletedLine( htmlspecialchars ( $line ) ) .
1772 $this->emptyLine() . "</tr>\n";
1773 }
1774 }

References deletedLine(), and emptyLine().

+ Here is the call graph for this function:

◆ _end_block()

TableDiffFormatter::_end_block ( )

Reimplemented from DiffFormatter.

Definition at line 1737 of file class.WordLevelDiff.php.

1737 {
1738 }

◆ _lines()

TableDiffFormatter::_lines (   $lines,
  $prefix = ' ',
  $color = 'white' 
)

Definition at line 1740 of file class.WordLevelDiff.php.

1740 {
1741 }

◆ _start_block()

TableDiffFormatter::_start_block (   $header)

Reimplemented from DiffFormatter.

Definition at line 1733 of file class.WordLevelDiff.php.

1733 {
1734 echo $header;
1735 }
$header

References $header.

◆ addedLine()

TableDiffFormatter::addedLine (   $line)

Definition at line 1744 of file class.WordLevelDiff.php.

1744 {
1745 return "<td>+</td><td class='diff-addedline'>{$line}</td>";
1746 }

Referenced by _added(), and _changed().

+ Here is the caller graph for this function:

◆ contextLine()

TableDiffFormatter::contextLine (   $line)

Definition at line 1754 of file class.WordLevelDiff.php.

1754 {
1755 return "<td> </td><td class='diff-context'>{$line}</td>";
1756 }

Referenced by _context().

+ Here is the caller graph for this function:

◆ deletedLine()

TableDiffFormatter::deletedLine (   $line)

Definition at line 1749 of file class.WordLevelDiff.php.

1749 {
1750 return "<td>-</td><td class='diff-deletedline'>{$line}</td>";
1751 }

Referenced by _changed(), and _deleted().

+ Here is the caller graph for this function:

◆ emptyLine()

TableDiffFormatter::emptyLine ( )

Definition at line 1758 of file class.WordLevelDiff.php.

1758 {
1759 return '<td colspan="2">&nbsp;</td>';
1760 }

Referenced by _added(), _changed(), and _deleted().

+ Here is the caller graph for this function:

◆ TableDiffFormatter()

TableDiffFormatter::TableDiffFormatter ( )

Definition at line 1722 of file class.WordLevelDiff.php.

1722 {
1723 $this->leading_context_lines = 2;
1724 $this->trailing_context_lines = 2;
1725 }

The documentation for this class was generated from the following file: