mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
37843f447e
* Hide admins without subsite support from subsites menu * Add subsite support to default site areas * Enable reloading of subsites switcher dropdown when navigating the site, and when editing subsite areas API Fix parallel pjax menu fetching for subsites. - thanks Mateusz! Delint LeftAndMain_Subsites.js
47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* 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('GridFieldDetailForm');
|
|
$grid->getConfig()->addComponent(new GridFieldSubsiteDetailForm());
|
|
}
|
|
|
|
return $form;
|
|
}
|
|
|
|
public function getResponseNegotiator() {
|
|
$negotiator = parent::getResponseNegotiator();
|
|
$self = $this;
|
|
// Register a new callback
|
|
$negotiator->setCallback('SubsiteList', function() use(&$self) {
|
|
return $self->SubsiteList();
|
|
});
|
|
return $negotiator;
|
|
}
|
|
|
|
public function SubsiteList() {
|
|
return $this->renderWith('SubsiteList');
|
|
}
|
|
}
|