2011-04-15 11:37:15 +02:00
|
|
|
<?php
|
2013-05-10 02:22:22 +02:00
|
|
|
|
2016-07-22 01:32:32 +02:00
|
|
|
namespace SilverStripe\CMS\Model;
|
|
|
|
|
2016-06-16 06:57:19 +02:00
|
|
|
use SilverStripe\ORM\DataExtension;
|
2016-07-22 01:32:32 +02:00
|
|
|
use SilverStripe\Security\Member;
|
2016-06-16 06:57:19 +02:00
|
|
|
|
2011-04-15 11:37:15 +02:00
|
|
|
/**
|
|
|
|
* Plug-ins for additional functionality in your SiteTree classes.
|
|
|
|
*/
|
2017-01-25 21:59:25 +01:00
|
|
|
abstract class SiteTreeExtension extends DataExtension
|
|
|
|
{
|
2011-04-15 11:37:15 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
/**
|
|
|
|
* Hook called before the page's {@link Versioned::publishSingle()} action is completed
|
|
|
|
*
|
|
|
|
* @param SiteTree &$original The current Live SiteTree record prior to publish
|
|
|
|
*/
|
|
|
|
public function onBeforePublish(&$original)
|
|
|
|
{
|
|
|
|
}
|
2011-04-15 11:37:15 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
/**
|
|
|
|
* Hook called after the page's {@link Versioned::publishSingle()} action is completed
|
|
|
|
*
|
|
|
|
* @param SiteTree &$original The current Live SiteTree record prior to publish
|
|
|
|
*/
|
|
|
|
public function onAfterPublish(&$original)
|
|
|
|
{
|
|
|
|
}
|
2016-03-08 21:50:55 +01:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
/**
|
|
|
|
* Hook called before the page's {@link Versioned::doUnpublish()} action is completed
|
|
|
|
*/
|
|
|
|
public function onBeforeUnpublish()
|
|
|
|
{
|
|
|
|
}
|
2016-03-08 21:50:55 +01:00
|
|
|
|
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
/**
|
|
|
|
* Hook called after the page's {@link SiteTree::doUnpublish()} action is completed
|
|
|
|
*/
|
|
|
|
public function onAfterUnpublish()
|
|
|
|
{
|
|
|
|
}
|
2016-03-08 21:50:55 +01:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
/**
|
|
|
|
* Hook called to determine if a user may add children to this SiteTree object
|
|
|
|
*
|
|
|
|
* @see SiteTree::canAddChildren()
|
|
|
|
*
|
|
|
|
* @param Member $member The member to check permission against, or the currently
|
|
|
|
* logged in user
|
|
|
|
* @return boolean|null Return false to deny rights, or null to yield to default
|
|
|
|
*/
|
|
|
|
public function canAddChildren($member)
|
|
|
|
{
|
|
|
|
}
|
2016-03-08 21:50:55 +01:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
/**
|
|
|
|
* Hook called to determine if a user may publish this SiteTree object
|
|
|
|
*
|
|
|
|
* @see SiteTree::canPublish()
|
|
|
|
*
|
|
|
|
* @param Member $member The member to check permission against, or the currently
|
|
|
|
* logged in user
|
|
|
|
* @return boolean|null Return false to deny rights, or null to yield to default
|
|
|
|
*/
|
|
|
|
public function canPublish($member)
|
|
|
|
{
|
|
|
|
}
|
2011-04-15 11:37:15 +02:00
|
|
|
|
2017-01-25 21:59:25 +01:00
|
|
|
/**
|
|
|
|
* Hook called to modify the $base url of this page, with a given $action,
|
|
|
|
* before {@link SiteTree::RelativeLink()} calls {@link Controller::join_links()}
|
|
|
|
* on the $base and $action
|
|
|
|
*
|
2022-08-31 02:33:05 +02:00
|
|
|
* @param string &$link The URL of this page relative to siteroot including
|
2017-01-25 21:59:25 +01:00
|
|
|
* the action
|
2022-08-31 02:33:05 +02:00
|
|
|
* @param string $base The URL of this page relative to siteroot, not including
|
|
|
|
* the action
|
|
|
|
* @param string|boolean $action The action or subpage called on this page.
|
2017-01-25 21:59:25 +01:00
|
|
|
* (Legacy support) If this is true, then do not reduce the 'home' urlsegment
|
|
|
|
* to an empty link
|
|
|
|
*/
|
2022-08-31 02:33:05 +02:00
|
|
|
public function updateRelativeLink(&$link, $base, $action)
|
2017-01-25 21:59:25 +01:00
|
|
|
{
|
|
|
|
}
|
2012-04-12 09:23:20 +02:00
|
|
|
}
|