ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
_HWLDF_WordAccumulator Class Reference
+ Collaboration diagram for _HWLDF_WordAccumulator:

Public Member Functions

 __construct ()
 
 _flushGroup ($new_tag)
 
 _flushLine ($new_tag)
 
 addWords ($words, $tag='')
 
 getLines ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

_HWLDF_WordAccumulator::__construct ( )

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

1718 {
1719 $this->_lines = array();
1720 $this->_line = '';
1721 $this->_group = '';
1722 $this->_tag = '';
1723 }

Member Function Documentation

◆ _flushGroup()

_HWLDF_WordAccumulator::_flushGroup (   $new_tag)

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

1726 {
1727 if ($this->_group !== '') {
1728 if ($this->_tag == 'ins') {
1729 $this->_line .= '[ilDiffInsStart]' .
1730 htmlspecialchars($this->_group) . '[ilDiffInsEnd]';
1731 } elseif ($this->_tag == 'del') {
1732 $this->_line .= '[ilDiffDelStart]' .
1733 htmlspecialchars($this->_group) . '[ilDiffDelEnd]';
1734 } else {
1735 $this->_line .= htmlspecialchars($this->_group);
1736 }
1737 }
1738 $this->_group = '';
1739 $this->_tag = $new_tag;
1740 }

Referenced by _flushLine(), and addWords().

+ Here is the caller graph for this function:

◆ _flushLine()

_HWLDF_WordAccumulator::_flushLine (   $new_tag)

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

1743 {
1744 $this->_flushGroup($new_tag);
1745 if ($this->_line != '') {
1746 array_push($this->_lines, $this->_line);
1747 } else {
1748 # make empty lines visible by inserting an NBSP
1749 array_push($this->_lines, NBSP);
1750 }
1751 $this->_line = '';
1752 }
const NBSP
Additions by Axel Boldt follow, partly taken from diff.php, phpwiki-1.3.3.

References _flushGroup(), and NBSP.

Referenced by addWords(), and getLines().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addWords()

_HWLDF_WordAccumulator::addWords (   $words,
  $tag = '' 
)

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

1755 {
1756 if ($tag != $this->_tag) {
1757 $this->_flushGroup($tag);
1758 }
1759
1760 foreach ($words as $word) {
1761 // new-line should only come as first char of word.
1762 if ($word == '') {
1763 continue;
1764 }
1765 if ($word[0] == "\n") {
1766 $this->_flushLine($tag);
1767 $word = substr($word, 1);
1768 }
1769 assert(!strstr($word, "\n"));
1770 $this->_group .= $word;
1771 }
1772 }
if(function_exists( 'posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35

References $tag, _flushGroup(), and _flushLine().

Referenced by WordLevelDiff\closing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLines()

_HWLDF_WordAccumulator::getLines ( )

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

1775 {
1776 $this->_flushLine('~done');
1777 return $this->_lines;
1778 }

References _flushLine().

+ Here is the call graph for this function:

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