mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
APICHANGE: rename filenameWithoutID() to getFilenameWithoutID() so that FilenameWithoutID could be used as a data object 'field' and could be used in a grid field of DMSDocument
This commit is contained in:
parent
66dd7e9394
commit
f361cab459
@ -16,7 +16,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
static $display_fields = array(
|
||||
'ID'=>'ID',
|
||||
'Title'=>'Title',
|
||||
'Filename'=>'Filename',
|
||||
'FilenameWithoutID'=>'Filename',
|
||||
'LastChanged'=>'LastChanged'
|
||||
);
|
||||
|
||||
@ -406,7 +406,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
return isset($types[$ext]) ? $types[$ext] : $ext;
|
||||
}
|
||||
|
||||
function filenameWithoutID() {
|
||||
function getFilenameWithoutID() {
|
||||
$filenameParts = explode('~',$this->Filename);
|
||||
$filename = array_pop($filenameParts);
|
||||
return $filename;
|
||||
@ -508,7 +508,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
$urlField = new ReadonlyField('ClickableURL', _t('AssetTableField.URL','URL'),
|
||||
sprintf('<a href="%s" target="_blank" class="file-url">%s</a>', $this->downloadLink(), $this->downloadLink())
|
||||
),
|
||||
new ReadonlyField("FilenameWithoutIDField", "Filename". ':', $this->filenameWithoutID()),
|
||||
new ReadonlyField("FilenameWithoutIDField", "Filename". ':', $this->getFilenameWithoutID()),
|
||||
new DateField_Disabled("Created", _t('AssetTableField.CREATED','First uploaded') . ':', $this->Created),
|
||||
new DateField_Disabled("LastEdited", _t('AssetTableField.LASTEDIT','Last changed') . ':', $this->LastEdited),
|
||||
new DateField_Disabled("LastChanged", _t('AssetTableField.LASTCHANGED','Last replaced') . ':', $this->LastChanged),
|
||||
|
Loading…
Reference in New Issue
Block a user