Project

General

Profile

Feature #16289 » 6040_trunk_4.3_cleaned.patch

Administrator Admin, 2008-11-01 12:00

View differences:

typo3/wizard_forms.php (working copy)
// Special parts:
if ($this->special=='formtype_mail' && t3lib_div::inList('formtype_mail,subject,html_enabled',$confData['fieldname'])) {
$specParts[$confData['fieldname']] = $confData['default'];
if ($confData['fieldname']=='formtype_mail' && $confData['type'] == 'submit') {
$specParts[$confData['fieldname'].'_submit'] = $confData['default'];
} elseif ($confData['fieldname']=='formtype_mail' && $confData['type'] == 'reset') {
$specParts[$confData['fieldname'].'_reset'] = $confData['default'];
} else {
$specParts[$confData['fieldname']] = $confData['default'];
}
} else {
// Render title/field preview COLUMN
......
// Field type selector:
$opt=array();
$opt[]='<option value=""></option>';
$types = explode(',','input,textarea,select,check,radio,password,file,hidden,submit,property,label');
$types = explode(',','input,textarea,select,check,checkboxes,radio,password,file,hidden,submit,property,label');
foreach($types as $t) {
$opt[]='
<option value="'.$t.'"'.($confData['type']==$t?' selected="selected"':'').'>'.$LANG->getLL('forms_type_'.$t,1).'</option>';
......
}
// Default data
if ($confData['type']=='select' || $confData['type']=='radio') {
if ($confData['type']=='select' || $confData['type']=='radio' || $confData['type']=='checkboxes') {
$temp_cells[$LANG->getLL('forms_options')]='<textarea '.$this->doc->formWidthText(15).' rows="4" name="FORMCFG[c]['.(($k+1)*2).'][options]" title="'.$LANG->getLL('forms_options',1).'">'.t3lib_div::formatForTextarea($confData['default']).'</textarea>';
} elseif ($confData['type']=='check') {
$temp_cells[$LANG->getLL('forms_checked')]='<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][default]" value="1"'.(trim($confData['default'])?' checked="checked"':'').' title="'.$LANG->getLL('forms_checked',1).'" />';
......
<td>
<input type="hidden" name="FORMCFG[c]['.(1000*2).'][fieldname]" value="formtype_mail" />
<input type="hidden" name="FORMCFG[c]['.(1000*2).'][type]" value="submit" />
<input type="text"'.$this->doc->formWidth(15).' name="FORMCFG[c]['.(1000*2).'][default]" value="'.htmlspecialchars($specParts['formtype_mail']).'" />
<input type="text"'.$this->doc->formWidth(15).' name="FORMCFG[c]['.(1000*2).'][default]" value="'.htmlspecialchars($specParts['formtype_mail_submit']).'" />
</td>
</tr>';
$tRows[]='
<tr class="bgColor5">
<td>&nbsp;</td>
<td class="bgColor4">&nbsp;</td>
<td>'.$LANG->getLL('forms_eform_formtype_reset',1).':</td>
<td>
<input type="hidden" name="FORMCFG[c]['.(2001).'][fieldname]" value="formtype_mail" />
<input type="hidden" name="FORMCFG[c]['.(2001).'][type]" value="reset" />
<input type="text"'.$this->doc->formWidth(15).' name="FORMCFG[c]['.(2001).'][default]" value="'.htmlspecialchars($specParts['formtype_mail_reset']).'" />
</td>
</tr>';
// "Send HTML mail":
$tRows[]='
......
$thisLine[1]=str_replace('|','',$thisLine[1]);
// Default:
if ($vv['type']=='select' || $vv['type']=='radio') {
if ($vv['type']=='select' || $vv['type']=='radio' || $vv['type']=='checkboxes') {
$thisLine[2]=str_replace(chr(10),', ',str_replace(',','',$vv['options']));
} elseif ($vv['type']=='check') {
if ($vv['default']) $thisLine[2]=1;
......
switch((string)$confData['type']) {
case 'select':
case 'radio':
case 'checkboxes':
$confData['default'] = implode(chr(10),t3lib_div::trimExplode(',',$parts[2]));
break;
default:
typo3/sysext/lang/locallang_wizards.xml (working copy)
<label index="forms_type_password">Password field</label>
<label index="forms_type_file">File upload</label>
<label index="forms_type_check">Check box</label>
<label index="forms_type_checkboxes">Multiple Checkboxes</label>
<label index="forms_type_select">Selector box</label>
<label index="forms_type_radio">Radio buttons</label>
<label index="forms_type_hidden">Hidden value</label>
......
<label index="forms_eform_recipient">Recipient email</label>
<label index="forms_eform_html_enabled">HTML mode enabled</label>
<label index="forms_eform_formtype_mail">Send button label</label>
<label index="forms_eform_formtype_reset">Reset button label</label>
<label index="forms_special_eform">Special configuration for mail forms</label>
<label index="colorpicker_title">Color Picker</label>
<label index="colorpicker_setClose">Save and Close</label>
typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
// Accessibility: Set id = fieldname attribute:
if ($conf['accessibility'] || $xhtmlStrict) {
$elementIdAttribute = ' id="'.$prefix.$fName.'"';
$elementIdAttribute = ' id="'.$prefix.$fName.'_'.$cc.'"';
} else {
$elementIdAttribute = '';
}
......
$fieldCode=sprintf('<input type="checkbox" value="%s" name="%s"%s%s%s />',
1, $confData['fieldname'], $elementIdAttribute, $checked, $addParams);
break;
case 'checkboxes':
$option='';
if ($conf['accessibility']) {
$option.='<fieldset'.$elementIdAttribute.'><legend>'.$confData['label'].'</legend>';
}
$valueParts = explode(',',$parts[2]);
$items=array(); // Where the items will be
$default='';
$pCount = count($valueParts);
for($a=0;$a<$pCount;$a++) {
$valueParts[$a]=trim($valueParts[$a]);
if (substr($valueParts[$a],0,1)=='*') {
$sel='checked';
$valueParts[$a] = substr($valueParts[$a],1);
} else {
sel='';
}
// Get value/label
$subParts=explode('=',$valueParts[$a]);
$subParts[1] = (isset($subParts[1])?trim($subParts[1]):trim($subParts[0])); // Sets the value
$items[] = $subParts; // Adds the value/label pair to the items-array
if ($sel) {
// Sets the default value if value/label pair is marked as default.
$default=$subParts[1];
}
}
// alternative default value:
$default = $this->getFieldDefaultValue($conf['noValueInsert'], $confData['fieldname'], $default);
// Create the checkboxes:
$iCount = count($items);
for($a=0;$a<$iCount;$a++) {
$checkboxesId = $prefix.$fName.$this->cleanFormName($items[$a][0]);
if ($conf['accessibility']) {
$checkboxesLabelIdAttribute = ' id="'.$checkboxesId.'"';
} else {
$checkboxesLabelIdAttribute = '';
}
$option .= '<input type="checkbox" name="'.$confData['fieldname'].'['.$a.']"'.$checkboxesLabelIdAttribute.' value="'.$items[$a][1].'"'.(!strcmp($items[$a][1],$default)?' checked="checked"':'').$addParams.' />';
if ($conf['accessibility']) {
$option .= '<label for="'.$checkboxesId.'">' . $this->stdWrap(trim($items[$a][0]), $conf['checkboxesWrap.']) . '</label>';
} else {
$option .= $this->stdWrap(trim($items[$a][0]), $conf['checkboxesWrap.']);
}
}
if ($conf['accessibility']) {
$option.='</fieldset>';
}
$fieldCode = $option;
break;
case 'select':
$option='';
$valueParts = explode(',',$parts[2]);
......
$image = '';
}
if ($image) {
$fieldCode=sprintf('<input type="image" name="%s"%s src="%s"%s />',
$confData['fieldname'], $elementIdAttribute, $image, $params);
$fieldCode=sprintf('<input type="image" name="%s" src="%s"%s />',
$confData['fieldname'], $image, $params);
} else {
$fieldCode=sprintf('<input type="submit" name="%s"%s value="%s"%s />',
$confData['fieldname'], $elementIdAttribute, t3lib_div::deHSCentities(htmlspecialchars($value)), $addParams);
$fieldCode=sprintf('<input type="submit" name="%s" value="%s"%s />',
$confData['fieldname'], t3lib_div::deHSCentities(htmlspecialchars($value)), $addParams);
}
break;
case 'reset':
$value=trim($parts[2]);
$fieldCode=sprintf('<input type="reset" name="%s"%s value="%s"%s />',
$confData['fieldname'], $elementIdAttribute, t3lib_div::deHSCentities(htmlspecialchars($value)), $addParams);
if ($conf['image_reset.']) {
$this->data[$this->currentValKey] = $value;
$image = $this->IMG_RESOURCE($conf['image_reset.']);
$params = $conf['image_reset.']['params'] ? ' '.$conf['image_reset.']['params'] : '';
$params.= $this->getAltParam($conf['image_reset.'], false);
$params.= $addParams;
} else {
$image = '';
}
if ($image) {
$fieldCode=sprintf('<a href="javascript:document.'.$formname.'.reset()" title="%s"><img name="%s" alt="%s" src="%s"%s /></a>',
t3lib_div::deHSCentities(htmlspecialchars($value)), $confData['fieldname'], t3lib_div::deHSCentities(htmlspecialchars($value)), $image, $params);
} else {
$fieldCode=sprintf('<input type="reset" name="%s" value="%s"%s />',
$confData['fieldname'], t3lib_div::deHSCentities(htmlspecialchars($value)), $addParams);
}
break;
case 'label':
$fieldCode = nl2br(htmlspecialchars(trim($parts[2])));
......
// Field:
$fieldLabel = $confData['label'];
if ($conf['accessibility'] && trim($fieldLabel) && !preg_match('/^(label|hidden|comment)$/',$confData['type'])) {
$fieldLabel = '<label for="'.$prefix.$fName.'">'.$fieldLabel.'</label>';
$fieldLabel = '<label for="'.$prefix.$fName.'_'.$cc.'">'.$fieldLabel.'</label>';
}
// Getting template code:
......
if ($confData['type']=='radio' && $conf['RADIO.']['layout']) {
$result = $conf['RADIO.']['layout'];
}
if ($confData['type']=='checkboxes' && $conf['CHECKBOXES.']['layout']) {
$result = $conf['CHECKBOXES.']['layout'];
}
if ($confData['type']=='label' && $conf['LABEL.']['layout']) {
$result = $conf['LABEL.']['layout'];
}
if ($confData['type']=='submit' && $conf['SUBMIT.']['layout']) {
$result = $conf['SUBMIT.']['layout'];
}
if ($confData['type']=='reset' && $conf['RESET.']['layout']) {
$result = $conf['RESET.']['layout'];
}
$result = str_replace('###FIELD###',$fieldCode,$result);
$result = str_replace('###LABEL###',$labelCode,$result);
$result = str_replace('###COMMENT###',$commentCode,$result); //RTF
typo3/sysext/css_styled_content/static/setup.txt (working copy)
layout = <div class="csc-mailform-field">###LABEL### ###FIELD###</div>
COMMENT.layout = <div class="csc-mailform-label">###LABEL###</div>
RADIO.layout = <div class="csc-mailform-field">###LABEL### <span class="csc-mailform-radio">###FIELD###</span></div>
CHECKBOXES.layout = <div class="csc-mailform-field">###LABEL### <span class="csc-mailform-checkboxes">###FIELD###</span></div>
LABEL.layout = <div class="csc-mailform-field">###LABEL### <span class="csc-mailform-label">###FIELD###</span></div>
labelWrap.wrap = |
commentWrap.wrap = |
(4-4/7)