Skip to content

Commit

Permalink
Merge pull request #4 from dnadesign/feature/silverstripe-4
Browse files Browse the repository at this point in the history
Silverstripe 4 support
  • Loading branch information
adrexia authored Sep 8, 2017
2 parents 6417875 + ef38924 commit e5330db
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
5 changes: 5 additions & 0 deletions _config.php
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
<?php

namespace DNA\AdvancedDropdowns;



14 changes: 12 additions & 2 deletions code/AdvancedDropdownField.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<?php

class AdvancedDropdownField extends DropDownField {
namespace DNA\AdvancedDropdowns;


use SilverStripe\Forms\DropdownField;
use SilverStripe\View\ArrayData;
use SilverStripe\ORM\ArrayList;
use SilverStripe\Forms\FormField;



class AdvancedDropdownField extends DropdownField {

protected $extraClasses = array('dropdown advanceddropdown');

Expand All @@ -15,7 +25,7 @@ public function Field($properties = array()) {
$empty = $this->getEmptyString();
$options[] = new ArrayData(array(
'Value' => '',
'Title' => $empty['Title'],
'Title' => $empty,
'Selected' => $selected,
'Disabled' => $disabled,
'Attributes' => $this->createOptionAttributes($empty)
Expand Down
11 changes: 10 additions & 1 deletion code/AdvancedGroupedDropdownField.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?php

class AdvancedGroupedDropdownField extends GroupedDropDownField {
namespace DNA\AdvancedDropdowns;

use SilverStripe\Forms\FormField;
use SilverStripe\Forms\GroupedDropdownField;
use SilverStripe\ORM\ArrayList;
use SilverStripe\View\ArrayData;



class AdvancedGroupedDropdownField extends GroupedDropdownField {

public function Field($properties = array()) {
$options = '';
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"silverstripe/framework": "~3.1"
"silverstripe/framework": "^4.0"
},
"extra": {
"installer-name": "advanceddropdowns"
Expand Down
File renamed without changes.

0 comments on commit e5330db

Please sign in to comment.