/** * 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; }
/** * * @return FieldList */ public function getCMSFields() { $fields = parent::getCMSFields(); Requirements::javascript('geocatalogue/javascript/GeonetworkUrlValidator.js'); $fields->addFieldsToTab('Root.Catalog', array(new TextField('GeonetworkBaseURL', 'The base URL of the GeoNetwork-Server you want to connect to:'), new TextField('GeonetworkUsername', 'GeoNetwork username'), new PasswordField('GeonetworkPassword', 'Geonetwork password'), new TextField('ResultsPerSearchPage', 'How many results per page (1 .. 99):'))); if (CataloguePage::get_site_status() != 'setup') { $fields->makeFieldReadonly('GeonetworkBaseURL'); $fields->makeFieldReadonly('GeonetworkUsername'); $fields->makeFieldReadonly('ResultsPerSearchPage'); $fields->removeByName('GeonetworkPassword'); } // return the modified fieldset. 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; }
/** * Overwrites {@link SiteTree::getCMSFields}. * * Appends a GeoNetwork JavaScript validator the the CMS backend. * * @return FieldSet */ function getCMSFields() { Requirements::javascript('geocatalogue/javascript/GeonetworkUrlValidator.js'); $fields = parent::getCMSFields(); return $fields; }
<?php /* Requires XSLT-Processor, i.e. >> sudo apt-get install php5-xsl */ // Change this field to anything except 'setup' do set the configuration fields // to read-only. CataloguePage::set_site_status('setup'); Director::addRules(100, array('admin/metadata' => "MetadataAdmin")); // Add model admin for the metadata entries. CMSMenu::add_menu_item("metadata", 'Metadata', 'admin/metadata', "MetadataAdmin");