ENHANCEMENT: Added new onRenameLinkAsset() handler to static publishing for better link rewriting. (from r89014) (from r96792)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102482 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 09:58:43 +00:00
parent 791dc22e5d
commit b1a088cea3

View File

@ -30,9 +30,26 @@ abstract class StaticPublisher extends DataObjectDecorator {
self::$echo_progress = (boolean)$progress;
}
/**
* Called after a page is published.
*/
function onAfterPublish($original) {
$this->republish($original);
}
/**
* Called after link assets have been renamed, and the live site has been updated, without
* an actual publish event.
*
* Only called if the published content exists and has been modified.
*/
function onRenameLinkedAsset($original) {
$this->republish($original);
}
function republish($original) {
if (self::$disable_realtime) return;
$urls = array();
if($this->owner->hasMethod('pagesAffectedByChanges')) {