Project

General

Profile

Feature #16289 » 6040.patch

Administrator Admin, 2007-07-27 17:08

View differences:

typo3_src-4.1.2/typo3/sysext/cms/tslib/class.tslib_content.php 2007-07-27 16:37:53.000000000 +0200
$fieldCode=sprintf('<input type="checkbox" value="%s" name="%s"%s%s%s />',
1, $confData['fieldname'], $elementIdAttribute, $checked, $addParams);
break;
case 'checkboxes':
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) {$default=$subParts[1];} // Sets the default value if value/label pair is marked as default.
}
// 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]);
......
if ($confData['type']=='label' && $conf['LABEL.']['layout']) {
$result = $conf['LABEL.']['layout'];
}
if ($confData['type']=='checkboxes' && $conf['CHECKBOXES.']['layout']) {
$result = $conf['CHECKBOXES.']['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_src-4.1.2/typo3/sysext/css_styled_content/static/setup.txt 2007-07-27 16:39:49.000000000 +0200
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 = |
typo3_src-4.1.2/typo3/sysext/lang/locallang_wizards.xml 2007-07-27 16:28:52.000000000 +0200
<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_src-4.1.2/typo3/wizard_forms.php 2007-07-27 16:27:33.000000000 +0200
// 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>';
......
$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:
(1-1/7)