Skip to content

Commit

Permalink
MINOR Metadata for GridField and Folder->getCMSFields() to allow open…
Browse files Browse the repository at this point in the history
…ing folder references in the UI
  • Loading branch information
chillu committed Feb 23, 2012
1 parent 6e6fdaf commit cbc2891
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions filesystem/Folder.php
Expand Up @@ -441,6 +441,10 @@ function getCMSFields() {
$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");

Expand Down
4 changes: 3 additions & 1 deletion forms/gridfield/GridField.php
Expand Up @@ -335,7 +335,9 @@ public function FieldHolder() {
'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
);
Expand Down

0 comments on commit cbc2891

Please sign in to comment.