public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextField('Query', _t('TwitterConnector.SEARCH_QUERY', 'Search Query (optional)'))); $fields->addFieldToTab('Root.Main', new TextField('Username', _t('ExternalContentSource.USER', 'Username'))); $fields->addFieldToTab('Root.Main', new TextField('Password', _t('ExternalContentSource.PASS', 'Password'))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextField('ApiUrl', _t('ExternalContentSource.API_URL', 'Remote SilverStripe URL'))); $fields->addFieldToTab('Root.Main', new TextField('Username', _t('ExternalContentSource.USER', 'Username'))); $fields->addFieldToTab('Root.Main', new PasswordField('Password', _t('ExternalContentSource.PASS', 'Password'))); $fields->addFieldToTab('Root.Main', new TextField('RootId', _t('ExternalContentSource.ROOT_ID', 'Root Page ID'))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new DropdownField('RepositoryType', _t('AlfrescoContentSource.REPO_TYPE', 'Repository Type'), array('Alfresco' => 'Alfresco'))); $fields->addFieldToTab('Root.Main', new TextField('ApiUrl', _t('AlfrescoContentSource.API_URL', 'API Url'))); $fields->addFieldToTab('Root.Main', new TextField('Username', _t('AlfrescoContentSource.USER', 'Username'))); $fields->addFieldToTab('Root.Main', new PasswordField('Password', _t('AlfrescoContentSource.PASS', 'Password'))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextField('SharePointUrl', _t('SharePointContentSource.SP_URL', 'SharePoint Url'))); $fields->addFieldToTab('Root.Main', new TextField('SharePointUser', _t('SharePointContentSource.USER', 'Username'))); $fields->addFieldToTab('Root.Main', new PasswordField('SharePointPass', _t('SharePointContentSource.PASS', 'Password'))); $fields->addFieldToTab('Root.Main', new TextField('ListID', _t('SharePointContentSource.LIST_ID', 'List ID (Optional, including the enclosing { } characters)'))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new DropdownField('RepositoryType', _t('CmisContentSource.REPO_TYPE', 'Repository Type'), array('Alfresco' => 'Alfresco', 'KnowledgeTree' => 'KnowledgeTree'))); $fields->addFieldToTab('Root.Main', new TextField('RepositoryInfoUrl', _t('CmisContentSource.REPO_INFO_URL', 'Repository Information URL'))); $fields->addFieldToTab('Root.Main', new TextField('RootNodeUrl', _t('CmisContentSource.ROOT_NODE_URL', 'Root Node URL (Optional)'))); $fields->addFieldToTab('Root.Main', new TextField('Username', _t('CmisContentSource.USER', 'Username'))); $fields->addFieldToTab('Root.Main', new PasswordField('Password', _t('CmisContentSource.PASS', 'Password'))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextField('Host', _t('LdapContentSource.HOST', 'Host'))); $fields->addFieldToTab('Root.Main', new TextField('Port', _t('LdapContentSource.PORT', 'Port'), 389)); $fields->addFieldToTab('Root.Main', new TextField('BaseDN', _t('LdapContentSource.BASEDN', 'Base DN'))); $fields->addFieldToTab('Root.Main', new TextField('BindUser', _t('LdapContentSource.BINDUSER', 'Bind User (if any)'))); $fields->addFieldToTab('Root.Main', new PasswordField('BindPass', _t('LdapContentSource.BINDPASS', 'Bind Pass (if any)'))); return $fields; }
/** * @return FieldSet */ public function getCMSFields() { $fields = parent::getCMSFields(); //Requirements::css('wordpressconnector/css/WordpressContentSource.css'); $fields->fieldByName('Root.Main')->getChildren()->changeFieldOrder(array('Name', 'BaseUrl', 'Username', 'Password', 'ShowContentInMenu')); $fields->addFieldToTab('Root.Advanced', new NumericField('CacheLifetime', 'Cache Lifetime (in seconds)')); if ($this->BaseUrl && !$this->isValid()) { $error = new LiteralField('ConnError', sprintf('<p id="drupal-conn-error">%s <span>%s</span></p>', $this->fieldLabel('ConnError'), $this->error)); $fields->addFieldToTab('Root.Main', $error, 'Name'); } return $fields; }
/** * @return FieldSet */ public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new DropdownField('ConnectorType', _t('ExternalContentSource.CONNECTOR_TYPE', 'Connector Type'), $this->dbObject('ConnectorType')->enumValues())); $fields->addFieldToTab('Root.Main', new TextField('ApiUrl', _t('ExternalContentSource.API_URL', 'API Url'))); $fields->addFieldToTab('Root.Main', new TextField('Username', _t('ExternalContentSource.USER', 'Username'))); $fields->addFieldToTab('Root.Main', new PasswordField('Password', _t('ExternalContentSource.PASS', 'Password'))); $fields->addFieldToTab('Root.Main', new TextField('ApiKey', _t('MatrixContentSource.API_KEY', 'API Key (get this from your Matrix installation)'))); $fields->addFieldToTab('Root.Main', new TextField('RootAsset', _t('MatrixContentSource.ROOT_ASSET', 'Asset ID of the root site to browse'))); $fields->addFieldToTab('Root.Main', new TextField('CacheTimeout', _t('MatrixContentSource.CACHE_TIMEOUT', 'How long should content be cached for (in seconds)?'))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $importRules = $fields->dataFieldByName('Schemas'); $importRules->getConfig()->removeComponentsByType('GridFieldAddExistingAutocompleter'); $importRules->getConfig()->removeComponentsByType('GridFieldAddNewButton'); $addNewButton = new GridFieldAddNewButton('after'); $addNewButton->setButtonName("Add schema"); $importRules->getConfig()->addComponent($addNewButton); $fields->removeFieldFromTab("Root", "Schemas"); $fields->removeFieldFromTab("Root", "Pages"); $fields->addFieldToTab("Root.Main", new LiteralField("", "<p>Each import rule will import content for a field" . " by getting the results of a CSS selector. If more than one rule exists for a field, then they will be" . " processed in the order they appear. The first rule that returns content will be the one used.</p>")); $fields->addFieldToTab("Root.Main", $importRules); $processingOptions = array("" => "No pre-processing"); foreach (ClassInfo::implementorsOf('StaticSiteUrlProcessor') as $processor) { $processorObj = new $processor(); $processingOptions[$processor] = "<strong>" . Convert::raw2xml($processorObj->getName()) . "</strong><br>" . Convert::raw2xml($processorObj->getDescription()); } $fields->addFieldToTab("Root.Main", new OptionsetField("UrlProcessor", "URL processing", $processingOptions)); switch ($this->urlList()->getSpiderStatus()) { case "Not started": $crawlButtonText = _t('StaticSiteContentSource.CRAWL_SITE', 'Crawl site'); break; case "Partial": $crawlButtonText = _t('StaticSiteContentSource.RESUME_CRAWLING', 'Resume crawling'); break; case "Complete": $crawlButtonText = _t('StaticSiteContentSource.RECRAWL_SITE', 'Re-crawl site'); break; default: throw new LogicException("Invalid getSpiderStatus() value '" . $this->urlList()->getSpiderStatus() . ";"); } $crawlButton = FormAction::create('crawlsite', $crawlButtonText)->setAttribute('data-icon', 'arrow-circle-double')->setUseButtonTag(true); $fields->addFieldsToTab('Root.Crawl', array(new ReadonlyField("CrawlStatus", "Crawling Status", $this->urlList()->getSpiderStatus()), new ReadonlyField("NumURLs", "Number of URLs", $this->urlList()->getNumURLs()), new LiteralField('CrawlActions', "<p>Before importing this content, all URLs on the site must be crawled (like a search engine does). Click" . " the button below to do so:</p>" . "<div class='Actions'>{$crawlButton->forTemplate()}</div>"))); if ($this->urlList()->getSpiderStatus() == "Complete") { $urlsAsUL = "<ul>"; foreach (array_unique($this->urlList()->getProcessedURLs()) as $raw => $processed) { if ($raw == $processed) { $urlsAsUL .= "<li>{$processed}</li>"; } else { $urlsAsUL .= "<li>{$processed} <em>(was: {$raw})</em></li>"; } } $urlsAsUL .= "</ul>"; $fields->addFieldToTab('Root.Crawl', new LiteralField('CrawlURLList', "<p>The following URLs have been identified:</p>" . $urlsAsUL)); } $fields->dataFieldByName("ExtraCrawlUrls")->setDescription("Add URLs that are not reachable through content scraping, eg: '/about/team'. One per line")->setTitle('Additional URLs'); $fields->dataFieldByName("UrlExcludePatterns")->setDescription("URLs that should be excluded (support regular expression). eg: '/about/.*'. One per URL")->setTitle('Excluded URLs'); return $fields; }
/** * @return FieldSet */ public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new DropdownField('DrupalVersion', 'Drupal Version', singleton('DrupalContentSource')->dbObject('DrupalVersion')->enumValues())); $fields->fieldByName('Root.Main')->getChildren()->changeFieldOrder(array('Name', 'BaseUrl', 'DrupalVersion', 'Username', 'Password', 'APIKey', 'APIKeyDomain', 'ShowContentInMenu')); $fields->addFieldToTab('Root.Advanced', new NumericField('CacheLifetime', 'Cache Lifetime (in seconds)')); if ($this->BaseUrl && !$this->isValid()) { $error = new LiteralField('ConnError', sprintf('<p id="drupal-conn-error">%s <span>%s</span></p>', $this->fieldLabel('ConnError'), $this->error)); $fields->addFieldToTab('Root.Main', $error, 'Name'); } $fields->addFieldsToTab('Root.Import', array(new CheckboxField('ImportMedia', 'Import and rewrite references to Drupal media?', true), new TextField('FileRelation', 'Relation on Page to import attached files into'), new TextField('AssetsPath', 'Upload Drupal files to', 'Uploads/Drupal'))); if (class_exists('TaxonomyTerm')) { $fields->addFieldToTab('Root.Import', new TextField('TaxonomyRelation', 'Relation on Page to import taxonomy tags into')); } $fields->addFieldsToTab('Root.Import', array(new TextField('PageType', 'Page type to import into (leave blank for default)'), new CheckboxField('PublishOnImport', 'Publish pages after import?'), new CheckboxField('ImportPublishDates', 'Import created and last edited dates?'))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); Requirements::css('rssconnector/css/RssContentAdmin.css'); $fields->addFieldToTab('Root.Main', new TextField('Url', 'RSS/Atom Feed URL'), 'ShowContentInMenu'); $fields->addFieldToTab('Root.Advanced', new NumericField('CacheLifetime', 'Cache Lifetime (in seconds)')); if (!$this->Url || !($client = $this->getClient())) { return $fields; } if ($client->error) { $message = 'The feed URL entered appears to be invalid, or could not be loaded.'; $error = $client->error; $fields->addFieldToTab('Root.Main', new LiteralField('InvalidFeed', sprintf('<p id="invalid-feed">%s<span>%s</span></p>', $message, $error)), 'Name'); return $fields; } $fields->addFieldsToTab('Root.Main', array(new HeaderField('FeedDetailsHeader', 'Feed Details'), new ReadonlyField('FeedTitle', 'Title', $client->get_title()), new ReadonlyField('FeedDescription', 'Description', $client->get_description()), new ReadonlyField('FeedLink', 'Link', $client->get_link()))); // If the blog module doesn't exist, we can't run imports. if (!class_exists('BlogEntry')) { $fields->addFieldToTab('Root.Import', new LiteralField('RequiresBlogImport', '<p>The RSS connector requires the blog ' . 'module to import RSS items.</p>')); return $fields; } $fields->addFieldsToTab('Root.Import', array(new HeaderField('PostImportHeader', 'Post Import Settings'), new CheckboxField('PublishPosts', 'Publish imported posts?', true), new CheckboxField('ProvideComments', 'Allow comments on imported posts?', true), new HeaderField('TagsImportHeader', 'Tags Import Settings'), new CheckboxField('ImportCategories', 'Import categories as tags?', true), new DropdownField('UnknownCategories', 'Unknown categories', array('create' => 'Have a tag created for them', 'skip' => 'Are ignored')), new TextField('ExtraTags', 'Tags to include on imported posts (comma separated)'), new HeaderField('GeneralImportHeader', 'General Import Settings'))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextField('FolderPath', _t('FileSystemContentSource.FOLDER_PATH', 'Folder Path'))); return $fields; }