@@ -2,30 +2,30 @@ |
||
| 2 | 2 | |
| 3 | 3 | class SectionIOSiteTreeExtension extends SiteTreeExtension |
| 4 | 4 | { |
| 5 | - public function onAfterPublish(&$original) |
|
| 6 | - { |
|
| 7 | - $strategy = SectionIO::SITETREE_STRATEGY_SINGLE; |
|
| 8 | - if ( |
|
| 9 | - $this->owner->URLSegment != $original->URLSegment || // the slug has been altered |
|
| 10 | - $this->owner->MenuTitle != $original->MenuTitle || // the navigation label has been altered |
|
| 11 | - $this->owner->Title != $original->Title // the title has been altered |
|
| 12 | - ) { |
|
| 13 | - $strategy = SectionIO::SITETREE_STRATEGY_ALL; |
|
| 14 | - } else if ( |
|
| 15 | - $this->owner->getParent() |
|
| 16 | - ) { |
|
| 17 | - $strategy = SectionIO::SITETREE_STRATEGY_PARENTS; |
|
| 18 | - } |
|
| 5 | + public function onAfterPublish(&$original) |
|
| 6 | + { |
|
| 7 | + $strategy = SectionIO::SITETREE_STRATEGY_SINGLE; |
|
| 8 | + if ( |
|
| 9 | + $this->owner->URLSegment != $original->URLSegment || // the slug has been altered |
|
| 10 | + $this->owner->MenuTitle != $original->MenuTitle || // the navigation label has been altered |
|
| 11 | + $this->owner->Title != $original->Title // the title has been altered |
|
| 12 | + ) { |
|
| 13 | + $strategy = SectionIO::SITETREE_STRATEGY_ALL; |
|
| 14 | + } else if ( |
|
| 15 | + $this->owner->getParent() |
|
| 16 | + ) { |
|
| 17 | + $strategy = SectionIO::SITETREE_STRATEGY_PARENTS; |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - SectionIO::flushSiteTree($this->owner->ID, $strategy); |
|
| 20 | + SectionIO::flushSiteTree($this->owner->ID, $strategy); |
|
| 21 | 21 | |
| 22 | - parent::onAfterPublish($original); |
|
| 23 | - } |
|
| 22 | + parent::onAfterPublish($original); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function onAfterUnpublish() |
|
| 26 | - { |
|
| 27 | - SectionIO::flushAll(); |
|
| 25 | + public function onAfterUnpublish() |
|
| 26 | + { |
|
| 27 | + SectionIO::flushAll(); |
|
| 28 | 28 | |
| 29 | - parent::onAfterUnpublish(); |
|
| 30 | - } |
|
| 29 | + parent::onAfterUnpublish(); |
|
| 30 | + } |
|
| 31 | 31 | } |