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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@96792 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-01-13 00:00:33 +00:00
parent 7ac2203319
commit c841b11edd

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')) {