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:
Normann Lou 2012-08-01 10:51:41 +12:00
parent 66dd7e9394
commit f361cab459

View File

@ -16,7 +16,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
static $display_fields = array( static $display_fields = array(
'ID'=>'ID', 'ID'=>'ID',
'Title'=>'Title', 'Title'=>'Title',
'Filename'=>'Filename', 'FilenameWithoutID'=>'Filename',
'LastChanged'=>'LastChanged' 'LastChanged'=>'LastChanged'
); );
@ -406,7 +406,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
return isset($types[$ext]) ? $types[$ext] : $ext; return isset($types[$ext]) ? $types[$ext] : $ext;
} }
function filenameWithoutID() { function getFilenameWithoutID() {
$filenameParts = explode('~',$this->Filename); $filenameParts = explode('~',$this->Filename);
$filename = array_pop($filenameParts); $filename = array_pop($filenameParts);
return $filename; return $filename;
@ -508,7 +508,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
$urlField = new ReadonlyField('ClickableURL', _t('AssetTableField.URL','URL'), $urlField = new ReadonlyField('ClickableURL', _t('AssetTableField.URL','URL'),
sprintf('<a href="%s" target="_blank" class="file-url">%s</a>', $this->downloadLink(), $this->downloadLink()) 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("Created", _t('AssetTableField.CREATED','First uploaded') . ':', $this->Created),
new DateField_Disabled("LastEdited", _t('AssetTableField.LASTEDIT','Last changed') . ':', $this->LastEdited), new DateField_Disabled("LastEdited", _t('AssetTableField.LASTEDIT','Last changed') . ':', $this->LastEdited),
new DateField_Disabled("LastChanged", _t('AssetTableField.LASTCHANGED','Last replaced') . ':', $this->LastChanged), new DateField_Disabled("LastChanged", _t('AssetTableField.LASTCHANGED','Last replaced') . ':', $this->LastChanged),