Cleaned up indentation.

This commit is contained in:
micmania1 2013-09-08 04:46:51 +01:00
parent 1163231161
commit fbb372d1b9

View File

@ -62,36 +62,36 @@ class BlogPost extends Page {
public function getCMSFields() { public function getCMSFields() {
// Assign to variable & pass for PHP <= 5.4 closure compatibility // Assign to variable & pass for PHP <= 5.4 closure compatibility
$data['TagsMap'] = $this->Parent()->Tags()->map()->toArray(); $data['TagsMap'] = $this->Parent()->Tags()->map()->toArray();
$data['CategoryMap'] = $this->Parent()->Categories()->map()->toArray(); $data['CategoryMap'] = $this->Parent()->Categories()->map()->toArray();
$this->beforeUpdateCMSFields(function($fields) use ($data) { $this->beforeUpdateCMSFields(function($fields) use ($data) {
// Add Publish date fields // Add Publish date fields
$fields->insertAfter( $fields->insertAfter(
$publishDate = DatetimeField::create("PublishDate", _t("BlogPost.PublishDate", "Publish Date")), $publishDate = DatetimeField::create("PublishDate", _t("BlogPost.PublishDate", "Publish Date")),
"Content" "Content"
); );
$publishDate->getDateField()->setConfig("showcalendar", true); $publishDate->getDateField()->setConfig("showcalendar", true);
// Add Categories & Tags fields // Add Categories & Tags fields
$categoriesField = ListboxField::create("Categories", _t("BlogPost.Categories", "Categories"), $data['CategoryMap']) $categoriesField = ListboxField::create("Categories",
->setMultiple(true); _t("BlogPost.Categories", "Categories"), $data['CategoryMap'])->setMultiple(true);
$fields->insertAfter($categoriesField, "PublishDate"); $fields->insertAfter($categoriesField, "PublishDate");
$tagsField = ListboxField::create("Tags", _t("BlogPost.Tags", "Tags"), $data['TagsMap']) $tagsField = ListboxField::create("Tags", _t("BlogPost.Tags", "Tags"), $data['TagsMap'])
->setMultiple(true); ->setMultiple(true);
$fields->insertAfter($tagsField, "Categories"); $fields->insertAfter($tagsField, "Categories");
// Add featured image // Add featured image
$fields->insertBefore( $fields->insertBefore(
$uploadField = UploadField::create("FeaturedImage", _t("BlogPost.FeaturedImage", "Featured Image")), $uploadField = UploadField::create("FeaturedImage", _t("BlogPost.FeaturedImage", "Featured Image")),
"Content" "Content"
); );
$uploadField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif')); $uploadField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
}); });
$fields = parent::getCMSFields(); $fields = parent::getCMSFields();
return $fields; return $fields;
} }