function main($content, $conf) { $this->conf = $conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); $sConfPath = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'tspath')); require_once PATH_formidableapi; if ($sConfPath !== "") { $aCurZone =& $GLOBALS["TSFE"]->tmpl->setup; $aPath = explode(".", $sConfPath); reset($aPath); while (list(, $sSegment) = each($aPath)) { if (array_key_exists($sSegment . ".", $aCurZone)) { $aCurZone =& $aCurZone[$sSegment . "."]; } else { return "<strong>Formidable: TS path not found in template</strong>"; } } $this->aFormConf = $aCurZone; } else { $sConfPath = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'xmlpath')); if ($sConfPath !== "") { $this->sXmlPath = tx_ameosformidable::toServerPath($sConfPath); } else { if (array_key_exists("xmlpath", $this->conf)) { $this->sXmlPath = tx_ameosformidable::toServerPath($this->conf["xmlpath"]); } else { return "<strong>Formidable: TS or XML pathes not defined</strong>"; } } } return TRUE; }
function div_arrayToCsvFile($aData, $sFilePath = FALSE, $sFSep = ";", $sLSep = "\r\n", $sStringWrap = "\"") { if ($sFilePath === FALSE) { $sFilePath = t3lib_div::tempnam("csv-" . strftime("%Y.%m.%d-%Hh%Mm%Ss" . "-")) . ".csv"; } else { $sFilePath = tx_ameosformidable::toServerPath($sFilePath); } tx_ameosformidable::file_writeBin($sFilePath, tx_ameosformidable::div_arrayToCsvString($aData, $sFSep, $sLSep, $sStringWrap), FALSE); return $sFilePath; }