| @@ 160-175 (lines=16) @@ | ||
| 157 | $this->processInsertOperation( $operation, "diffmod" ); |
|
| 158 | } |
|
| 159 | ||
| 160 | protected function processInsertOperation($operation, $cssClass) |
|
| 161 | { |
|
| 162 | $text = array(); |
|
| 163 | foreach ($this->newWords as $pos => $s) { |
|
| 164 | if ($pos >= $operation->startInNew && $pos < $operation->endInNew) { |
|
| 165 | if (in_array($s, $this->isolatedDiffTags) && isset($this->newIsolatedDiffTags[$pos])) { |
|
| 166 | foreach ($this->newIsolatedDiffTags[$pos] as $word) { |
|
| 167 | $text[] = $word; |
|
| 168 | } |
|
| 169 | } else { |
|
| 170 | $text[] = $s; |
|
| 171 | } |
|
| 172 | } |
|
| 173 | } |
|
| 174 | $this->insertTag( "ins", $cssClass, $text ); |
|
| 175 | } |
|
| 176 | ||
| 177 | protected function processDeleteOperation($operation, $cssClass) |
|
| 178 | { |
|
| @@ 177-192 (lines=16) @@ | ||
| 174 | $this->insertTag( "ins", $cssClass, $text ); |
|
| 175 | } |
|
| 176 | ||
| 177 | protected function processDeleteOperation($operation, $cssClass) |
|
| 178 | { |
|
| 179 | $text = array(); |
|
| 180 | foreach ($this->oldWords as $pos => $s) { |
|
| 181 | if ($pos >= $operation->startInOld && $pos < $operation->endInOld) { |
|
| 182 | if (in_array($s, $this->isolatedDiffTags) && isset($this->oldIsolatedDiffTags[$pos])) { |
|
| 183 | foreach ($this->oldIsolatedDiffTags[$pos] as $word) { |
|
| 184 | $text[] = $word; |
|
| 185 | } |
|
| 186 | } else { |
|
| 187 | $text[] = $s; |
|
| 188 | } |
|
| 189 | } |
|
| 190 | } |
|
| 191 | $this->insertTag( "del", $cssClass, $text ); |
|
| 192 | } |
|
| 193 | ||
| 194 | /** |
|
| 195 | * @param Operation $operation |
|
| @@ 268-283 (lines=16) @@ | ||
| 265 | return $this->diffElements($oldText, $newText); |
|
| 266 | } |
|
| 267 | ||
| 268 | protected function processEqualOperation($operation) |
|
| 269 | { |
|
| 270 | $result = array(); |
|
| 271 | foreach ($this->newWords as $pos => $s) { |
|
| 272 | ||
| 273 | if ($pos >= $operation->startInNew && $pos < $operation->endInNew) { |
|
| 274 | if (in_array($s, $this->isolatedDiffTags) && isset($this->newIsolatedDiffTags[$pos])) { |
|
| 275 | ||
| 276 | $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s); |
|
| 277 | } else { |
|
| 278 | $result[] = $s; |
|
| 279 | } |
|
| 280 | } |
|
| 281 | } |
|
| 282 | $this->content .= implode( "", $result ); |
|
| 283 | } |
|
| 284 | ||
| 285 | /** |
|
| 286 | * @param string $text |
|