From d509e23f8abecaa27bcc657d02ac7b6b68c47cb1 Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Mon, 25 Jan 2016 10:57:09 +0100 Subject: [PATCH] Update to 2.0.6 - Snippet: All snippet properties are available as placeholders in the snippet chunks --- HISTORY.md | 3 +++ assets/tvs/multitv/includes/multitv.class.php | 2 ++ assets/tvs/multitv/multitv.snippet.php | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index bfb2e87..2a4a579 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,8 @@ History ================================================================================ +- 2.0.6 January 25, 2016 + - Snippet: All snippet properties are available as placeholders in the snippet chunks + - 2.0.5 August 24, 2015 - CustomTV: Bugfix for select dropdowns in Firefox diff --git a/assets/tvs/multitv/includes/multitv.class.php b/assets/tvs/multitv/includes/multitv.class.php index c165c39..2c08561 100644 --- a/assets/tvs/multitv/includes/multitv.class.php +++ b/assets/tvs/multitv/includes/multitv.class.php @@ -1069,6 +1069,7 @@ function displayMultiValue($tvOutput, $params) $classes[] = $params['evenClass']; } $parser = new newChunkie($this->modx); + $parser->setPlaceholders($params); foreach ($value as $key => $fieldvalue) { $fieldname = (is_int($key)) ? $this->fieldnames[$key] : $key; $parser->setPlaceholder($fieldname, $fieldvalue); @@ -1098,6 +1099,7 @@ function displayMultiValue($tvOutput, $params) if (!$params['toJson']) { // wrap rowTpl output in outerTpl $parser = new newChunkie($this->modx); + $parser->setPlaceholders($params); $parser->setPlaceholder('wrapper', implode($params['outputSeparator'], $wrapper)); $parser->setPlaceholder('rows', array('offset' => $params['offset'], 'total' => $countOutput)); $parser->setPlaceholder('docid', $params['docid']); diff --git a/assets/tvs/multitv/multitv.snippet.php b/assets/tvs/multitv/multitv.snippet.php index 6b9f50a..58f9bc5 100644 --- a/assets/tvs/multitv/multitv.snippet.php +++ b/assets/tvs/multitv/multitv.snippet.php @@ -55,7 +55,7 @@ $templates = $multiTV->templates; // get snippet parameter -$params = array(); +$params = &$modx->event->params; $params['docid'] = (isset($docid)) ? $docid : $modx->documentObject['id']; $params['outerTpl'] = (isset($outerTpl)) ? $outerTpl : (isset($templates['outerTpl']) ? '@CODE:' . $templates['outerTpl'] : '@CODE:'); $params['emptyOutput'] = (isset($emptyOutput) && !$emptyOutput) ? false : true;