public function setRootType(DataContainer $dc)
{
if (Input::get('act') != 'create') {
return;
}
// Insert into
if (Input::get('pid') == 0) {
$GLOBALS['TL_DCA']['tl_page']['fields']['type']['default'] = 'root';
} elseif (Input::get('mode') == 1) {
$objPage = $this->Database->prepare("SELECT * FROM " . $dc->table . " WHERE id=?")->limit(1)->execute(Input::get('pid'));
if ($objPage->pid == 0) {
$GLOBALS['TL_DCA']['tl_page']['fields']['type']['default'] = 'root';
}
}
}