public function getCDNWriter() { $stores = $this->contentService->getStoreTypes(); if ($stores && isset($stores[$this->getCDNStore()])) { return $this->contentService->getWriter($this->getCDNStore()); } }
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; }