Further updates for 3.1 compatibility.

This commit is contained in:
Cam Findlay 2013-04-15 14:03:58 +12:00
parent cad9042d5f
commit 1b6c76b405
5 changed files with 18 additions and 11 deletions

View File

@ -11,8 +11,6 @@ define('DMS_DIR', 'dms');
if (!file_exists(BASE_PATH . DIRECTORY_SEPARATOR . DMS_DIR)) user_error("DMS directory named incorrectly. Please install the DMS module into a folder named: ".DMS_DIR);
Object::add_extension('SiteTree','DMSSiteTreeExtension');
Object::add_extension('HtmlEditorField_Toolbar','DocumentHtmlEditorFieldToolbar');
CMSMenu::remove_menu_item('DMSDocumentAddController');
ShortcodeParser::get('default')->register('dms_document_link', array('DMSDocument_Controller', 'dms_link_shortcode_handler'));

13
_config/dmsdocument.yml Normal file
View File

@ -0,0 +1,13 @@
---
Name: dmsdocument
After: framework/routes#coreroutes
---
Director:
rules:
'dmsdocument/$ID' : 'DMSDocument_Controller'
SiteTree:
extensions:
- DMSSiteTreeExtension
HtmlEditorField_Toolbar:
extensions:
- DocumentHtmlEditorFieldToolbar

View File

@ -1,7 +0,0 @@
---
Name: dmsdocument
After: framework/routes#coreroutes
---
Director:
rules:
'dmsdocument/$ID' : 'DMSDocument_Controller'

View File

@ -70,7 +70,10 @@ class DMSSiteTreeExtension extends DataExtension {
if(class_exists('GridFieldSortableRows')) {
$sortableComponent = new GridFieldSortableRows('DocumentSort');
//setUsePagenation method removed from newer version of SortableGridField.
if(method_exists($sortableComponent,'setUsePagination')){
$sortableComponent->setUsePagination(false)->setForceRedraw(true);
}
$gridFieldConfig->addComponent($sortableComponent);
}

View File

@ -71,7 +71,7 @@ class DMSDocumentAddController extends LeftAndMain {
$uploadField->setTemplate('AssetUploadField');
$uploadField->setRecord($page);
$uploadField->getValidator()->setAllowedExtensions(array_filter(array_merge(File::$allowed_extensions,self::$allowed_extensions)));
$uploadField->getValidator()->setAllowedExtensions(array_filter(array_merge(Config::inst()->get('File', 'allowed_extensions'),self::$allowed_extensions)));
$exts = $uploadField->getValidator()->getAllowedExtensions();
asort($exts);