mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
ENHANCEMENT: Show number of documents on a page in dropdown
This commit is contained in:
parent
3af703fa9a
commit
a6f8b83e1a
@ -76,4 +76,8 @@ class DMSSiteTreeExtension extends DataExtension {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getTitleWithNumberOfDocuments() {
|
||||
return $this->owner->Title . ' (' . $this->owner->Documents()->Count() . ')';
|
||||
}
|
||||
}
|
@ -4,8 +4,8 @@ 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'));
|
||||
|
||||
parent::__construct(new TreeDropdownField('PageSelector', 'Add from another page', 'SiteTree', 'ID', 'TitleWithNumberOfDocuments'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user