mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-09-27 20:06:38 +02: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
|
<?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)
|
* Force a record to be used as "Parent" for uploaded Files (eg a Page with a has_one to File)
|
||||||
* @param DataObject $record
|
* @param DataObject $record
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<input class="document-autocomplete text" type="text" placeholder="Search by ID or filename" />
|
<input class="document-autocomplete text" type="text" placeholder="Search by ID or filename" />
|
||||||
|
<span>or Add from page</span>
|
||||||
|
$fieldByName(PageSelector)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ss-assetuploadfield">
|
<div class="ss-assetuploadfield">
|
||||||
|
Loading…
Reference in New Issue
Block a user