mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
API Standardise extension hooks (#2989)
This commit is contained in:
parent
2d158e9d77
commit
48c64e310b
@ -26,7 +26,7 @@ class LeftAndMainPageIconsExtension extends Extension implements Flushable
|
||||
* @throws InvalidArgumentException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function init()
|
||||
protected function onInit()
|
||||
{
|
||||
Requirements::customCSS($this->generatePageIconsCss(), CMSMain::PAGE_ICONS_ID);
|
||||
}
|
||||
|
@ -1494,7 +1494,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
];
|
||||
}
|
||||
|
||||
$this->extend('MetaComponents', $tags);
|
||||
$this->extend('updateMetaComponents', $tags);
|
||||
|
||||
return $tags;
|
||||
}
|
||||
@ -1598,7 +1598,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
$tagString .= $this->obj('ExtraMeta')->forTemplate();
|
||||
}
|
||||
|
||||
$this->extend('MetaTags', $tagString);
|
||||
$this->extend('updateMetaTags', $tagString);
|
||||
|
||||
return $tagString;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ abstract class SiteTreeExtension extends DataExtension
|
||||
* logged in user
|
||||
* @return boolean|null Return false to deny rights, or null to yield to default
|
||||
*/
|
||||
public function canAddChildren($member)
|
||||
protected function canAddChildren($member)
|
||||
{
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ abstract class SiteTreeExtension extends DataExtension
|
||||
* logged in user
|
||||
* @return boolean|null Return false to deny rights, or null to yield to default
|
||||
*/
|
||||
public function canPublish($member)
|
||||
protected function canPublish($member)
|
||||
{
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ abstract class SiteTreeExtension extends DataExtension
|
||||
* (Legacy support) If this is true, then do not reduce the 'home' urlsegment
|
||||
* to an empty link
|
||||
*/
|
||||
public function updateRelativeLink(&$link, $base, $action)
|
||||
protected function updateRelativeLink(&$link, $base, $action)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -10,27 +10,27 @@ use SilverStripe\ORM\DataExtension;
|
||||
*/
|
||||
class SiteTreeTest_AdminDeniedExtension extends DataExtension implements TestOnly
|
||||
{
|
||||
public function canCreate($member)
|
||||
protected function canCreate($member)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function canEdit($member)
|
||||
protected function canEdit($member)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function canDelete($member)
|
||||
protected function canDelete($member)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function canAddChildren()
|
||||
protected function canAddChildren()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function canView()
|
||||
protected function canView()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -10,12 +10,12 @@ class SiteTreeTest_ExtensionA extends SiteTreeExtension implements TestOnly
|
||||
{
|
||||
public static $can_publish = true;
|
||||
|
||||
public function canPublish($member)
|
||||
protected function canPublish($member)
|
||||
{
|
||||
return static::$can_publish;
|
||||
}
|
||||
|
||||
public function updateLink(&$link, $action = null)
|
||||
protected function updateLink(&$link, $action = null)
|
||||
{
|
||||
$link = Controller::join_links($link, '?extra=1');
|
||||
}
|
||||
|
@ -10,12 +10,12 @@ class SiteTreeTest_ExtensionB extends SiteTreeExtension implements TestOnly
|
||||
{
|
||||
public static $can_publish = true;
|
||||
|
||||
public function canPublish($member)
|
||||
protected function canPublish($member)
|
||||
{
|
||||
return static::$can_publish;
|
||||
}
|
||||
|
||||
public function updateLink(&$link, $action = null)
|
||||
protected function updateLink(&$link, $action = null)
|
||||
{
|
||||
$link = Controller::join_links('http://www.updatedhost.com', $link);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user