mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT Adjusted AssetAdmin to Folder->can*() changes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65455 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
62a36c6828
commit
6db9650b32
@ -124,9 +124,7 @@ class AssetAdmin extends LeftAndMain {
|
|||||||
if(isset($data['ID']) && $data['ID'] != 'root') $folder = DataObject::get_by_id("Folder", $data['ID']);
|
if(isset($data['ID']) && $data['ID'] != 'root') $folder = DataObject::get_by_id("Folder", $data['ID']);
|
||||||
else $folder = singleton('Folder');
|
else $folder = singleton('Folder');
|
||||||
|
|
||||||
$canUpload = $folder->userCanEdit();
|
return array( 'CanUpload' => $folder->canEdit());
|
||||||
|
|
||||||
return array( 'CanUpload' => $canUpload );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -273,7 +271,7 @@ HTML;
|
|||||||
$actions = new FieldSet();
|
$actions = new FieldSet();
|
||||||
|
|
||||||
// Only show save button if not 'assets' folder
|
// Only show save button if not 'assets' folder
|
||||||
if( $record->userCanEdit() && $id != "root") {
|
if( $record->canEdit() && $id != "root") {
|
||||||
$actions = new FieldSet(
|
$actions = new FieldSet(
|
||||||
new FormAction('save',_t('AssetAdmin.SAVEFOLDERNAME','Save folder name'))
|
new FormAction('save',_t('AssetAdmin.SAVEFOLDERNAME','Save folder name'))
|
||||||
);
|
);
|
||||||
@ -289,7 +287,7 @@ HTML;
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !$record->userCanEdit() )
|
if( !$record->canEdit() )
|
||||||
$form->makeReadonly();
|
$form->makeReadonly();
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
Loading…
Reference in New Issue
Block a user