Esempio n. 1
0
 public function getCMSFields()
 {
     $oFieldExternalLink = new TextField('LinkExternalUrl', 'Externe link (opent in nieuw venster, begin met http://)', $this->LinkExternalUrl);
     $name = $oFieldExternalLink->getName();
     $name = preg_replace("/([A-Za-z0-9\\-_]+)/", "Widget[" . $this->ID . "][\\1]", $name);
     $oFieldExternalLink->setName($name);
     $oFieldInternalLink = new SimpleTreeDropdownField('InternalUrlID', 'Interne link', 'SiteTree', $this->InternalUrlID, null, 'Kies een pagina');
     $name = $oFieldInternalLink->getName();
     $name = preg_replace("/([A-Za-z0-9\\-_]+)/", "Widget[" . $this->ID . "][\\1]", $name);
     $oFieldInternalLink->setName($name);
     $aSelectionGroupItems = array(new SelectionGroup_Item('none', new LiteralField('nolink', ''), 'Geen link'), new SelectionGroup_Item('internal', $oFieldInternalLink, 'Interne link'), new SelectionGroup_Item('external', $oFieldExternalLink, 'Externe link'));
     $fldSelectionGroup = new SelectionGroup('LinkType', $aSelectionGroupItems);
     // config htmleditor
     // make a new TinyMCE config called "footer" by copying the default ("cms") config
     /*
     		$footerConfig = CustomHtmlEditorConfig::copy('simpletoolbar', 'cms');
     		$footerConfig->setButtonsForLine(3, array());
     		$footerConfig->setButtonsForLine(2, array());
     */
     $oFields = new FieldList(new TextField('Header', 'Titel'), $fldBody = new HtmlEditorField('Body', 'Inhoud'), new HeaderField('hdrLink', 'Link', 3), new TextField('LinkTxt', 'Tekst link'), $fldSelectionGroup);
     $fldBody->setRows(6);
     // assign the "footer" TinyMCE config to this field
     $fldBody->setEditorConfig('simpletoolbar');
     // set the editor's body class.  This will make it class="typography footer-content"
     $fldBody->setBodyClass('widget_text typograhy');
     return $oFields;
 }
Esempio n. 2
0
 public function getCMSFields()
 {
     $oFieldLinkTxt = new TextField('LinkTxt', 'Externe link (opent in nieuw venster, begin met http://)', $this->LinkTxt);
     $fldExternalLink = new TextField('LinkExternalUrl', 'Externe link (opent in nieuw venster, begin met http://)', $this->LinkExternalUrl);
     $fldInternalLink = new SimpleTreeDropdownField('InternalUrlID', 'Interne link', 'SiteTree', $this->InternalUrlID, null, 'Kies een pagina');
     $aSelectionGroupItems = array(new SelectionGroup_Item('none', new LiteralField('nolink', ''), 'Geen link'), new SelectionGroup_Item('internal', $fldInternalLink, 'Interne link'), new SelectionGroup_Item('external', $fldExternalLink, 'Externe link'));
     $fldSelectionGroup = new SelectionGroup('LinkType', $aSelectionGroupItems);
     if ($this->Created) {
         $oImgSelectField = new SimpleTreeDropdownField('ImgID', '', 'File', '', null, 'Kies een afbeelding');
         $oImgSelectField->setType(SimpleTreeDropdownField::TYPE_FOLDERS_AS_HEADINGS);
     } else {
         $oImgSelectField = new LiteralField("NoImg", '<div class="message notice" style="background-color: #f0f8fc; border-color: #93cde8;"><p>Er kan een afbeelding worden geselecteerd nadat de widget is opgeslagen</p></div>');
     }
     $oFields = new FieldList($oImgSelectField, new TextField('LinkTxt', 'Bijschrift'), new HeaderField('hdrLink', 'Link', 3), $fldSelectionGroup);
     return $oFields;
 }
 function getCMSFields_forPopup()
 {
     $fields = new FieldSet();
     $fields->push(new TextField('Title', _t('SlideshowSlide.TITLE', 'Title'), 'Title'));
     $fields->push(new ImageUploadField('SlideImage', _t('SlideshowSlide.IMAGE', 'Image')));
     if (Slideshow::$enableHTMLContentEditor) {
         $fields->push(new SimpleTinyMCEField('Content', _t('SlideshowSlide.CONTENT', 'Text'), 'Text'));
     } else {
         $fields->push(new TextareaField('Content', _t('SlideshowSlide.CONTENT', 'Text'), 'Text'));
     }
     $PageDropDown = new SimpleTreeDropdownField('LinkID', _t('SlideshowSlide.LINK', 'Link to page'));
     $PageDropDown->setEmptyString(_t('SlideshowSlide.EMPTYSTRING', '-- None --'));
     $fields->push($PageDropDown);
     $fields->push(new LiteralField('DOM-fix', '<div style="height:35px">&nbsp;</div>'));
     return $fields;
 }
 function getCMSFields_forPopup()
 {
     $fields = new FieldSet();
     $fields->push(new FileUploadField('BannerImage', "Banner Image"));
     if (PageBannerDecorator::$content_enabled) {
         $fields->push(new TextField('BannerTitle', 'Title'));
         if (PageBannerDecorator::$enable_html_editor) {
             $fields->push(new SimpleTinyMCEField('BannerContent', 'Content'));
         } else {
             $fields->push(new TextAreaField('BannerContent', 'Content'));
         }
     }
     $page_dropdown = new SimpleTreeDropdownField('BannerLinkID', 'Link to page');
     $page_dropdown->setEmptyString('-- None --');
     $fields->push($page_dropdown);
     if (PageBannerDecorator::$use_default_banner) {
         $fields->push(new CheckboxField('DefaultBanner', 'Set this as the default banner'));
     }
     $fields->push(new LiteralField('DOM-fix', '<div style="height:35px">&nbsp;</div>'));
     return $fields;
 }
 /**
  * Creates a dropdown for selection of folders for choosing an existing file
  *
  * @return DropdownField
  */
 public function ImportDropdown()
 {
     $d = new SimpleTreeDropdownField("ImportFolderID_{$this->id()}", _t('Uploadify.CHOOSEIMPORTFOLDER', 'Choose a folder'), "Folder", null, "Filename");
     $d->setEmptyString('-- ' . _t('Uploadify.PLEASESELECT', 'Select a folder') . ' --');
     $d->addExtraClass("{'url' : '" . $this->Link('importlist') . "' }");
     return $d;
 }