mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 12:05:56 +00:00
ENHANCEMENT: Add treedropdown to select page when adding a document
This commit is contained in:
parent
b6a728dc0e
commit
3af703fa9a
@ -1,6 +1,13 @@
|
||||
<?php
|
||||
|
||||
class DMSDocumentAddExistingField extends FormField {
|
||||
class DMSDocumentAddExistingField extends CompositeField {
|
||||
function __construct($name, $title = null) {
|
||||
$this->name = $name;
|
||||
$this->title = ($title === null) ? $name : $title;
|
||||
|
||||
parent::__construct(new TreeDropdownField('PageSelector', 'Add from another page', 'SiteTree'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Force a record to be used as "Parent" for uploaded Files (eg a Page with a has_one to File)
|
||||
* @param DataObject $record
|
||||
|
@ -9,6 +9,9 @@
|
||||
</h3>
|
||||
|
||||
<input class="document-autocomplete text" type="text" placeholder="Search by ID or filename" />
|
||||
<span>or Add from page</span>
|
||||
$fieldByName(PageSelector)
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ss-assetuploadfield">
|
||||
|
Loading…
x
Reference in New Issue
Block a user