silverstripe-subsites/code/SubsiteAdmin.php
2016-09-23 09:34:23 +01:00

36 lines
834 B
PHP

<?php
use SilverStripe\Admin\ModelAdmin;
/**
* Admin interface to manage and create {@link Subsite} instances.
*
* @package subsites
*/
class SubsiteAdmin extends ModelAdmin {
private static $managed_models = array('Subsite');
private static $url_segment = 'subsites';
private static $menu_title = "Subsites";
private static $menu_icon = "subsites/images/subsites.png";
public $showImportForm=false;
private static $tree_class = 'Subsite';
public function getEditForm($id = null, $fields = null) {
$form = parent::getEditForm($id, $fields);
$grid=$form->Fields()->dataFieldByName('Subsite');
if($grid) {
$grid->getConfig()->removeComponentsByType('SilverStripe\\Forms\\GridField\\GridFieldDetailForm');
$grid->getConfig()->addComponent(new GridFieldSubsiteDetailForm());
}
return $form;
}
}