MINOR Adjusted AssetAdmin->getEditForm() to comply with changed javascript - it returns the rendered form now

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92785 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 03:18:19 +00:00
parent 9504fc1d57
commit 2fce8cf06e

View File

@ -291,12 +291,7 @@ HTML;
function getEditForm($id = null) {
if(!$id) $id = $this->currentPageID();
if($id && $id != "root") {
$record = DataObject::get_by_id("File", $id);
} else {
$record = singleton("Folder");
}
$record = ($id && $id != "root") ? DataObject::get_by_id("File", $id) : null;
if($record && !$record->canView()) return Security::permissionFailure($this);
if($record) {
@ -543,13 +538,12 @@ JS;
$p->write();
mkdir($p->FullPath);
chmod($p->FullPath, Filesystem::$file_create_mask);
// Used in TinyMCE inline folder creation
if(isset($_REQUEST['returnID'])) {
return $p->ID;
} else {
return $this->returnItemToUser($p);
$form = $this->getEditForm($p->ID);
return $form->formHtmlContent();
}
}