Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Several merges from branches/2.4

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111631 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit f8f18f40aa409c9bc9b8023d66b9c163908272b9 1 parent c12ebeb
@sminnee sminnee authored
Showing with 39 additions and 3 deletions.
  1. +1 −2  code/AssetAdmin.php
  2. +2 −1  code/CMSMain.php
  3. +36 −0 code/SecurityAdmin.php
View
3  code/AssetAdmin.php
@@ -161,7 +161,6 @@ function doUpload($data, $form) {
$processedFiles[$key][$param] = $value;
}
}
- array_shift($processedFiles);
// Load POST data from arrays in to the correct dohickey.
$processedData = array();
@@ -178,7 +177,7 @@ function doUpload($data, $form) {
}
$processedData = array_reverse($processedData);
- if($data['ID'] && $data['ID'] != 'root') $folder = DataObject::get_by_id("Folder", $data['ID']);
+ if($data['FolderID'] && $data['FolderID'] != '') $folder = DataObject::get_by_id("Folder", $data['FolderID']);
else $folder = singleton('Folder');
foreach($processedFiles as $filePostId => $tmpFile) {
View
3  code/CMSMain.php
@@ -1313,11 +1313,12 @@ function providePermissions() {
$perms["CMS_ACCESS_LeftAndMain"] = array(
'name' => _t('CMSMain.ACCESSALLINTERFACES', 'Access to all CMS sections'),
'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'),
+ 'help' => _t('CMSMain.ACCESSALLINTERFACES', 'Overrules more specific access settings.'),
'sort' => -100
);
if (isset($perms['CMS_ACCESS_ModelAdmin'])) unset($perms['CMS_ACCESS_ModelAdmin']);
-
+
return $perms;
}
View
36 code/SecurityAdmin.php
@@ -63,6 +63,20 @@ function getEditForm($id = null) {
)
)
);
+
+ $fields->addFieldToTab(
+ 'Root.Roles',
+ new LiteralField(
+ 'RolesAddEditLink',
+ sprintf(
+ '<p class="add-role"><a href="%s">%s</a></p>',
+ $this->Link('show/root'),
+ // TODO This should include #Root_Roles to switch directly to the tab,
+ // but tabstrip.js doesn't display tabs when directly adressed through a URL pragma
+ _t('Group.RolesAddEditLink', 'Add/edit roles')
+ )
+ )
+ );
}
$form->Actions()->insertBefore(
@@ -120,6 +134,28 @@ function RootForm() {
// necessary for tree node selection in LeftAndMain.EditForm.js
new HiddenField('ID', false, 0)
);
+
+ // Add roles editing interface
+ if(Permission::check('APPLY_ROLES')) {
+ $rolesCTF = new ComplexTableField(
+ $this,
+ 'Roles',
+ 'PermissionRole'
+ );
+ // Necessary to make Permission code checkboxes behave consistently
+ $rolesCTF->requirementsForPopupCallback = create_function(
+ '$popup',
+ 'Requirements::javascript(CMS_DIR . "/javascript/MemberTableField.js");'
+ );
+
+ $rolesTab = $fields->findOrMakeTab('Root.Roles', _t('SecurityAdmin.TABROLES', 'Roles'));
+ $rolesTab->push(new LiteralField(
+ 'RolesDescription',
+ ''
+ ));
+ $rolesTab->push($rolesCTF);
+ }
+
$actions = new FieldSet(
new FormAction('addmember',_t('SecurityAdmin.ADDMEMBER','Add Member'))
);
Please sign in to comment.
Something went wrong with that request. Please try again.