public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldFromTab('Root', 'PageParents');
     $fields->addFieldToTab('Root.Main', HeaderField::create('SettingsHeading', _t('BlockSet.Settings', 'Settings')), 'Title');
     $fields->addFieldToTab('Root.Main', MultiValueCheckboxField::create('PageTypes', _t('BlockSet.OnlyApplyToThesePageTypes', 'Only apply to these Page Types:'), $this->pageTypeOptions())->setDescription(_t('BlockSet.OnlyApplyToThesePageTypesDescription', 'Selected Page Types will inherit this Block Set automatically. Leave all unchecked to apply to all page types.')));
     $fields->addFieldToTab('Root.Main', TreeMultiselectField::create('PageParents', _t('BlockSet.OnlyApplyToChildrenOfThesePages', 'Only apply to children of these Pages:'), 'SiteTree'));
     $fields->addFieldToTab('Root.Main', CheckboxField::create('IncludePageParent', _t('BlockSet.ApplyBlockSetToSelectedPageParentsAsWellAsChildren', 'Apply block set to selected page parents as well as children')));
     if (!$this->ID) {
         $fields->addFieldToTab('Root.Main', LiteralField::create('NotSaved', "<p class='message warning'>" . _t('BlockSet.YouCanAddBlocksToThisSetOnceYouHaveSavedIt', 'You can add Blocks to this set once you have saved it for the first time') . '</p>'));
         return $fields;
     }
     $fields->removeFieldFromTab('Root', 'Blocks');
     $gridConfig = GridFieldConfig_BlockManager::create(true, true, true, true, true)->addExisting()->addComponent(new GridFieldOrderableRows());
     $gridSource = $this->Blocks()->Sort('Sort');
     $fields->addFieldToTab('Root.Main', HeaderField::create('BlocksHeading', _t('Block.PLURALNAME', 'Blocks')));
     $fields->addFieldToTab('Root.Main', GridField::create('Blocks', _t('Block.PLURALNAME', 'Blocks'), $gridSource, $gridConfig));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->replaceField('LastSync', new ReadonlyField('LastSync', _t('ThemeCdn.LAST_SYNC', 'Last Sync')));
     $config = SiteConfig::current_site_config();
     $themes = $config->getAvailableThemes();
     $themes = array_merge(array('' => ''), $themes);
     $fields->replaceField('Theme', new DropdownField('Theme', _t('ThemeCdn.THEME', 'Theme'), $themes));
     if ($this->Theme) {
         // $fields->addFieldToTab('Root.Main', new MultiValue
         $fields->replaceField('Files', MultiValueCheckboxField::create('Files', _t('ThemeCdn.FILES', 'Files'), $this->getThemeFiles()));
     }
     $stores = $this->contentService->getStoreTypes();
     if (count($stores)) {
         $default = array('' => 'No CDN');
         $stores = array_merge($default, array_combine(array_keys($stores), array_keys($stores)));
         $fields->replaceField('StoreIn', DropdownField::create('StoreIn', 'CDN', $stores));
     }
     return $fields;
 }