mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
ENHANCEMENT Added subsites dropdown to groups in /admin/security to make relation between groups and subsites more obvious and not dependant on (non-editable) defaults set through SubsiteAdmin
This commit is contained in:
parent
92569b6b42
commit
643a3bd14e
@ -17,6 +17,23 @@ class GroupSubsites extends DataObjectDecorator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateCMSFields(&$fields) {
|
||||||
|
$subsites = DataObject::get('Subsite');
|
||||||
|
$tab = $fields->findOrMakeTab(
|
||||||
|
'Root.Subsites',
|
||||||
|
_t('GroupSubsites.SECURITYTABTITLE', 'Subsites')
|
||||||
|
);
|
||||||
|
$tab->push(new DropdownField(
|
||||||
|
'SubsiteID',
|
||||||
|
_t('GroupSubsites.SECURITYACCESS', 'Limit CMS access to subsites', PR_MEDIUM, 'Dropdown listing existing subsites which this group has access to'),
|
||||||
|
($subsites) ? $subsites->toDropDownMap() : null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
'(' . _t('GroupSubsites.SECURITYACCESS_ALL', 'all', PR_MEDIUM, 'Default for dropdown selection: Group has access to all existingsubsites') . ')'
|
||||||
|
));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function alternateTreeTitle() {
|
function alternateTreeTitle() {
|
||||||
if($this->owner->SubsiteID == 0) return " * " . $this->owner->Title;
|
if($this->owner->SubsiteID == 0) return " * " . $this->owner->Title;
|
||||||
else return $this->owner->Title;
|
else return $this->owner->Title;
|
||||||
|
@ -2,6 +2,17 @@
|
|||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
$lang['en_US']['GroupSubsites']['SECURITYACCESS'] = array(
|
||||||
|
'Limit CMS access to subsites',
|
||||||
|
PR_MEDIUM,
|
||||||
|
'Dropdown listing existing subsites which this group has access to'
|
||||||
|
);
|
||||||
|
$lang['en_US']['GroupSubsites']['SECURITYACCESS_ALL'] = array(
|
||||||
|
'all',
|
||||||
|
PR_MEDIUM,
|
||||||
|
'Default for dropdown selection: Group has access to all existingsubsites'
|
||||||
|
);
|
||||||
|
$lang['en_US']['GroupSubsites']['SECURITYTABTITLE'] = 'Subsites';
|
||||||
$lang['en_US']['Subsite']['PLURALNAME'] = array(
|
$lang['en_US']['Subsite']['PLURALNAME'] = array(
|
||||||
'Subsits',
|
'Subsits',
|
||||||
50,
|
50,
|
||||||
|
Loading…
Reference in New Issue
Block a user