From 27206c9240d97b589e4e682bf2063cbe49d83bdf Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Mon, 7 Nov 2016 13:42:47 +0000 Subject: [PATCH] Revert "Added $showSearchForm to ModelAdmin" --- admin/code/ModelAdmin.php | 19 +++------------- .../templates/Includes/ModelAdmin_Content.ss | 4 +--- admin/templates/Includes/ModelAdmin_Tools.ss | 22 +++++++++---------- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/admin/code/ModelAdmin.php b/admin/code/ModelAdmin.php index 652beb737..2a807059c 100644 --- a/admin/code/ModelAdmin.php +++ b/admin/code/ModelAdmin.php @@ -65,17 +65,10 @@ abstract class ModelAdmin extends LeftAndMain { /** * Change this variable if you don't want the Import from CSV form to appear. * This variable can be a boolean or an array. - * If array, you can list className you want the form to appear on. i.e. array('myClassOne','myClassTwo') + * If array, you can list className you want the form to appear on. i.e. array('myClassOne','myClasstwo') */ public $showImportForm = true; - /** - * Change this variable if you don't want the search form to appear. - * This variable can be a boolean or an array. - * If array, you can list className you want the form to appear on. i.e. array('myClassOne','myClassTwo') - */ - public $showSearchForm = true; - /** * List of all {@link DataObject}s which can be imported through * a subclass of {@link BulkLoader} (mostly CSV data). @@ -189,14 +182,9 @@ abstract class ModelAdmin extends LeftAndMain { } /** - * @return Form|bool + * @return Form */ public function SearchForm() { - if(!$this->showSearchForm || - (is_array($this->showSearchForm) && !in_array($this->modelClass, $this->showSearchForm)) - ) { - return false; - } $context = $this->getSearchContext(); $form = new Form($this, "SearchForm", $context->getSearchFields(), @@ -338,7 +326,7 @@ abstract class ModelAdmin extends LeftAndMain { /** * Generate a CSV import form for a single {@link DataObject} subclass. * - * @return Form|bool + * @return Form */ public function ImportForm() { $modelSNG = singleton($this->modelClass); @@ -414,7 +402,6 @@ abstract class ModelAdmin extends LeftAndMain { * @param array $data * @param Form $form * @param SS_HTTPRequest $request - * @return bool|null */ public function import($data, $form, $request) { if(!$this->showImportForm || (is_array($this->showImportForm) diff --git a/admin/templates/Includes/ModelAdmin_Content.ss b/admin/templates/Includes/ModelAdmin_Content.ss index 6179c0758..1a86d17e9 100644 --- a/admin/templates/Includes/ModelAdmin_Content.ss +++ b/admin/templates/Includes/ModelAdmin_Content.ss @@ -16,9 +16,7 @@
- <% if $SearchForm || $ImportForm %> - - <% end_if %> +