Permalink
Browse files

MINOR Adjusted AssetAdmin->getEditForm() to comply with changed javas…

…cript - it returns the rendered form now

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92785 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
chillu committed Nov 21, 2009
1 parent 9504fc1 commit 2fce8cf06e5ca36c9f723b05d08ff4d29d06ca20
Showing with 5 additions and 11 deletions.
  1. +5 −11 code/AssetAdmin.php
View
@@ -291,12 +291,7 @@ function EditForm($request = null) {
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) {
@@ -542,14 +537,13 @@ public function addfolder() {
}
$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();
}
}

0 comments on commit 2fce8cf

Please sign in to comment.