Feature #15081 » formevals-ingmar-v3.patch
t3lib/class.t3lib_tceforms.php 22 Jan 2006 19:56:51 -0000 | ||
---|---|---|
$item.='<input type="hidden" name="'.$PA['itemFormElName'].'" value="'.htmlspecialchars($PA['itemFormElValue']).'" />'; // This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database.
|
||
$this->extJSCODE.='typo3FormFieldSet('.$paramsList.');';
|
||
|
||
// going through all custom evaluations configured for this field
|
||
foreach ($evalList as $evalData) {
|
||
if (substr($evalData, 0, 3) == 'tx_') {
|
||
$evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$evalData].':&'.$evalData);
|
||
if(is_object($evalObj) && method_exists($evalObj, 'returnFieldJS')) {
|
||
$this->extJSCODE .= "\n\nfunction ".$evalData."(value) {\n".$evalObj->returnFieldJS($funcName)."\n}\n";
|
||
}
|
||
}
|
||
}
|
||
|
||
// Creating an alternative item without the JavaScript handlers.
|
||
$altItem = '<input type="hidden" name="'.$PA['itemFormElName'].'_hr" value="" />';
|
||
$altItem.= '<input type="hidden" name="'.$PA['itemFormElName'].'" value="'.htmlspecialchars($PA['itemFormElValue']).'" />';
|
t3lib/class.t3lib_tcemain.php 22 Jan 2006 17:24:13 -0000 | ||
---|---|---|
case 'alphanum_x':
|
||
$value = ereg_replace('[^a-zA-Z0-9_-]','',$value);
|
||
break;
|
||
default:
|
||
if (substr($func, 0, 3) == 'tx_') {
|
||
$evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func].':&'.$func);
|
||
if(is_object($evalObj) && method_exists($evalObj, 'evaluateFieldValue')) {
|
||
$value = $evalObj->evaluateFieldValue($value, $is_in, &$set);
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
if ($set) {$res['value'] = $value;}
|
t3lib/jsfunc.evalfield.js 22 Jan 2006 19:36:42 -0000 | ||
---|---|---|
var theEvalType = (FObj.evallist) ? this.split(evallist, ",", index) : false;
|
||
var newValue=value;
|
||
while (theEvalType) {
|
||
newValue = evalFunc.input(theEvalType, newValue);
|
||
if (theEvalType.slice(0, 3) == 'tx_') {
|
||
if(typeof window[theEvalType] == 'function') {
|
||
newValue = window[theEvalType](newValue); // variable function call, calling functions like tx_myext_myeval(value)
|
||
}
|
||
} else {
|
||
newValue = evalFunc.input(theEvalType, newValue);
|
||
}
|
||
index++;
|
||
theEvalType = this.split(evallist, ",", index);
|
||
}
|