2007-08-18 11:38:11 +00:00
|
|
|
<?php
|
2008-11-24 03:22:01 +00:00
|
|
|
/**
|
|
|
|
* Admin interface to manage and create {@link Subsite} instances.
|
|
|
|
*
|
|
|
|
* @package subsites
|
|
|
|
*/
|
2010-03-01 02:53:00 +00:00
|
|
|
class SubsiteAdmin extends ModelAdmin {
|
2007-08-18 11:38:11 +00:00
|
|
|
|
2013-05-06 22:32:40 +12:00
|
|
|
private static $managed_models = array('Subsite');
|
|
|
|
|
|
|
|
private static $url_segment = 'subsites';
|
2008-11-02 22:23:01 +00:00
|
|
|
|
2013-05-06 22:32:40 +12:00
|
|
|
private static $menu_title = "Subsites";
|
2013-05-24 16:39:25 +12:00
|
|
|
|
|
|
|
private static $menu_icon = "subsites/images/subsites.png";
|
2012-07-10 10:43:53 -03:00
|
|
|
|
|
|
|
public $showImportForm=false;
|
2010-03-01 02:53:00 +00:00
|
|
|
|
2013-05-06 22:32:40 +12:00
|
|
|
private static $tree_class = 'Subsite';
|
2013-02-04 14:49:51 +13:00
|
|
|
|
2012-04-25 09:29:32 -03:00
|
|
|
public function getEditForm($id = null, $fields = null) {
|
|
|
|
$form = parent::getEditForm($id, $fields);
|
2010-03-01 02:53:00 +00:00
|
|
|
|
2013-01-03 17:38:51 +01:00
|
|
|
$grid=$form->Fields()->dataFieldByName('Subsite');
|
|
|
|
if($grid) {
|
|
|
|
$grid->getConfig()->removeComponentsByType('GridFieldDetailForm');
|
|
|
|
$grid->getConfig()->addComponent(new GridFieldSubsiteDetailForm());
|
2012-07-10 10:43:53 -03:00
|
|
|
}
|
2010-03-01 02:53:00 +00:00
|
|
|
|
|
|
|
return $form;
|
2007-08-18 11:38:11 +00:00
|
|
|
}
|
2013-08-22 13:02:46 +12:00
|
|
|
|
|
|
|
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');
|
|
|
|
}
|
2007-08-18 11:38:11 +00:00
|
|
|
}
|