mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Further updates for 3.1 compatibility.
This commit is contained in:
parent
cad9042d5f
commit
1b6c76b405
@ -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
13
_config/dmsdocument.yml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
Name: dmsdocument
|
||||
After: framework/routes#coreroutes
|
||||
---
|
||||
Director:
|
||||
rules:
|
||||
'dmsdocument/$ID' : 'DMSDocument_Controller'
|
||||
SiteTree:
|
||||
extensions:
|
||||
- DMSSiteTreeExtension
|
||||
HtmlEditorField_Toolbar:
|
||||
extensions:
|
||||
- DocumentHtmlEditorFieldToolbar
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
Name: dmsdocument
|
||||
After: framework/routes#coreroutes
|
||||
---
|
||||
Director:
|
||||
rules:
|
||||
'dmsdocument/$ID' : 'DMSDocument_Controller'
|
@ -70,7 +70,10 @@ class DMSSiteTreeExtension extends DataExtension {
|
||||
|
||||
if(class_exists('GridFieldSortableRows')) {
|
||||
$sortableComponent = new GridFieldSortableRows('DocumentSort');
|
||||
$sortableComponent->setUsePagination(false)->setForceRedraw(true);
|
||||
//setUsePagenation method removed from newer version of SortableGridField.
|
||||
if(method_exists($sortableComponent,'setUsePagination')){
|
||||
$sortableComponent->setUsePagination(false)->setForceRedraw(true);
|
||||
}
|
||||
$gridFieldConfig->addComponent($sortableComponent);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user