mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
42 lines
886 B
PHP
42 lines
886 B
PHP
|
<?php
|
||
|
|
||
|
namespace SilverStripe\CMS\Forms;
|
||
|
|
||
|
use SilverStripe\Admin\ModalController;
|
||
|
use SilverStripe\Core\Extension;
|
||
|
use SilverStripe\Forms\Form;
|
||
|
|
||
|
/**
|
||
|
* Decorates ModalController with insert internal link
|
||
|
* @see ModalController
|
||
|
*/
|
||
|
class InternalLinkModalExtension extends Extension
|
||
|
{
|
||
|
private static $allowed_actions = array(
|
||
|
'editorInternalLink',
|
||
|
);
|
||
|
|
||
|
/**
|
||
|
* @return ModalController
|
||
|
*/
|
||
|
public function getOwner()
|
||
|
{
|
||
|
/** @var ModalController $owner */
|
||
|
$owner = $this->owner;
|
||
|
return $owner;
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Form for inserting internal link pages
|
||
|
*
|
||
|
* @return Form
|
||
|
*/
|
||
|
public function editorInternalLink()
|
||
|
{
|
||
|
/** @var InternalLinkFormFactory $factory */
|
||
|
$factory = InternalLinkFormFactory::singleton();
|
||
|
return $factory->getForm($this->getOwner(), "editorInternalLink");
|
||
|
}
|
||
|
}
|