mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
MINOR Check for existing subsites in dropdown generation of FileSubsites->updateCMSFields() (from r85443)
This commit is contained in:
parent
b696fb8e03
commit
8378f60285
@ -36,7 +36,7 @@ class FileSubsites extends DataObjectDecorator {
|
|||||||
function updateCMSFields(FieldSet &$fields) {
|
function updateCMSFields(FieldSet &$fields) {
|
||||||
if($this->owner instanceof Folder) {
|
if($this->owner instanceof Folder) {
|
||||||
$sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin');
|
$sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin');
|
||||||
$dropdownValues = $sites->toDropdownMap();
|
$dropdownValues = ($sites) ? $sites->toDropdownMap() : array();
|
||||||
$dropdownValues[0] = 'All sites';
|
$dropdownValues[0] = 'All sites';
|
||||||
ksort($dropdownValues);
|
ksort($dropdownValues);
|
||||||
if($sites)$fields->addFieldToTab('Root.Details', new DropdownField("SubsiteID", "Subsite", $dropdownValues));
|
if($sites)$fields->addFieldToTab('Root.Details', new DropdownField("SubsiteID", "Subsite", $dropdownValues));
|
||||||
|
Loading…
Reference in New Issue
Block a user