mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Fix: Prevent inheritance of the default cms fields within widgets.
This commit is contained in:
parent
517e023853
commit
f3a821037c
@ -31,9 +31,12 @@ if(class_exists("Widget")) {
|
|||||||
$type[$k] = _t("BlogArchiveWidget." . ucfirst(strtolower($v)), $v);
|
$type[$k] = _t("BlogArchiveWidget." . ucfirst(strtolower($v)), $v);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields->push(DropdownField::create("BlogID", _t("BlogArchiveWidget.Blog", "Blog"), Blog::get()->map()));
|
$fields->merge(array(
|
||||||
$fields->push(DropdownField::create("Type", _t("BlogArchiveWidget.Type", "Type"), $type));
|
DropdownField::create("BlogID", _t("BlogArchiveWidget.Blog", "Blog"), Blog::get()->map()),
|
||||||
$fields->push(NumericField::create("NumberToDisplay", _t("BlogArchiveWidget.NumberToDisplay", "No. to Display")));
|
DropdownField::create("Type", _t("BlogArchiveWidget.Type", "Type"), $type),
|
||||||
|
NumericField::create("NumberToDisplay", _t("BlogArchiveWidget.NumberToDisplay", "No. to Display"))
|
||||||
|
));
|
||||||
|
$this->extend("updateCMSFields", $fields);
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,11 @@ if(class_exists("Widget")) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
public function getCMSFields() {
|
public function getCMSFields() {
|
||||||
$fields = parent::getCMSFields();
|
$fields = FieldList::create();
|
||||||
$fields->push(DropdownField::create("BlogID", _t("BlogCategoriesWidget.Blog", "Blog"), Blog::get()->map()));
|
$fields->push(
|
||||||
|
DropdownField::create("BlogID", _t("BlogCategoriesWidget.Blog", "Blog"), Blog::get()->map())
|
||||||
|
);
|
||||||
|
$this->extend("updateCMSFields", $fields);
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,9 +19,12 @@ if(class_exists("Widget")) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
public function getCMSFields() {
|
public function getCMSFields() {
|
||||||
$fields = parent::getCMSFields();
|
$fields = FieldList::create();
|
||||||
$fields->push(DropdownField::create("BlogID", _t("BlogRecentPostsWidget.Blog", "Blog"), Blog::get()->map()));
|
$fields->merge(array(
|
||||||
$fields->push(NumericField::create("NumberOfPosts", _t("BlogRecentPostsWidget.NumberOfPosts", "Number of Posts")));
|
DropdownField::create("BlogID", _t("BlogRecentPostsWidget.Blog", "Blog"), Blog::get()->map()),
|
||||||
|
NumericField::create("NumberOfPosts", _t("BlogRecentPostsWidget.NumberOfPosts", "Number of Posts"))
|
||||||
|
));
|
||||||
|
$this->extend("updateCMSFields", $fields);
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,9 @@ if(class_exists("Widget")) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
public function getCMSFields() {
|
public function getCMSFields() {
|
||||||
$fields = parent::getCMSFields();
|
$fields = FieldList::create();
|
||||||
$fields->push(DropdownField::create("BlogID", _t("BlogTagsWidget.Blog", "Blog"), Blog::get()->map()));
|
$fields->push(DropdownField::create("BlogID", _t("BlogTagsWidget.Blog", "Blog"), Blog::get()->map()));
|
||||||
|
$this->extend("updateCMSFields", $fields);
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user