/** 
  * Populate the additional field.
  * @return Fieldset 
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $pagesSearch = CatalogueHomePage::get_page_subclasses('CataloguePage');
     $pagesBrowse = CatalogueHomePage::get_page_subclasses('BrowsePage');
     $pagesRegister = CatalogueHomePage::get_page_subclasses('RegisterDataPage');
     $fields->addFieldsToTab('Root.Catalog', array(new DropdownField('SearchPageName', 'Use this page as search page (must be of type "Catalogue Page")', $pagesSearch), new DropdownField('BrowsePageName', 'Use this page as browse page (must be of type "Browse Page")', $pagesBrowse), new DropdownField('SubmitDataPageName', 'Use this page as submit data page (must be of type "Register Data Page")', $pagesRegister)));
     if (CataloguePage::get_site_status() != 'setup') {
         $fields->makeFieldReadonly('SearchPageName');
         $fields->makeFieldReadonly('BrowsePageName');
         $fields->makeFieldReadonly('SubmitDataPageName');
     }
     return $fields;
 }
 /**
  * Overwrites SiteTree.getCMSFields to change the CMS form behaviour, 
  *  i.e. by adding form fields for the additional attributes defined in 
  * {@link RegisterDataPage::$db}.
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     Requirements::javascript('geocatalogue/javascript/GeonetworkUrlValidator.js');
     $pagesSearch = CatalogueHomePage::get_page_subclasses('CataloguePage');
     // customise form fields
     $fields->addFieldsToTab('Root.Content.Catalogue', array(new TextField('GeonetworkBaseURL', 'The base URL of the GeoNetwork-Server you want to connect to:'), new EmailField('SendConfitmationsTo', 'Notify this email address of new submissions'), new TextField('EmailName', 'The name of the person who receives the notification'), new TextField('Username', 'GeoNetwork username'), new PasswordField('Password', 'Geonetwork password'), new DropdownField('RedirectOnSuccess', 'page (url-segment) to redirect the user after a successful submission")', $pagesSearch)));
     if (CataloguePage::get_site_status() != 'setup') {
         $fields->makeFieldReadonly('GeonetworkBaseURL');
         $fields->makeFieldReadonly('SendConfitmationsTo');
         $fields->makeFieldReadonly('EmailName');
         $fields->makeFieldReadonly('Username');
         $fields->makeFieldReadonly('RedirectOnSuccess');
         $fields->removeByName('Password');
     }
     // return the modified fieldset.
     return $fields;
 }