| @@ 176-191 (lines=16) @@ | ||
| 173 | $this->processInsertOperation( $operation, "diffmod" ); |
|
| 174 | } |
|
| 175 | ||
| 176 | protected function processInsertOperation($operation, $cssClass) |
|
| 177 | { |
|
| 178 | $text = array(); |
|
| 179 | foreach ($this->newWords as $pos => $s) { |
|
| 180 | if ($pos >= $operation->startInNew && $pos < $operation->endInNew) { |
|
| 181 | if (in_array($s, $this->isolatedDiffTags) && isset($this->newIsolatedDiffTags[$pos])) { |
|
| 182 | foreach ($this->newIsolatedDiffTags[$pos] as $word) { |
|
| 183 | $text[] = $word; |
|
| 184 | } |
|
| 185 | } else { |
|
| 186 | $text[] = $s; |
|
| 187 | } |
|
| 188 | } |
|
| 189 | } |
|
| 190 | $this->insertTag( "ins", $cssClass, $text ); |
|
| 191 | } |
|
| 192 | ||
| 193 | protected function processDeleteOperation($operation, $cssClass) |
|
| 194 | { |
|
| @@ 193-208 (lines=16) @@ | ||
| 190 | $this->insertTag( "ins", $cssClass, $text ); |
|
| 191 | } |
|
| 192 | ||
| 193 | protected function processDeleteOperation($operation, $cssClass) |
|
| 194 | { |
|
| 195 | $text = array(); |
|
| 196 | foreach ($this->oldWords as $pos => $s) { |
|
| 197 | if ($pos >= $operation->startInOld && $pos < $operation->endInOld) { |
|
| 198 | if (in_array($s, $this->isolatedDiffTags) && isset($this->oldIsolatedDiffTags[$pos])) { |
|
| 199 | foreach ($this->oldIsolatedDiffTags[$pos] as $word) { |
|
| 200 | $text[] = $word; |
|
| 201 | } |
|
| 202 | } else { |
|
| 203 | $text[] = $s; |
|
| 204 | } |
|
| 205 | } |
|
| 206 | } |
|
| 207 | $this->insertTag( "del", $cssClass, $text ); |
|
| 208 | } |
|
| 209 | ||
| 210 | /** |
|
| 211 | * @param Operation $operation |
|
| @@ 295-310 (lines=16) @@ | ||
| 292 | return $this->diffElements($oldText, $newText); |
|
| 293 | } |
|
| 294 | ||
| 295 | protected function processEqualOperation($operation) |
|
| 296 | { |
|
| 297 | $result = array(); |
|
| 298 | foreach ($this->newWords as $pos => $s) { |
|
| 299 | ||
| 300 | if ($pos >= $operation->startInNew && $pos < $operation->endInNew) { |
|
| 301 | if (in_array($s, $this->isolatedDiffTags) && isset($this->newIsolatedDiffTags[$pos])) { |
|
| 302 | ||
| 303 | $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s); |
|
| 304 | } else { |
|
| 305 | $result[] = $s; |
|
| 306 | } |
|
| 307 | } |
|
| 308 | } |
|
| 309 | $this->content .= implode( "", $result ); |
|
| 310 | } |
|
| 311 | ||
| 312 | /** |
|
| 313 | * @param string $text |
|