MINOR Metadata for GridField and Folder->getCMSFields() to allow opening folder references in the UI

This commit is contained in:
Ingo Schommer 2012-02-21 21:16:22 +01:00
parent 6e6fdaf79e
commit cbc2891c80
2 changed files with 7 additions and 1 deletions

View File

@ -441,6 +441,10 @@ class Folder extends File {
$gridField->setFieldFormatting(array(
'Date' => 'Nice'
));
$gridField->setAttribute(
'data-url-folder-template',
Controller::join_links(singleton('AssetAdmin')->Link('show'), '%s')
);
$titleField = ($this->ID && $this->ID != "root") ? new TextField("Title", _t('Folder.TITLE')) : new HiddenField("Title");

View File

@ -335,7 +335,9 @@ class GridField extends FormField {
'tr',
array(
"class" => 'ss-gridfield-item ' . $record->FirstLast() . " " . $record->EvenOdd(),
'data-id' => $record->ID
'data-id' => $record->ID,
// TODO Allow per-row customization similar to GridFieldDefaultColumns
'data-class' => $record->ClassName,
),
$rowContent
);