mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
bf1390f0f8
LeftAndMain assumes tree_class exists, and tries to use it, but causes a non-object error because of querying with a NULL class name.
30 lines
670 B
PHP
30 lines
670 B
PHP
<?php
|
|
/**
|
|
* Admin interface to manage and create {@link Subsite} instances.
|
|
*
|
|
* @package subsites
|
|
*/
|
|
class SubsiteAdmin extends ModelAdmin {
|
|
|
|
static $managed_models = array('Subsite');
|
|
static $url_segment = 'subsites';
|
|
|
|
static $menu_title = "Subsites";
|
|
|
|
public $showImportForm=false;
|
|
|
|
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('GridFieldDetailForm');
|
|
$grid->getConfig()->addComponent(new GridFieldSubsiteDetailForm());
|
|
}
|
|
|
|
return $form;
|
|
}
|
|
}
|