ILIAS  release_8 Revision v8.24
TableDiffFormatter Class Reference
+ Inheritance diagram for TableDiffFormatter:
+ Collaboration diagram for TableDiffFormatter:

Public Member Functions

 __construct ()
 
 _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 1883 of file class.WordLevelDiff.php.

Constructor & Destructor Documentation

◆ __construct()

TableDiffFormatter::__construct ( )

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

1886 {
1887 $this->leading_context_lines = 2;
1888 $this->trailing_context_lines = 2;
1889 }

Member Function Documentation

◆ _added()

TableDiffFormatter::_added (   $lines)

Reimplemented from DiffFormatter.

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

1935 {
1936 foreach ($lines as $line) {
1937 echo '<tr>' . $this->emptyLine() .
1938 $this->addedLine(htmlspecialchars($line)) . "</tr>\n";
1939 }
1940 }

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 1891 of file class.WordLevelDiff.php.

1892 {
1893 $r = '<tr><td colspan="2" align="left"><strong><!--LINE ' . $xbeg . "--></strong></td>\n" .
1894 '<td colspan="2" align="left"><strong><!--LINE ' . $ybeg . "--></strong></td></tr>\n";
1895 return $r;
1896 }

◆ _changed()

TableDiffFormatter::_changed (   $orig,
  $closing 
)

Reimplemented from DiffFormatter.

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

1960 {
1961 $fname = 'TableDiffFormatter::_changed';
1962 //wfProfileIn( $fname );
1963
1964 $diff = new WordLevelDiff($orig, $closing);
1965 $del = $diff->orig();
1966 $add = $diff->closing();
1967
1968 # Notice that WordLevelDiff returns HTML-escaped output.
1969 # Hence, we will be calling addedLine/deletedLine without HTML-escaping.
1970
1971 while ($line = array_shift($del)) {
1972 $aline = array_shift($add);
1973 echo '<tr>' . $this->deletedLine($line) .
1974 $this->addedLine($aline) . "</tr>\n";
1975 }
1976 foreach ($add as $line) { # If any leftovers
1977 echo '<tr>' . $this->emptyLine() .
1978 $this->addedLine($line) . "</tr>\n";
1979 }
1980 //wfProfileOut( $fname );
1981 }

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

+ Here is the call graph for this function:

◆ _context()

TableDiffFormatter::_context (   $lines)

Reimplemented from DiffFormatter.

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

1951 {
1952 foreach ($lines as $line) {
1953 echo '<tr>' .
1954 $this->contextLine(htmlspecialchars($line)) .
1955 $this->contextLine(htmlspecialchars($line)) . "</tr>\n";
1956 }
1957 }

References contextLine().

+ Here is the call graph for this function:

◆ _deleted()

TableDiffFormatter::_deleted (   $lines)

Reimplemented from DiffFormatter.

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

1943 {
1944 foreach ($lines as $line) {
1945 echo '<tr>' . $this->deletedLine(htmlspecialchars($line)) .
1946 $this->emptyLine() . "</tr>\n";
1947 }
1948 }

References deletedLine(), and emptyLine().

+ Here is the call graph for this function:

◆ _end_block()

TableDiffFormatter::_end_block ( )

Reimplemented from DiffFormatter.

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

1904 {
1905 }

◆ _lines()

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

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

1908 {
1909 }

◆ _start_block()

TableDiffFormatter::_start_block (   $header)

Reimplemented from DiffFormatter.

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

1899 {
1900 echo $header;
1901 }

◆ addedLine()

TableDiffFormatter::addedLine (   $line)

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

1913 {
1914 return "<td>+</td><td class='diff-addedline'>{$line}</td>";
1915 }

Referenced by _added(), and _changed().

+ Here is the caller graph for this function:

◆ contextLine()

TableDiffFormatter::contextLine (   $line)

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

1925 {
1926 return "<td> </td><td class='diff-context'>{$line}</td>";
1927 }

Referenced by _context().

+ Here is the caller graph for this function:

◆ deletedLine()

TableDiffFormatter::deletedLine (   $line)

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

1919 {
1920 return "<td>-</td><td class='diff-deletedline'>{$line}</td>";
1921 }

Referenced by _changed(), and _deleted().

+ Here is the caller graph for this function:

◆ emptyLine()

TableDiffFormatter::emptyLine ( )

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

1930 {
1931 return '<td colspan="2">&nbsp;</td>';
1932 }

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

+ Here is the caller graph for this function:

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