class _HWLDF_WordAccumulator

  1. cis7 sites/all/modules/ulmus/diff/DiffEngine.php _HWLDF_WordAccumulator
  2. cle7 sites/all/modules/ulmus/diff/DiffEngine.php _HWLDF_WordAccumulator
  3. elmsmedia7 sites/all/modules/ulmus/diff/DiffEngine.php _HWLDF_WordAccumulator
  4. icor7 sites/all/modules/ulmus/diff/DiffEngine.php _HWLDF_WordAccumulator
  5. meedjum_blog7 sites/all/modules/ulmus/diff/DiffEngine.php _HWLDF_WordAccumulator
  6. mooc7 sites/all/modules/ulmus/diff/DiffEngine.php _HWLDF_WordAccumulator

@todo document @private @subpackage DifferenceEngine

Hierarchy

Expanded class hierarchy of _HWLDF_WordAccumulator

Members

Contains filters are case sensitive

File

sites/all/modules/ulmus/diff/DiffEngine.php, line 952
A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)

View source
class _HWLDF_WordAccumulator {
  function _HWLDF_WordAccumulator() {
    $this->_lines = array();
    $this->_line = '';
    $this->_group = '';
    $this->_tag = '';
  }

  function _flushGroup($new_tag) {
    if ($this->_group !== '') {
      if ($this->_tag == 'mark') {
        $this->_line .= '<span class="diffchange">' . check_plain($this->_group) . '</span>';
      }
      else {
        $this->_line .= check_plain($this->_group);
      }
    }
    $this->_group = '';
    $this->_tag = $new_tag;
  }

  function _flushLine($new_tag) {
    $this->_flushGroup($new_tag);
    if ($this->_line != '') {
      array_push($this->_lines, $this->_line);
    }
    else {
      // make empty lines visible by inserting an NBSP
      array_push($this->_lines, NBSP);
    }
    $this->_line = '';
  }

  function addWords($words, $tag = '') {
    if ($tag != $this->_tag) {
      $this->_flushGroup($tag);
    }
    foreach ($words as $word) {
      // new-line should only come as first char of word.
      if ($word == '') {
        continue;
      }
      if ($word[0] == "\n") {
        $this->_flushLine($tag);
        $word = drupal_substr($word, 1);
      }
      assert(!strstr($word, "\n"));
      $this->_group .= $word;
    }
  }

  function getLines() {
    $this->_flushLine('~done');
    return $this->_lines;
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.