Skip to content

Commit

Permalink
Scrutinizer Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
purplespider committed Feb 3, 2016
1 parent 0b374fa commit 16f6520
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
@@ -1,4 +1,5 @@
# Basic Calendar Module
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/purplespider/silverstripe-basic-calendar/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/purplespider/silverstripe-basic-calendar/?branch=master)

## Introduction

Expand Down
13 changes: 7 additions & 6 deletions code/CalendarEntry.php
Expand Up @@ -40,17 +40,18 @@ public function getCMSFields()
$datefield = new DateField('Date', 'Date (DD/MM/YYYY)*');
$datefield->setConfig('showcalendar', true);
$datefield->setConfig('dateformat', 'dd/MM/yyyy');

$imagefield = new UploadField('Image', 'Image');
$imagefield->allowedExtensions = array('jpg', 'gif', 'png');
$imagefield->setFolderName("Managed/CalendarImages");
$imagefield->setCanPreviewFolder(false);

$imageField = new UploadField('Image', 'Image');
$imageField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
$imageField->setConfig('allowedMaxFileNumber', 1);
$imageField->setFolderName('Managed/CalendarImages');
$imageField->setCanPreviewFolder(false);

$fields->addFieldToTab('Root.Main', new TextField('Title', "Event Title*"));
$fields->addFieldToTab('Root.Main', $datefield);
$fields->addFieldToTab('Root.Main', new TextField('Time', "Time (HH:MM)"));
$fields->addFieldToTab('Root.Main', new TextareaField('Description'));
$fields->addFieldToTab('Root.Main', $imagefield);
$fields->addFieldToTab('Root.Main', $imageField);
});

$fields = parent::getCMSFields();
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -13,8 +13,8 @@
"issues": "https://github.com/purplespider/silverstripe-basic-calendar/issues"
},
"require": {
"silverstripe/framework": "3.*",
"silverstripe/cms": "3.*"
"silverstripe/framework": "^3.1",
"silverstripe/cms": "^3.1"
},
"replace": {"silverstripe/basic-calendar": "*"}
}

0 comments on commit 16f6520

Please sign in to comment.