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:
Ingo Schommer 2008-11-24 04:04:55 +00:00
parent 92569b6b42
commit 643a3bd14e
2 changed files with 28 additions and 0 deletions

View File

@ -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() {
if($this->owner->SubsiteID == 0) return " * " . $this->owner->Title;
else return $this->owner->Title;

View File

@ -2,6 +2,17 @@
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(
'Subsits',
50,