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

Public Member Functions

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

Detailed Description

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

Member Function Documentation

◆ _flushGroup()

_HWLDF_WordAccumulator::_flushGroup (   $new_tag)

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

1579 {
1580 if ($this->_group !== '') {
1581 if ($this->_tag == 'ins')
1582 $this->_line .= '[ilDiffInsStart]' .
1583 htmlspecialchars ( $this->_group ) . '[ilDiffInsEnd]';
1584 elseif ($this->_tag == 'del')
1585 $this->_line .= '[ilDiffDelStart]' .
1586 htmlspecialchars ( $this->_group ) . '[ilDiffDelEnd]';
1587 else
1588 $this->_line .= htmlspecialchars ( $this->_group );
1589 }
1590 $this->_group = '';
1591 $this->_tag = $new_tag;
1592 }
if(PHP_SAPI=='cli') else

Referenced by _flushLine(), and addWords().

+ Here is the caller graph for this function:

◆ _flushLine()

_HWLDF_WordAccumulator::_flushLine (   $new_tag)

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

1594 {
1595 $this->_flushGroup($new_tag);
1596 if ($this->_line != '')
1597 array_push ( $this->_lines, $this->_line );
1598 else
1599 # make empty lines visible by inserting an NBSP
1600 array_push ( $this->_lines, NBSP );
1601 $this->_line = '';
1602 }
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:

◆ _HWLDF_WordAccumulator()

_HWLDF_WordAccumulator::_HWLDF_WordAccumulator ( )

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

1572 {
1573 $this->_lines = array();
1574 $this->_line = '';
1575 $this->_group = '';
1576 $this->_tag = '';
1577 }

◆ addWords()

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

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

1604 {
1605 if ($tag != $this->_tag)
1606 $this->_flushGroup($tag);
1607
1608 foreach ($words as $word) {
1609 // new-line should only come as first char of word.
1610 if ($word == '')
1611 continue;
1612 if ($word[0] == "\n") {
1613 $this->_flushLine($tag);
1614 $word = substr($word, 1);
1615 }
1616 assert(!strstr($word, "\n"));
1617 $this->_group .= $word;
1618 }
1619 }

References _flushGroup(), and _flushLine().

Referenced by WordLevelDiff\closing(), and WordLevelDiff\orig().

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

◆ getLines()

_HWLDF_WordAccumulator::getLines ( )

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

1621 {
1622 $this->_flushLine('~done');
1623 return $this->_lines;
1624 }

References _flushLine().

+ Here is the call graph for this function:

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