/**
  * SS standard method
  * @return FieldSet
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     foreach (array('Images', 'ProductDisplay', 'OtherProductsShown') as $name) {
         $fields->removeByName($name);
     }
     $fields->addFieldToTab("Root.Content.ProductsPerLoad", new NumericField("NumberOfProductsPerPage", _t("ProductGroup.PRODUCTSPERPAGE", "Number of products per page")));
     return $fields;
 }
 /**
  * standard SS method
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $dos = EcommerceProductTag::get();
     if ($dos->count()) {
         $dosArray = $dos->map()->toArray();
         $field = new CheckboxSetField("EcommerceProductTags", _t("ProductGroupWithTags.ECOMMERCEPRODUCTTAGS", "Select Tags to Show"), $dosArray);
     } else {
         $field = new LiteralField("EcommerceProductTags_Explanation", _t("ProductGroupWithTags.ECOMMERCEPRODUCTTAGSEXPLANANTION", "Create some tags first (see Shop) before you can select what tags to show on this page."));
     }
     $fields->addFieldsToTab("Root.Tags", array($field));
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     foreach (array('ProductDisplay', 'OtherProductsShown') as $name) {
         $fields->removeByName($name);
     }
     $fields->removeFieldFromTab('Root.Content.Main', 'Content');
     $cities = DataObject::get('City');
     $cityArray = array();
     if ($cities && $cities->count()) {
         $cityArray = $cities->map('ID', 'Name');
     }
     $fields->addFieldsToTab('Root.Content.Images', array(new ImageField("Image", _t('MerchantLocation.IMAGE', "Image") . ' 1'), new ImageField("AdditionalImage1", _t('MerchantLocation.IMAGE', "Image") . ' 2'), new ImageField("AdditionalImage2", _t('MerchantLocation.IMAGE', "Image") . ' 3'), new ImageField("AdditionalImage3", _t('MerchantLocation.IMAGE', "Image") . ' 4'), new ImageField("AdditionalImage4", _t('MerchantLocation.IMAGE', "Image") . ' 5')));
     $fields->addFieldsToTab('Root.Content.Main', array(new CheckboxField('Featured', _t('MerchantLocation.IS_FEATURED', 'Featured Location')), new TextField('Address', _t('MerchantLocation.ADDRESS', 'Address')), new TextField('Address2', _t('MerchantLocation.ADDRESS2', 'Address Line 2')), new TextField('PostalCode', _t('MerchantLocation.POSTALCODE', 'Postal Code')), new DropdownField('CityID', _t('MerchantLocation.CITY', 'City'), $cityArray, '', null, ''), new TextField('Phone', _t('MerchantLocation.PHONE', 'Phone')), new TextareaField('OpeningHours', _t('MerchantLocation.OPENINGHOURS', 'Opening hours'))));
     if ($this->ID) {
         $products = DataObject::get('MerchantProduct', "ParentID = {$this->ParentID}");
         if ($products) {
             $fields->addFieldToTab('Root.Content.Products', new CheckboxSetField('AlsoShowProducts', '', $products));
         }
     }
     return $fields;
 }
 /**
  * standard SS Method
  * return FieldSet
  *
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.ProductDisplay', new NumericField("NumberOfLevelsToHide", _t("PriceListPage.NUMBEROFLEVELSTOHIDE", "Number of levels to hide from the top down (e.g. set to one to hide main (top) product group holder). To hide all the parent product groups you can set this variable to something like 999.")));
     return $fields;
 }
コード例 #5
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     foreach (array('Images', 'ProductDisplay', 'OtherProductsShown') as $name) {
         $fields->removeByName($name);
     }
     $fields->addFieldToTab('Root.Content.Main', new TextField('Website'), 'Content');
     if ($this->ID) {
         $fields->addFieldToTab('Root.Content.OnlyShow', new LiteralField('OnlyShowLink', "<p class=\"message good\"><a href=\"{$this->OnlyShowLink()}\" target=\"_blank\">" . $this->OnlyShowLink() . "</a></p>"));
         $fields->addFieldToTab('Root.Content.OnlyShow', new LiteralField('OnlyShowLinkReset', "<p class=\"message good\">Clear: <a href=\"{$this->ClearOnlyShowLink()}\" target=\"_blank\">" . $this->ClearOnlyShowLink() . "</a></p>"));
         $fields->addFieldToTab('Root.Content.OnlyShow', new LiteralField('OnlyShowLinkShowAll', "<p class=\"message good\">All: <a href=\"{$this->OnlyShowLinkAll()}\" target=\"_blank\">" . $this->OnlyShowLinkAll() . "</a></p>"));
     }
     $fields->replaceField('Content', new TextareaField('Content', _t('MerchantPage.CONTENT', 'Content')));
     $fields->addFieldToTab('Root.Content.Logo', new ImageField('Image', _t('MerchantPage.LOGO', 'Logo'), null, null, null, 'Logos'));
     return $fields;
 }