/**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  *
  * @author Roland Lehmann <*****@*****.**>, Sebastian Diel <*****@*****.**>
  * @since 05.09.2012
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), array('TagsPerCloud' => _t('SilvercartSearchCloudWidget.TAGSPERCLOUD'), 'FontSizeCount' => _t('SilvercartSearchCloudWidget.FONTSIZECOUNT'), 'isContentView' => _t('SilvercartProductSliderWidget.IS_CONTENT_VIEW')));
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }
 /**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  * 
  * @author Sascha Koehler <*****@*****.**>
  * @since 23.10.2012
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), SilvercartWidgetTools::fieldLabelsForProductSliderWidget($this), array('SilvercartProductGroupManufacturersWidgetLanguages' => _t('Silvercart.TRANSLATIONS')));
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }
 /**
  * Adds the slider toggle input fields for this widget.
  * 
  * @param SilvercartWidget $widget Widget to initialize
  * @param TabList          $fields Fields to add toggle to
  * 
  * @return void
  * 
  * @author Sebastian Diel <*****@*****.**>
  * @since 07.03.2014
  */
 public static function getCMSFieldsSliderToggleForSliderWidget(SilvercartWidget $widget, $fields)
 {
     $useSlider = new CheckboxField('useSlider', $widget->fieldLabel('useSlider'));
     $autoplay = new CheckboxField('Autoplay', $widget->fieldLabel('Autoplay'));
     $slideDelay = new TextField('slideDelay', $widget->fieldLabel('slideDelay'));
     $buildArrows = new CheckboxField('buildArrows', $widget->fieldLabel('buildArrows'));
     $buildNavigation = new CheckboxField('buildNavigation', $widget->fieldLabel('buildNavigation'));
     $buildStartStop = new CheckboxField('buildStartStop', $widget->fieldLabel('buildStartStop'));
     $autoPlayDelayed = new CheckboxField('autoPlayDelayed', $widget->fieldLabel('autoPlayDelayed'));
     $autoPlayLocked = new CheckboxField('autoPlayLocked', $widget->fieldLabel('autoPlayLocked'));
     $stopAtEnd = new CheckboxField('stopAtEnd', $widget->fieldLabel('stopAtEnd'));
     $transitionEffect = new DropdownField('transitionEffect', $widget->fieldLabel('transitionEffect'), array('fade' => $widget->fieldLabel('transitionEffectFade'), 'horizontalSlide' => $widget->fieldLabel('transitionEffectHSlide'), 'verticalSlide' => $widget->fieldLabel('transitionEffectVSlide')));
     $sliderToggle = ToggleCompositeField::create('Slider', $widget->fieldLabel('SlideshowTab'), array($useSlider, $autoplay, $slideDelay, $buildArrows, $buildNavigation, $buildStartStop, $autoPlayDelayed, $autoPlayLocked, $stopAtEnd, $transitionEffect))->setHeadingLevel(4);
     $fields->addFieldToTab("Root.Main", $sliderToggle);
 }
 /**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  *
  * @author Roland Lehmann <*****@*****.**>
  * @since 13.07.2012
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), array());
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }
 /**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  *
  * @author Roland Lehmann <*****@*****.**>
  * @since 13.07.2012
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), array('numberOfProductsToShow' => _t('SilvercartTopsellerProductsWidget.STOREADMIN_FIELDLABEL')));
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }
 /**
  * Returns an array of field/relation names (db, has_one, has_many, 
  * many_many, belongs_many_many) to exclude from form scaffolding in
  * backend.
  * This is a performance friendly way to exclude fields.
  * 
  * @return array
  * 
  * @author Roland Lehmann <*****@*****.**>
  * @since 14.03.2013
  */
 public function excludeFromScaffolding()
 {
     $excludeFromScaffolding = array_merge(parent::excludeFromScaffolding(), array('Pages'));
     $this->extend('updateExcludeFromScaffolding', $excludeFromScaffolding);
     return $excludeFromScaffolding;
 }
 /**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  *
  * @author Roland Lehmann <*****@*****.**>,
  *         Sebastian Diel <*****@*****.**>
  * @since 01.07.2013
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), SilvercartWidgetTools::fieldLabelsForProductSliderWidget($this), array('SilvercartImageSliderWidgetLanguages' => _t('Silvercart.TRANSLATIONS'), 'FrontTitle' => _t('SilvercartWidget.FRONTTITLE'), 'FrontContent' => _t('SilvercartWidget.FRONTCONTENT'), 'Images' => _t('SilvercartImage.PLURALNAME'), 'SilvercartImageSliderImage' => _t('SilvercartImageSliderImage.PLURALNAME'), 'slideImages' => _t('SilvercartProductSliderWidget.CMS_SLIDERIMAGES'), 'Translations' => _t('SilvercartConfig.TRANSLATIONS')));
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }
 /**
  * evade scaffolding performance friendly
  *
  * @return array name of fields that should be excluded 
  * 
  * @author Roland Lehmann <*****@*****.**>
  * @since 15.03.2013
  */
 public function excludeFromScaffolding()
 {
     $fields = array_merge(parent::excludeFromScaffolding(), array('startAtLevel'));
     return $fields;
 }
 /**
  * Returns a list of fields to exclude from scaffolding
  * 
  * @return array
  * 
  * @author Roland Lehmann <*****@*****.**>, Sebastian Diel <*****@*****.**>
  * @since 02.04.2013
  */
 public function excludeFromScaffolding()
 {
     $fields = array_merge(parent::excludeFromScaffolding(), array('levelsToShow', 'SilvercartProductGroupPageID'));
     return $fields;
 }
 /**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  *
  * @author Sebastian Diel <*****@*****.**>
  * @since 03.03.2014
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), array('SilvercartTextWidgetLanguages' => _t('SilvercartTextWidgetLanguage.PLURALNAME'), 'Headline' => _t('SilvercartTextWidget.HEADLINEFIELD_LABEL'), 'FreeText' => _t('SilvercartTextWidget.FREETEXTFIELD_LABEL'), 'isContentView' => _t('SilvercartTextWidget.IS_CONTENT_VIEW'), 'Content' => _t('Silvercart.CONTENT'), 'Translations' => _t('SilvercartConfig.TRANSLATIONS')));
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }
 /**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  *
  * @author Roland Lehmann <*****@*****.**>
  * @since 13.07.2012
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), array('ShowOnlyWhenFilled' => _t('SilvercartShoppingcartWidget.SHOWONLYWHENFILLED')));
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }
 /**
  * We set checkbox field values here to false if they are not in the post
  * data array.
  *
  * @param array $data The post data array
  *
  * @return void
  * 
  * @author Sascha Koehler <*****@*****.**>, Sebastian Diel <*****@*****.**>
  * @since 28.03.2012
  */
 public function populateFromPostData($data)
 {
     SilvercartWidgetTools::populateFromPostDataForProductSliderWidget($this, $data);
     parent::populateFromPostData($data);
 }
 /**
  * Sets numberOfProductsToFetch to numberOfProductsToShow if it's set to 0.
  * 
  * @return void
  *
  * @author Sebastian Diel <*****@*****.**>
  * @since 23.03.2016
  */
 public function onBeforeWrite()
 {
     parent::onBeforeWrite();
     if ($this->numberOfProductsToShow == 0) {
         $this->numberOfProductsToShow = $this->numberOfProductsToFetch;
     }
 }
 /**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  *
  * @author Roland Lehmann <*****@*****.**>
  * @since 13.07.2012
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), array('SilvercartImages' => _t('SilvercartSlidorionProductGroupWidget.SILVERCARTIMAGES'), 'SilvercartImagesDescription' => _t('SilvercartSlidorionProductGroupWidget.SilvercartImagesDescription'), 'BasicTab' => _t('SilvercartSlidorionProductGroupWidget.CMS_BASICTABNAME'), 'AdvancedTab' => _t('SilvercartSlidorionProductGroupWidget.CMS_ADVANCEDTABNAME'), 'TranslationsTab' => _t('SilvercartConfig.TRANSLATIONS'), 'FrontTitle' => _t('SilvercartSlidorionProductGroupWidget.FRONT_TITLE'), 'FrontContent' => _t('SilvercartSlidorionProductGroupWidget.FRONT_CONTENT'), 'widgetHeight' => _t('SilvercartSlidorionProductGroupWidget.WIDGET_HEIGHT'), 'speed' => _t('SilvercartSlidorionProductGroupWidget.SPEED'), 'interval' => _t('SilvercartSlidorionProductGroupWidget.INTERVAL'), 'hoverPause' => _t('SilvercartSlidorionProductGroupWidget.HOVERPAUSE'), 'autoPlay' => _t('SilvercartSlidorionProductGroupWidget.AUTOPLAY'), 'effect' => _t('SilvercartSlidorionProductGroupWidget.EFFECT'), 'translations' => _t('SilvercartConfig.TRANSLATIONS'), 'Images' => _t('SilvercartImage.PLURALNAME'), 'AddImage' => _t('SilvercartProductSliderWidget.AddImage')));
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }