ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 1886 of file class.WordLevelDiff.php.

Constructor & Destructor Documentation

◆ __construct()

TableDiffFormatter::__construct ( )

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

1889 {
1890 $this->leading_context_lines = 2;
1891 $this->trailing_context_lines = 2;
1892 }

Member Function Documentation

◆ _added()

TableDiffFormatter::_added (   $lines)

Reimplemented from DiffFormatter.

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

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

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

1895 {
1896 $r = '<tr><td colspan="2" align="left"><strong><!--LINE ' . $xbeg . "--></strong></td>\n" .
1897 '<td colspan="2" align="left"><strong><!--LINE ' . $ybeg . "--></strong></td></tr>\n";
1898 return $r;
1899 }
$r
Definition: example_031.php:79

References $r.

◆ _changed()

TableDiffFormatter::_changed (   $orig,
  $closing 
)

Reimplemented from DiffFormatter.

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

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

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

+ Here is the call graph for this function:

◆ _context()

TableDiffFormatter::_context (   $lines)

Reimplemented from DiffFormatter.

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

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

References contextLine().

+ Here is the call graph for this function:

◆ _deleted()

TableDiffFormatter::_deleted (   $lines)

Reimplemented from DiffFormatter.

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

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

References deletedLine(), and emptyLine().

+ Here is the call graph for this function:

◆ _end_block()

TableDiffFormatter::_end_block ( )

Reimplemented from DiffFormatter.

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

1907 {
1908 }

◆ _lines()

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

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

1911 {
1912 }

◆ _start_block()

TableDiffFormatter::_start_block (   $header)

Reimplemented from DiffFormatter.

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

1902 {
1903 echo $header;
1904 }

References $header.

◆ addedLine()

TableDiffFormatter::addedLine (   $line)

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

1916 {
1917 return "<td>+</td><td class='diff-addedline'>{$line}</td>";
1918 }

Referenced by _added(), and _changed().

+ Here is the caller graph for this function:

◆ contextLine()

TableDiffFormatter::contextLine (   $line)

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

1928 {
1929 return "<td> </td><td class='diff-context'>{$line}</td>";
1930 }

Referenced by _context().

+ Here is the caller graph for this function:

◆ deletedLine()

TableDiffFormatter::deletedLine (   $line)

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

1922 {
1923 return "<td>-</td><td class='diff-deletedline'>{$line}</td>";
1924 }

Referenced by _changed(), and _deleted().

+ Here is the caller graph for this function:

◆ emptyLine()

TableDiffFormatter::emptyLine ( )

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

1933 {
1934 return '<td colspan="2">&nbsp;</td>';
1935 }

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: