diff --git a/code/controllers/AssetAdmin.php b/code/controllers/AssetAdmin.php index 7d4ef041..9b88a028 100644 --- a/code/controllers/AssetAdmin.php +++ b/code/controllers/AssetAdmin.php @@ -72,6 +72,36 @@ JS CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder'); } + + public function getEditForm($id = null, $fields = null) { + $form = parent::getEditForm($id, $fields); + + $fields = $form->Fields(); + $fields->findOrMakeTab('Root.TreeView', _t('AssetAdmin.TreeView', 'Tree View')); + $fields->addFieldToTab('Root.TreeView', + // TODO Replace with lazy loading on client to avoid performance hit of rendering potentially unused views + new LiteralField( + 'Tree', + FormField::createTag( + 'div', + array( + 'class' => 'cms-tree', + 'data-url' => $this->Link('getsubtree'), + 'data-url-savetreenode' => $this->Link('savetreenode') + ), + $this->SiteTreeAsUL() + ) + ) + ); + + $form->addExtraClass('cms-edit-form'); + $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); + // TODO Can't merge $FormAttributes in template at the moment + $form->addExtraClass('center ss-tabset ' . $this->BaseCSSClasses()); + if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet'); + + return $form; + } public function AddForm() { $form = parent::AddForm(); diff --git a/code/controllers/CMSFileAddController.php b/code/controllers/CMSFileAddController.php index e282a10c..44b4d2ff 100644 --- a/code/controllers/CMSFileAddController.php +++ b/code/controllers/CMSFileAddController.php @@ -35,11 +35,14 @@ class CMSFileAddController extends AssetAdmin { } $form = new Form($this, 'getEditForm', new FieldList($uploadField), new FieldList()); - $form->addExtraClass('cms-content center cms-edit-form ' . $this->BaseCSSClasses()); + $form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses()); $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); return $form; } + function Tools() { + return false; + } } \ No newline at end of file diff --git a/templates/Includes/AssetAdmin_Content.ss b/templates/Includes/AssetAdmin_Content.ss deleted file mode 100644 index c647b543..00000000 --- a/templates/Includes/AssetAdmin_Content.ss +++ /dev/null @@ -1,51 +0,0 @@ -
- -
-
-

- <% include CMSBreadcrumbs %> -

- -
-
- - -
-
-

- -
- $AddForm -
-
- $SiteTreeAsUL -
-
- -
- -
-
- $EditForm -
-
- Not implemented yet -
-
- Not implemented yet -
-
- -
\ No newline at end of file diff --git a/templates/Includes/AssetAdmin_EditForm.ss b/templates/Includes/AssetAdmin_EditForm.ss deleted file mode 100644 index 45fe1125..00000000 --- a/templates/Includes/AssetAdmin_EditForm.ss +++ /dev/null @@ -1 +0,0 @@ -<% include Form %> \ No newline at end of file diff --git a/templates/Includes/AssetAdmin_EditFormTools.ss b/templates/Includes/AssetAdmin_Tools.ss similarity index 100% rename from templates/Includes/AssetAdmin_EditFormTools.ss rename to templates/Includes/AssetAdmin_Tools.ss diff --git a/templates/Includes/CMSFileAddController_Content.ss b/templates/Includes/CMSFileAddController_Content.ss deleted file mode 100644 index 29a6dbf6..00000000 --- a/templates/Includes/CMSFileAddController_Content.ss +++ /dev/null @@ -1,37 +0,0 @@ -<% with EditForm %> -
- -
-
-

<% _t('CMSAddPageController.Title','Add pages') %>

-
-
- -
- - <% if Message %> -

$Message

- <% else %> - - <% end_if %> - -
- <% if Legend %>$Legend<% end_if %> - <% control Fields %> - $FieldHolder - <% end_control %> -
-
- -
- <% if Actions %> -
- <% control Actions %> - $Field - <% end_control %> -
- <% end_if %> -
- -
-<% end_with %>