Permalink
Browse files

Updated for SS3

Removed Search Facility - Will be added as a separate module

Signed-off-by: Aram Balakjian <aram@aabweb.co.uk>
  • Loading branch information...
1 parent e49b500 commit 1de092f2cf0cbade77bc153582e86b5da7fe262e Aram Balakjian committed Nov 8, 2012
View
@@ -1,5 +1,14 @@
# DataObjectAsPage Module #
+## Maintainers
+
+ * Aram Balakjian (Nickname: willr, wrossiter)
+ <aram at aabweb dot co dot uk>
+
+## Requirements
+
+ * SilverStripe 3.0
+
## Overview ##
The module provides functionality for displaying DataObjects managed via ModelAdmin to appear as though they were
View
@@ -6,14 +6,20 @@
define('MOD_DOAP_DIR',rtrim(array_pop($folders),DIRECTORY_SEPARATOR));
unset($folders);
+/*
+ * This fixesthe URL segment editor in model admin
+ *
+ * Note this will prevent any URL segment editor buttons from having translations
+ */
+DataObject::add_extension('LeftAndMain', 'DataObjectAsPageLeftAndMain');
-Object::add_extension('SiteTree', 'SiteTreeDoapSearchable');
-Object::add_extension('DataObjectAsPage', 'DoapSearchable');
-Object::add_extension('Page_Controller', 'DoapPage');
+/*
+ * Add this line to your _config.php to enable versioning on your DataObjectAsPage classes.
+ *
+ * Unfortunately this will to apply to all your DOAP classes as it needs to apply to the root DOAP class.
+ *
+ DataObjectAsPage::enable_versioning();
+ *
+ */
-//DataObject::add_extension('File', 'FileDoapSearchable');
-//Sitemap
-Director::addRules(10, array(
- 'search' => 'DoapSearch_Controller'
-));
@@ -1,49 +0,0 @@
-<?php
-
-class DoapSearch_Controller extends Page_Controller
-{
- static $allowed_actions = array(
- 'SearchForm'
- );
-
- function SearchForm()
- {
- $searchText = 'Search';
-
- if($this->request) {
- $searchText = $this->request->getVar('Search');
- }
-
- $fields = new FieldSet(
- $TextField = new TextField('Search')
- );
-
- //Action
- $submit = new FormAction("results", 'Go');
-
- $actions = new FieldSet($submit);
-
- $form = new DoapSearchForm($this, 'SearchForm', $fields, $actions);
- $form->addSearchableClasses(array('DataObjectAsPage'));
-
- if($this->Link())
- {
- $form->setFormAction($this->Link() . 'SearchForm');
- }
-
- return $form;
- }
-
- public function Link()
- {
- return Director::baseURL() . 'search/';
- }
-
-
- public function getSearchQuery($data = null) {
- // legacy usage: $data was defaulting to $_REQUEST, parameter not passed in doc.silverstripe.com tutorials
- $data = $_REQUEST;
-
- return (isset($data['Search'])) ? Convert::raw2xml($data['Search']) : '';
- }
-}
Oops, something went wrong.

0 comments on commit 1de092f

Please sign in to comment.