/**
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->push(TextField::create("Title"));
     $fields->push(HtmlEditorField::create("HTML", "Content"));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", $fields->dataFieldByName("WidgetName"), "Enabled");
     $fields->addFieldToTab("Root.Main", $fields->dataFieldByName("WidgetLabel"), "Enabled");
     return $fields;
 }
Esempio n. 3
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->merge(new FieldSet(new TextField("Title", _t("TagCloudWidget.TILE", "Title")), new TextField("Limit", _t("TagCloudWidget.LIMIT", "Limit number of tags")), new OptionsetField("Sortby", _t("TagCloudWidget.SORTBY", "Sort by"), array("alphabet" => _t("TagCloudWidget.SBAL", "alphabet"), "frequency" => _t("TagCloudWidget.SBFREQ", "frequency")))));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $this->beforeUpdateCMSFields(function (&$fields) {
         $fields->merge(array(new TextField('Title', _t('TwitterWidget.FIELD_TITLE', 'Title'), null, 255), new NumericField('TweetCount', _t('TwitterWidget.FIELD_TWEET_COUNT', 'Tweet Count'))));
     });
     return parent::getCMSFields();
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->merge(new FieldList(new TextField('Title', _t('CategoryCloudWidget.TILE', 'Title')), new NumericField('Limit', _t('CategoryCloudWidget.LIMIT', 'Limit'))));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->merge(new FieldSet(new TextField("WidgetTitle", 'Custom title for widget'), new NumericField('ShowLastYears', 'Nr of years to show all months for'), new CheckboxField('ShowChildren', 'Show blog entries for selected date')));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->merge(new FieldList(TextField::create("Title", _t("TagCloudWidget.TILE", "Title"))));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->merge(new FieldList(TextField::create("Title", _t("TagCloudWidget.TILE", "Title")), TextField::create("Limit", _t("TagCloudWidget.LIMIT", "Limit number of tags")), OptionsetField::create("SortParam"), OptionsetField::create("SortOrder")));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
Esempio n. 9
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->merge(new FieldSet(new OptionsetField('DisplayMode', _t('ArchiveWidget.DispBY', 'Display by'), array('month' => _t('ArchiveWidget.MONTH', 'month'), 'year' => _t('ArchiveWidget.YEAR', 'year')))));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
Esempio n. 10
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->merge(new FieldSet(new TextField("RSSTitle", _t('RSSWidget.CT', "Custom title for the feed")), new TextField("RssUrl", _t('RSSWidget.URL', "URL of the other page's RSS feed.  Please make sure this URL points to an RSS feed.")), new NumericField("NumberToShow", _t('RSSWidget.NTS', "Number of Items to show"))));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", new TextField('WidgetLabel', 'Widget Label'), "Enabled");
     $fields->addFieldToTab("Root.Main", new TextField('WidgetName', 'Widget Name'), "Enabled");
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->push(TextField::create("WidgetLabel", "Widget Label"));
     $fields->push(TextField::create("WidgetTitle", "Widget Title"));
     $fields->push(HtmlEditorField::create("WidgetContent", "Content"));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", new TextField('WidgetLabel', 'Widget Label'), "Enabled");
     $fields->addFieldToTab("Root.Main", new TextField('WidgetName', 'Widget Name'), "Enabled");
     $fields->addFieldToTab("Root.Main", new TextField('WidgetName', 'Widget Name'), "Enabled");
     $fields->addFieldToTab('Root.Main', new TextField('BtnText', 'Button label'));
     $fields->addFieldToTab('Root.Main', new TreeDropdownField("MoreLinkID", "Button link", "SiteTree"));
     return $fields;
 }
 /**
  * {@inheritdoc}
  */
 public function getCMSFields()
 {
     $this->beforeUpdateCMSFields(function ($fields) {
         /**
          * @var FieldList $fields
          */
         $fields->merge(array(DropdownField::create('BlogID', _t('BlogRecentPostsWidget.Blog', 'Blog'), Blog::get()->map()), NumericField::create('NumberOfPosts', _t('BlogRecentPostsWidget.NumberOfPosts', 'Number of Posts'))));
     });
     return parent::getCMSFields();
 }
 /**
  * {@inheritdoc}
  */
 public function getCMSFields()
 {
     $this->beforeUpdateCMSFields(function (FieldList $fields) {
         $fields[] = DropdownField::create('BlogID', _t('BlogCategoriesWidget.Blog', 'Blog'), Blog::get()->map());
         $fields[] = NumericField::create('Limit', _t('BlogCategoriesWidget.Limit.Label', 'Limit'), 0)->setDescription(_t('BlogCategoriesWidget.Limit.Description', 'Limit the number of categories shown by this widget (set to 0 to show all categories).'))->setMaxLength(3);
         $fields[] = DropdownField::create('Order', _t('BlogCategoriesWidget.Sort.Label', 'Sort'), array('Title' => 'Title', 'Created' => 'Created', 'LastUpdated' => 'Updated'))->setDescription(_t('BlogCategoriesWidget.Sort.Description', 'Change the order of categories shown by this widget.'));
         $fields[] = DropdownField::create('Direction', _t('BlogCategoriesWidget.Direction.Label', 'Direction'), array('ASC' => 'Ascending', 'DESC' => 'Descending'))->setDescription(_t('BlogCategoriesWidget.Direction.Description', 'Change the direction of ordering of categories shown by this widget.'));
     });
     return parent::getCMSFields();
 }
 /**
  * {@inheritdoc}
  */
 public function getCMSFields()
 {
     $this->beforeUpdateCMSFields(function ($fields) {
         /**
          * @var FieldList $fields
          */
         $fields->push(DropdownField::create('BlogID', _t('BlogTagsWidget.Blog', 'Blog'), Blog::get()->map()));
     });
     return parent::getCMSFields();
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $type = $this->dbObject("Type")->enumValues();
     foreach ($type as $k => $v) {
         $type[$k] = _t("BlogArchiveWidget." . ucfirst(strtolower($v)), $v);
     }
     $fields->merge(array(DropdownField::create("BlogID", _t("BlogArchiveWidget.Blog", "Blog"), Blog::get()->map()), DropdownField::create("Type", _t("BlogArchiveWidget.Type", "Type"), $type), NumericField::create("NumberToDisplay", _t("BlogArchiveWidget.NumberToDisplay", "No. to Display"))));
     $this->extend("updateCMSFields", $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->add($MenuRootField = DropdownField::Create('MenuRoot', 'Menu Root', singleton('SidebarMenuWidget')->dbObject('MenuRoot')->enumValues()));
     $MenuRootField->setDescription("Select from where the menu starts.<br/>\n                 <strong>Root</strong>: Show the entire page tree.<br/>\n                 <strong>Selected Page</strong>: Show the children of a specific page.<br/>\n                 <strong>Current Page</strong>: Show the children of the page currently being viewed.<br/>\n                 <strong>Root of Current Page</strong>: Show children of the current pages top most page.<br/>");
     $fields->add($ShowAllField = CheckboxField::Create('ShowAll', 'Show All'));
     $ShowAllField->setDescription("Show all pages, even those who are marked as not to show in menus");
     $fields->add($RootPageField = TreeDropdownField::Create("RootPageID", "Root Page", "SiteTree")->setDescription("If <strong>MenuRoot</strong> is set to &quot;Selected Page&quot; set which page to start the menu from"));
     $RootPageField->displayIf("MenuRoot")->isEqualTo("Selected Page");
     $fields->changeFieldOrder(array("WidgetName", "WidgetLabel", "Enabled", "MenuRoot", "RootPageID", "ShowAll"));
     return $fields;
 }
 public function getCMSFields()
 {
     if (!$this->ID) {
         $types = ClassInfo::subclassesFor('Dashlet');
         unset($types['Dashlet']);
         $fields = FieldList::create(array(TextField::create('Title', $this->fieldLabel('Title')), DropdownField::create('ClassName', $this->fieldLabel('DashletType'), $types)));
     } else {
         $fields = parent::getCMSFields();
     }
     $this->extend('updateDashletCMSFields', $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", new TextField('WidgetLabel', 'Widget Label'), "Enabled");
     $fields->addFieldToTab("Root.Main", new TextField('WidgetName', 'Widget Name'), "Enabled");
     $downloadsField = TextField::create('Downloads')->setTitle('Downloads')->setDisabled(true)->setValue('You can add downloads once you have saved the record for the first time.');
     if ($this->ID) {
         $BulkUploadComponent = new GridFieldBulkUpload("File");
         //            $BulkUploadComponent->setConfig('folderName', "DownloadsWidget");
         $downloadsField = new GridField("Downloads", "Downloads", $this->Files(), GridFieldConfig::create()->addComponent(new GridFieldToolbarHeader())->addComponent(new GridFieldAddNewButton("toolbar-header-right"))->addComponent(new GridFieldSortableHeader())->addComponent(new GridFieldDataColumns())->addComponent(new GridFieldPaginator(50))->addComponent(new GridFieldEditButton())->addComponent(new GridFieldDeleteAction())->addComponent(new GridFieldDetailForm())->addComponent(new GridFieldFilterHeader())->addComponent(new GridFieldBulkManager())->addComponent($BulkUploadComponent));
     }
     $fields->addFieldToTab("Root.Main", $downloadsField);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", new TextField('WidgetLabel', 'Widget Label'), "Enabled");
     $fields->addFieldToTab("Root.Main", new TextField('WidgetName', 'Widget Name'), "Enabled");
     if ($this->ID) {
         $config = GridFieldConfig_RelationEditor::create();
         $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Title' => 'Title', 'OpenInNewWindow.Nice' => 'Open In New Window'));
         $relatedPagesField = new GridField('Links', 'Links', $this->Links(), $config);
         $fields->addFieldToTab('Root.Links', $relatedPagesField);
     } else {
         $relatedPagesField = TextField::create('RelatedPage')->setTitle('Related page')->setDisabled(true)->setValue('You can add pages once you have saved the record for the first time.');
         $fields->addFieldToTab('Root.Main', $relatedPagesField);
     }
     return $fields;
 }
 /**
  * {@inheritdoc}
  */
 public function getCMSFields()
 {
     $self =& $this;
     $this->beforeUpdateCMSFields(function ($fields) use($self) {
         /**
          * @var Enum $archiveType
          */
         $archiveType = $self->dbObject('ArchiveType');
         $type = $archiveType->enumValues();
         foreach ($type as $k => $v) {
             $type[$k] = _t('BlogArchiveWidget.' . ucfirst(strtolower($v)), $v);
         }
         /**
          * @var FieldList $fields
          */
         $fields->merge(array(DropdownField::create('BlogID', _t('BlogArchiveWidget.Blog', 'Blog'), Blog::get()->map()), DropdownField::create('ArchiveType', _t('BlogArchiveWidget.ArchiveType', 'ArchiveType'), $type), NumericField::create('NumberToDisplay', _t('BlogArchiveWidget.NumberToDisplay', 'No. to Display'))));
     });
     return parent::getCMSFields();
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->push(new TextField("Label", _t("title", "Titolo"), self::$title));
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->push(DropdownField::create("PageID", "Testimonials Holder Page", TestimonialsHolderPage::get()->map()->toArray())->setHasEmptyDefault(true));
     return $fields;
 }
Esempio n. 25
0
 /**
  * Get CMS Fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->merge(new FieldList(TextField::create("Href", "Facebook Page URL")->setRightTitle("eg: http://www.facebook.com/mypage"), CheckboxField::create('ShowPagePosts')->setDescription("i.e. the latest posts and images"), CheckboxField::create('ShowFaces'), CheckboxField::create('HideCoverPhoto'), CheckboxField::create('UseSmallHeader'), NumericField::create('Width'), NumericField::create('Height'), CheckboxField::create('AdaptContainerWidth')->setDescription('Plugin will try to fit the full width of the container'), LiteralField::create('HeightWarning', '<p class="message">note: some features will not be visible if the chosen height is too short.</p>')));
     return $fields;
 }
 /**
  * Generates a fake request for the field
  * @param {SS_HTTPRequest} $request Source Request to base the fake request off of
  * @param {Widget} $sourceWidget Source widget
  * @param {string} $baseLink Base URL to be truncated off of the form
  * @return {SS_HTTPRequest} Fake HTTP Request used to fool the form field into thinking the request was made to it directly
  */
 protected function getFakeRequest(SS_HTTPRequest $request, Widget $sourceWidget, $baseLink)
 {
     $fieldName = rawurldecode($request->param('FieldName'));
     $objID = preg_replace('/Widget\\[(.*?)\\]\\[(.*?)\\]\\[(.*?)\\]$/', '$2', $fieldName);
     $finalPostVars = array();
     if ($request->isPOST()) {
         $postVars = $request->postVars();
         //Pull the post data for the widget
         if (isset($postVars['Widget'][$this->getName()][$objID])) {
             $finalPostVars = $postVars['Widget'][$this->getName()][$objID];
         } else {
             $finalPostVars = array();
         }
         $finalPostVars = array_merge($finalPostVars, $postVars);
         unset($finalPostVars['Widget']);
         //Workaround for UploadField's and GridFields confusing the request
         $fields = $sourceWidget->getCMSFields();
         $uploadFields = array();
         $gridFields = array();
         foreach ($fields as $field) {
             if ($field instanceof UploadField) {
                 $uploadFields[] = $field->getName();
             } else {
                 if ($field instanceof GridField) {
                     $gridFields[] = $field->getName();
                 }
             }
         }
         //Re-orgazine the upload field data
         if (count($uploadFields)) {
             foreach ($uploadFields as $field) {
                 $formFieldName = 'Widget[' . $this->getName() . '][' . $objID . '][' . $field . ']';
                 $fieldData = array($formFieldName => array('name' => array('Uploads' => array()), 'type' => array('Uploads' => array()), 'tmp_name' => array('Uploads' => array()), 'error' => array('Uploads' => array()), 'size' => array('Uploads' => array())));
                 if (isset($postVars['Widget']['name'][$this->getName()][$objID][$field]['Uploads'])) {
                     for ($i = 0; $i < count($postVars['Widget']['name'][$this->getName()][$objID][$field]['Uploads']); $i++) {
                         $fieldData[$formFieldName]['name']['Uploads'][] = $postVars['Widget']['name'][$this->getName()][$objID][$field]['Uploads'][$i];
                         $fieldData[$formFieldName]['type']['Uploads'][] = $postVars['Widget']['type'][$this->getName()][$objID][$field]['Uploads'][$i];
                         $fieldData[$formFieldName]['tmp_name']['Uploads'][] = $postVars['Widget']['tmp_name'][$this->getName()][$objID][$field]['Uploads'][$i];
                         $fieldData[$formFieldName]['error']['Uploads'][] = $postVars['Widget']['error'][$this->getName()][$objID][$field]['Uploads'][$i];
                         $fieldData[$formFieldName]['size']['Uploads'][] = $postVars['Widget']['size'][$this->getName()][$objID][$field]['Uploads'][$i];
                     }
                 }
                 $finalPostVars = array_merge_recursive($finalPostVars, $fieldData);
             }
         }
         //Reorganize the gridfield data
         if (count($gridFields) && isset($postVars['Widget'][$this->getName()][$objID])) {
             foreach ($gridFields as $field) {
                 $formFieldName = 'Widget[' . $this->getName() . '][' . $objID . '][' . $field . ']';
                 $fieldData = array($formFieldName => $postVars['Widget'][$this->getName()][$objID][$field]);
             }
             $finalPostVars = array_merge_recursive($finalPostVars, $fieldData);
         }
     }
     $headers = $request->getHeaders();
     $request = new SS_HTTPRequest($_SERVER['REQUEST_METHOD'], str_replace(rtrim($baseLink, '/'), '', rtrim($request->getURL(), '/')) . '/', $request->getVars(), $finalPostVars, $request->getBody());
     $request->match('$Action/$ID/$OtherID');
     //Merge in the headers
     foreach ($headers as $header => $value) {
         $request->addHeader($header, $value);
     }
     return $request;
 }