These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace SilverStripe\CMS\Forms; |
||
4 | |||
5 | use SilverStripe\Admin\ModalController; |
||
6 | use SilverStripe\Core\Extension; |
||
7 | use SilverStripe\Forms\Form; |
||
8 | |||
9 | /** |
||
10 | * Decorates ModalController with insert internal link |
||
11 | * @see ModalController |
||
12 | */ |
||
13 | class InternalLinkModalExtension extends Extension |
||
14 | { |
||
15 | private static $allowed_actions = array( |
||
0 ignored issues
–
show
Comprehensibility
introduced
by
Loading history...
|
|||
16 | 'editorInternalLink', |
||
17 | ); |
||
18 | |||
19 | /** |
||
20 | * @return ModalController |
||
21 | */ |
||
22 | public function getOwner() |
||
23 | { |
||
24 | /** @var ModalController $owner */ |
||
25 | $owner = $this->owner; |
||
26 | return $owner; |
||
27 | } |
||
28 | |||
29 | |||
30 | /** |
||
31 | * Form for inserting internal link pages |
||
32 | * |
||
33 | * @return Form |
||
34 | */ |
||
35 | public function editorInternalLink() |
||
36 | { |
||
37 | /** @var InternalLinkFormFactory $factory */ |
||
38 | $factory = InternalLinkFormFactory::singleton(); |
||
39 | return $factory->getForm($this->getOwner(), "editorInternalLink"); |
||
40 | } |
||
41 | } |
||
42 |