silverstripe-subsites/src/Extensions/CMSPageAddControllerExtension.php

17 lines
442 B
PHP
Raw Normal View History

<?php
2016-09-22 16:38:29 +02:00
2017-05-24 12:32:05 +02:00
namespace SilverStripe\Subsites\Extensions;
2017-06-01 15:57:53 +02:00
2016-09-22 16:38:29 +02:00
use SilverStripe\Core\Extension;
use SilverStripe\Forms\FieldList;
2017-05-24 15:26:28 +02:00
use SilverStripe\Forms\HiddenField;
use SilverStripe\Subsites\State\SubsiteState;
2017-05-24 12:32:05 +02:00
2017-05-24 15:26:28 +02:00
class CMSPageAddControllerExtension extends Extension
{
public function updatePageOptions(FieldList $fields)
2017-05-24 15:26:28 +02:00
{
$fields->push(HiddenField::create('SubsiteID', 'SubsiteID', SubsiteState::singleton()->getSubsiteId()));
2017-05-24 15:26:28 +02:00
}
}