/** * Führt vor dem parsen Änderungen am Model durch. * * @param Tx_Rnbase_Domain_Model_DataInterface $item * @param tx_rnbase_configurations &$configurations * @param string &$confId * @return void */ protected function prepareItem(Tx_Rnbase_Domain_Model_DataInterface $item, tx_rnbase_configurations $configurations, $confId) { if ($item->isEmpty()) { return; } $dotFieldFields = $configurations->getExploded($confId . 'dataMap.dotFieldFields'); $dotValueFields = $configurations->getExploded($confId . 'dataMap.dotValueFields'); $mapFields = array_merge($dotFieldFields, $dotValueFields); if (empty($mapFields)) { return; } // wir gehen über alle felder, und ersetzen ggf. enthaltene punkte // durch einen unterstrich. Dies ist für den Zugriff über Typoscript notwendig! // das gleiche machen wir für kleine werte, diese werden beispielsweise für // ein CASE im TS benötigt foreach ($mapFields as $field) { $newField = '_' . str_replace('.', '_', $field); $value = $item->getProperty($field); if (in_array($field, $dotFieldFields)) { $item->setProperty($newField, $value); } if (in_array($field, $dotValueFields)) { $item->setProperty($newField, str_replace('.', '_', $value)); } } }
/** * render plugin data and additional flexdata * * @param string $templateCode * @param tx_rnbase_configurations $configurations * @return string */ protected function renderPluginData($templateCode, tx_rnbase_configurations $configurations) { // render only, if there is an controller if (!$this->getController()) { return $templateCode; } // check, if there are plugin markers to render if (!tx_rnbase_util_BaseMarker::containsMarker($templateCode, 'PLUGIN_')) { return $templateCode; } $confId = $this->getController()->getConfId(); $markerArray = array(); // build the data to render $pluginData = array_merge((array) $configurations->getCObj()->data, $configurations->getExploded($confId . 'plugin.flexdata.')); // check for unused columns $ignoreColumns = tx_rnbase_util_BaseMarker::findUnusedCols($pluginData, $templateCode, 'PLUGIN'); // create the marker array with the parsed columns $markerArray = $configurations->getFormatter()->getItemMarkerArrayWrapped($pluginData, $confId . 'plugin.', $ignoreColumns, 'PLUGIN_'); return tx_rnbase_util_BaseMarker::substituteMarkerArrayCached($templateCode, $markerArray); }