From f361cab4592f6bea1145c6a69a1ef67bff1feae0 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Wed, 1 Aug 2012 10:51:41 +1200 Subject: [PATCH] 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 --- code/DMSDocument.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/DMSDocument.php b/code/DMSDocument.php index c63eac1..6c0a803 100644 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -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('%s', $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),