function AddForm()
 {
     if ($customclass = $this->retrieveCustomModelClass()) {
         $this->modelClass = $customclass;
     }
     $form = parent::AddForm();
     $this->modelClass = $this->backupModelClass;
     return $form;
 }
 function AddForm()
 {
     $form = parent::AddForm();
     $templates = DataObject::get('Subsite_Template', '', 'Title');
     $templateArray = array('' => "(No template)");
     if ($templates) {
         $templateArray = $templateArray + $templates->map('ID', 'Title');
     }
     $form->Fields()->addFieldsToTab('Root.Configuration', array(new DropdownField('Type', 'Type', array('subsite' => 'New site', 'template' => 'New template')), new DropdownField('TemplateID', 'Copy structure from:', $templateArray)));
     return $form;
 }
 public function AddForm()
 {
     $form = parent::AddForm();
     if ($this->modelClass == 'PermissionRole') {
         $permissionField = $form->Fields()->dataFieldByName('Codes');
         if ($permissionField) {
             $permissionField->setHiddenPermissions(SecurityAdmin::$hidden_permissions);
         }
     }
     return $form;
 }