Th mailformplus
From TYPO3Wiki
This is just a short snippet allowing to verify a user input via regular expressions in the extension <extension3>th_mailformplus</extension3>.
You have to add the following code in typo3conf/ext/th_mailformplus/pi1/class.tx_thmailformplus_pi1.php <PHP> function check_form($content,$conf) { [...] foreach ($this->get_post as $key => $value) {
if (isset($conf["check."][$key])) {
if (!preg_match(
"/".str_replace("/","\/",$conf["check."][$key])."/",
$value)) {
$temp = $GLOBALS["TSFE"]->cObj->getSubpart(
$this->templateCode_error, 'ERROR_'.$key);
if ($temp) {
$error .= $temp;
$this->errors['###error_'.$key.'###'] =
$temp;
} else {
$error .= "- file uploads!
- if a file upload directory is specified in TypoScript
- filename: [pageID]_[newRecordID].[filetype]
[edit] Prefilled fields
<TS>
# Example: insert E-Mail-Adress of feuser
# with parameter &userid=#number#
# you can insert the email-Adress into the
# field "email"
plugin.tx_thmailformplus_pi1.fieldConf {
email {
# which user should be selected
defaultValue.dataWrap = {GPvar:userid}|
# take the email of the selected user
defaultValue.wrap3 = {DB:fe_users:|:email}
defaultValue.insertData = 1
}
}
</TS>
[edit] Using Marker
plugin.tx_thmailformplus_pi1 {
# using single marker via ###required### in Template
markers.required = TEXT
markers.required.value = *
markers.required.noTrimWrap = | | |
# using SUBPART via ###FORM### in Template with additional Template:
###TEMPLATE_FORM###
Hello World - this snippet will be included
###TEMPLATE_FORM###
markers.FORM = SUBPART
markers.FORM.value = ###TEMPLATE_FORM###
}
maholtz 13:10, 4 April 2008 (CEST)
