diff --git a/_config.php b/_config.php index 76782128..ddd1629b 100644 --- a/_config.php +++ b/_config.php @@ -9,6 +9,7 @@ Director::addRules(50, array( '' => 'RootURLController', 'admin/bulkload//$Action/$ID/$OtherID' => 'BulkLoaderAdmin', 'admin/cms//$Action/$ID/$OtherID' => 'CMSMain', + 'admin/asset//$Action/$ID/$OtherID' => 'AssetAdmin', 'dev/buildcache/$Action' => 'RebuildStaticCacheTask', )); @@ -35,4 +36,5 @@ CMSMenu::remove_menu_item('CMSPageEditController'); CMSMenu::remove_menu_item('CMSPageSettingsController'); CMSMenu::remove_menu_item('CMSPageHistoryController'); CMSMenu::remove_menu_item('CMSPageReportsController'); -CMSMenu::remove_menu_item('CMSPageAddController'); \ No newline at end of file +CMSMenu::remove_menu_item('CMSPageAddController'); +CMSMenu::remove_menu_item('CMSFileAddController'); \ No newline at end of file diff --git a/code/controllers/CMSFileAddController.php b/code/controllers/CMSFileAddController.php new file mode 100644 index 00000000..06cc9687 --- /dev/null +++ b/code/controllers/CMSFileAddController.php @@ -0,0 +1,35 @@ +getUploadIframe()) + ), + new FieldList( + ) + ); + $form->addExtraClass('cms-content center cms-edit-form ' . $this->BaseCSSClasses()); + $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); + return $form; + } + + + /** + * Display the upload form. Returns an iframe tag that will show admin/assets/uploadiframe. + */ + function getUploadIframe() { + return << + +HTML; + } + +} \ No newline at end of file diff --git a/templates/Includes/CMSFileAddController_Content.ss b/templates/Includes/CMSFileAddController_Content.ss new file mode 100644 index 00000000..29a6dbf6 --- /dev/null +++ b/templates/Includes/CMSFileAddController_Content.ss @@ -0,0 +1,37 @@ +<% with EditForm %> +
+<% end_with %>