Permalink
Browse files

added some headline fields to make the cms clearer

  • Loading branch information...
1 parent 6d496dd commit 928fdc2eea35c9c8b67f6996aa38e265ec64bc98 @lx-berlin committed Oct 7, 2012
Showing with 44 additions and 38 deletions.
  1. +17 −20 code/FlexSlide.php
  2. +18 −15 code/FlexSlider.php
  3. +5 −2 lang/de.yml
  4. +4 −1 lang/en.yml
View
@@ -60,42 +60,39 @@ public function getCMSFields() {
$field_Position->RightTitle(_t("FlexSlider.PositionExplain"));
$field_SlideTitle = new TextField("SlideTitle", _t("FlexSlider.Title"));
$field_SlideDescription = new TextField("SlideDescription", _t("FlexSlider.Description"));
+ $field_HeadlineLinks = new HeaderField("HeadlineLinks", _t("FlexSlider.HeadlineLinks"));
$field_InternalLink = new TreeDropdownField("InternalLinkID", _t('FlexSlider.InternalLink'), 'SiteTree');
$field_removeInternalLink = new CheckboxField("doRemoveInternalLink", _t("FlexSlider.doRemoveInternalLink"));
- $field_ExternalLink = new TextField("ExternalLink", _t("FlexSlider.ExternalLink"));
+ $field_ExternalLink = new TextField("ExternalLink", _t("FlexSlider.or")." "._t("FlexSlider.ExternalLink"));
+ $field_HeadlineEnabled = new HeaderField("HeadlineEnabled", _t("FlexSlider.HeadlineEnabled"));
$field_isEnabled = new CheckboxField("isEnabled", _t("FlexSlider.isEnabled"));
+ $FieldsArray = array(
+ $field_Position,
+ $field_Picture,
+ $field_SlideTitle,
+ $field_SlideDescription,
+ $field_InternalLink,
+ $field_removeInternalLink,
+ $field_ExternalLink,
+ $field_HeadlineEnabled,
+ $field_isEnabled
+ );
+
$fields->addFieldToTab('Root.Main', $field_Position);
$fields->addFieldToTab('Root.Main', $field_Picture);
$fields->addFieldToTab('Root.Main', $field_SlideTitle);
$fields->addFieldToTab('Root.Main', $field_SlideDescription);
+ $fields->addFieldToTab('Root.Main', $field_HeadlineLinks);
$fields->addFieldToTab('Root.Main', $field_InternalLink);
$fields->addFieldToTab('Root.Main', $field_removeInternalLink);
$fields->addFieldToTab('Root.Main', $field_ExternalLink);
+ $fields->addFieldToTab('Root.Main', $field_HeadlineEnabled);
$fields->addFieldToTab('Root.Main', $field_isEnabled);
return $fields;
}
- // validator (requires https://github.com/lx-berlin/NetefxValidator)
- /*
- public function getCMSValidator() {
-
- $rule_DateUntil_empty = new NetefxValidatorRuleEMPTY ("DateUntil");
- $rule_DateUntil_After_DateFrom = new NetefxValidatorRuleFUNCTION ("DateUntil", '', 'error', array('NetefxValidatorLibraryDate', 'UntilIsMinDaysAfterFrom', array('dateFrom' => 'DateFrom','dateUntil' => 'DateUntil', 'min' => 0)));
- $rule_DateUntil_empty_OR_After_DateFrom = new NetefxValidatorRuleOR ("DateUntil", 'Date Until must be equal or after DateFrom', 'error', array($rule_DateUntil_empty, $rule_DateUntil_After_DateFrom));
- $rule_TitleEN_required = new NetefxValidatorRuleREQUIRED ("TitleEN");
- $rule_DescriptionEN_required = new NetefxValidatorRuleREQUIRED ("DescriptionEN");
- $rule_CityEN_required = new NetefxValidatorRuleREQUIRED ("CityEN");
-
- $validator = new NetefxValidator($rule_DateUntil_empty_OR_After_DateFrom,
- $rule_TitleEN_required,
- $rule_DescriptionEN_required,
- $rule_CityEN_required);
- return $validator;
- }
- */
-
public function onBeforeWrite() {
parent::onBeforeWrite();
View
@@ -97,16 +97,20 @@ public function getCMSFields() {
$field_randomize = new CheckboxField("randomize", _t("FlexSlider.randomize"));
$field_showControlNav = new CheckboxField("showControlNav", _t("FlexSlider.showControlNav"));
- $fields->addFieldToTab('Root.Main', $field_Title);
- $fields->addFieldToTab('Root.Main', $field_slideshow);
- $fields->addFieldToTab('Root.Main', $field_animationLoop);
- $fields->addFieldToTab('Root.Main', $field_animation);
- $fields->addFieldToTab('Root.Main', $field_direction);
- $fields->addFieldToTab('Root.Main', $field_easing);
- $fields->addFieldToTab('Root.Main', $field_slideshowSpeed);
- $fields->addFieldToTab('Root.Main', $field_animationSpeed);
- $fields->addFieldToTab('Root.Main', $field_randomize);
- $fields->addFieldToTab('Root.Main', $field_showControlNav);
+ $FieldsArray = array(
+ $field_Title,
+ $field_slideshow,
+ $field_animationLoop,
+ $field_animation,
+ $field_direction,
+ $field_easing,
+ $field_slideshowSpeed,
+ $field_animationSpeed,
+ $field_randomize,
+ $field_showControlNav
+ );
+
+ $fields->addFieldsToTab('Root.Main', $FieldsArray);
return $fields;
}
@@ -202,16 +206,15 @@ public function forTemplate() {
);
// load all needed Javascript
- Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
- //Requirements::javascript('//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js');
+ Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.min.js');
Requirements::javascript(project() . '/javascript/jquery.easing.1.3.js');
- Requirements::javascript('flexslider/thirdparty/FlexSlider/jquery.flexslider.js');
+ Requirements::javascript('flexslider/thirdparty/FlexSlider/jquery.flexslider-min.js');
Requirements::javascriptTemplate('flexslider/javascript/flexslider.template.js', $flexslider_config);
// load css
Requirements::css('flexslider/thirdparty/FlexSlider/flexslider.css'); // original css of flexslider
- Requirements::css('flexslider/css/flexslider.css'); // additional css for flexslider module for silverstripe
- Requirements::css($this->ThemeDir().'/css/FlexSlider.css'); // look for a custom FlexSlider.css in the projects themes folder
+ Requirements::css('flexslider/css/flexslider.css'); // additional css for ss flexslider module
+ Requirements::css($this->ThemeDir().'/css/flexslider.css'); // look for a custom flexslider.css in the projects themes folder
return $this->renderWith('FlexSlider');
View
@@ -4,10 +4,13 @@ de:
Title: "Titel"
TitleDescription: "Dient nur der Übersicht im CMS"
Description: "Text"
- ExternalLink: "externer Link"
+ HeadlineLinks: "Verlinkung"
+ InternalLink: "interner Link"
+ or: "oder"
+ ExternalLink: "externer Link"
+ HeadlineEnabled: "Slide aktiv/inaktiv schalten"
isEnabled: "ist aktiv"
Picture: "Bild"
- InternalLink: "interner Link"
doRemoveInternalLink: "internen Link entfernen"
Position: "Position"
PositionExplain: "dient der Festlegung der Reihenfolge [0-99]"
View
@@ -4,10 +4,13 @@ en:
Title: "title"
TitleDescription: "Only for overview in cms"
Description: "description"
+ HeadlineLinks: "Link to"
+ InternalLink: "internal link"
+ or: "or"
ExternalLink: "external link"
+ HeadlineEnabled: "active slide"
isEnabled: "enabled"
Picture: "Picture"
- InternalLink: "internal link"
doRemoveInternalLink: "remove internal link"
Position: "position"
PositionExplain: "determs the order of the slides [0-99]"

0 comments on commit 928fdc2

Please sign in to comment.