Skip to content

Commit

Permalink
Pass column name to snippet renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
theboxer committed Jan 6, 2016
1 parent e6b3c57 commit 4a8036f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/components/collections/docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Changelog for Collections.

Collections 3.4.0
===================
- Pass column name to snippet renderer
- Prevent permanent sort breaking D&D sort
- Add Collections.renderer.buttons renderer
- Allow snippet renderer on non-existing column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function prepareRowWithRenderer(xPDOObject $object) {

foreach ($this->columnRenderer as $field => $snippet) {
$value = isset($resourceArray[$field]) ? $resourceArray[$field] : null;
$resourceArray[$field] = $this->modx->runSnippet($snippet, array('value' => $value, 'row' => $resourceArray, 'input' => $value));
$resourceArray[$field] = $this->modx->runSnippet($snippet, array('value' => $value, 'row' => $resourceArray, 'input' => $value, 'column' => $field));
}

$resourceArray = $this->prepareSupportFields($resourceArray);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function prepareRowWithRenderer(xPDOObject $object) {

foreach ($this->columnRenderer as $field => $snippet) {
$value = isset($resourceArray[$field]) ? $resourceArray[$field] : null;
$resourceArray[$field] = $this->modx->runSnippet($snippet, array('value' => $value, 'row' => $resourceArray, 'input' => $value));
$resourceArray[$field] = $this->modx->runSnippet($snippet, array('value' => $value, 'row' => $resourceArray, 'input' => $value, 'column' => $field));
}

$resourceArray = $this->prepareSupportFields($resourceArray);
Expand Down

0 comments on commit 4a8036f

Please sign in to comment.