Public Member Functions | |
| t3lib_TCEforms () | |
| Constructor function, setting internal variables, loading the styles used. | |
| initDefaultBEmode () | |
| Initialize various internal variables. | |
| getSoloField ($table, $row, $theFieldToReturn) | |
| Will return the TCEform element for just a single field from a record. | |
| getMainFields ($table, $row, $depth=0) | |
| Based on the $table and $row of content, this displays the complete TCEform for the record. | |
| getListedFields ($table, $row, $list) | |
| Will return the TCEform elements for a pre-defined list of fields. | |
Public Attributes | |
| $palFieldArr = array() | |
| $disableWizards = 0 | |
| $isPalettedoc = 0 | |
| $paletteMargin = 1 | |
| $defStyle = '' | |
| $cachedTSconfig = array() | |
| $cachedTSconfig_fieldLevel = array() | |
| $transformedRow = array() | |
| $extJSCODE = '' | |
| $printNeededJS = array() | |
| $hiddenFieldAccum = array() | |
| $TBE_EDITOR_fieldChanged_func = '' | |
| $loadMD5_JS = 1 | |
| $prevBorderStyle = '[nothing here...]' | |
| $allowUpload = 0 | |
| $titleLen = 15 | |
| $defaultLanguageData = array() | |
| $defaultLanguageData_diff = array() | |
| $backPath = '' | |
| $returnUrl = '' | |
| $doSaveFieldName = '' | |
| $palettesCollapsed = 0 | |
| $disableRTE = 0 | |
| $globalShowHelp = 1 | |
| $fieldOrder = '' | |
| $doPrintPalette = 1 | |
| $clipObj = FALSE | |
| $enableClickMenu = FALSE | |
| $enableTabMenu = FALSE | |
| $form_rowsToStylewidth = 9.58 | |
| $form_largeComp = 1.33 | |
| $charsPerRow = 40 | |
| $maxTextareaWidth = 48 | |
| $maxInputWidth = 48 | |
| $defaultMultipleSelectorStyle = 'width:250px | |
| data data_files editform icon text< hr/>< hr/>< b > var | $sectionWrap = '' |
| $palFieldTemplateHeader = '' | |
| $palFieldTemplate = '' | |
| $excludeElements = '' | |
| $palettesRendered = array() | |
| $hiddenFieldListArr = array() | |
| $requiredFields = array() | |
| $requiredElements = array() | |
| $renderDepth = 0 | |
| $savedSchemes = array() | |
| $additionalCode_pre = array() | |
| $additionalJS_pre = array() | |
| $additionalJS_post = array() | |
| $additionalJS_submit = array() | |
|
|
Constructor function, setting internal variables, loading the styles used.
Definition at line 294 of file class.t3lib_tceforms.php. 00294 {
00295 global $CLIENT;
00296
00297 $this->clientInfo = t3lib_div::clientInfo();
00298
00299 $this->RTEenabled = $GLOBALS['BE_USER']->isRTE();
00300 if (!$this->RTEenabled) {
00301 $this->RTEenabled_notReasons = implode(chr(10),$GLOBALS['BE_USER']->RTE_errors);
00302 $this->commentMessages[] = 'RTE NOT ENABLED IN SYSTEM due to:'.chr(10).$this->RTEenabled_notReasons;
00303 }
00304
00305 // Default color+class scheme
00306 $this->defColorScheme = array(
00307 $GLOBALS['SOBE']->doc->bgColor, // Background for the field AND palette
00308 t3lib_div::modifyHTMLColorAll($GLOBALS['SOBE']->doc->bgColor,-20), // Background for the field header
00309 t3lib_div::modifyHTMLColorAll($GLOBALS['SOBE']->doc->bgColor,-10), // Background for the palette field header
00310 'black', // Field header font color
00311 '#666666' // Palette field header font color
00312 );
00313 $this->defColorScheme = array();
00314
00315 // Override / Setting defaults from TBE_STYLES array
00316 $this->resetSchemes();
00317
00318 // Setting the current colorScheme to default.
00319 $this->defColorScheme = $this->colorScheme;
00320 $this->defClassScheme = $this->classScheme;
00321 }
|
|
||||||||||||||||
|
Will return the TCEform elements for a pre-defined list of fields. Notice that this will STILL use the configuration found in the list [types][showitem] for those fields which are found there. So ideally the list of fields given as argument to this function should also be in the current [types][showitem] list of the record. Used for displaying forms for the frontend edit icons for instance.
Definition at line 579 of file class.t3lib_tceforms.php. References $out, $TCA, getPaletteFields(), getSingleField(), t3lib_BEfunc::getTCAtypes(), and table(). |
|
||||||||||||||||
|
Based on the $table and $row of content, this displays the complete TCEform for the record. The input-$row is required to be preprocessed if necessary by eg. the t3lib_transferdata class. For instance the RTE content should be transformed through this class first.
Definition at line 412 of file class.t3lib_tceforms.php. References $excludeElements, $TCA, getPaletteFields(), getSingleField(), and table(). 00412 {
00413 global $TCA;
00414
00415 $this->renderDepth=$depth;
00416
00417 // Init vars:
00418 $out_array = array(array());
00419 $out_array_meta = array(array(
00420 'title' => $this->getLL('l_generalTab')
00421 ));
00422
00423 $out_pointer=0;
00424 $out_sheet=0;
00425 $this->palettesRendered=array();
00426 $this->palettesRendered[$this->renderDepth][$table]=array();
00427
00428 if ($TCA[$table]) {
00429
00430 // Load the full TCA for the table.
00431 t3lib_div::loadTCA($table);
00432
00433 // Load the description content for the table.
00434 if ($this->edit_showFieldHelp || $this->doLoadTableDescr($table)) {
00435 $GLOBALS['LANG']->loadSingleTableDescription($table);
00436 }
00437 // Get the current "type" value for the record.
00438 $typeNum = $this->getRTypeNum($table,$row);
00439
00440 // Find the list of fields to display:
00441 if ($TCA[$table]['types'][$typeNum]) {
00442 $itemList = $TCA[$table]['types'][$typeNum]['showitem'];
00443 if ($itemList) { // If such a list existed...
00444
00445 // Explode the field list and possibly rearrange the order of the fields, if configured for
00446 $fields = t3lib_div::trimExplode(',',$itemList,1);
00447 if ($this->fieldOrder) {
00448 $fields = $this->rearrange($fields);
00449 }
00450
00451 // Get excluded fields, added fiels and put it together:
00452 $excludeElements = $this->excludeElements = $this->getExcludeElements($table,$row,$typeNum);
00453 $fields = $this->mergeFieldsWithAddedFields($fields,$this->getFieldsToAdd($table,$row,$typeNum));
00454
00455 // Traverse the fields to render:
00456 $cc=0;
00457 foreach($fields as $fieldInfo) {
00458 // Exploding subparts of the field configuration:
00459 $parts = explode(';',$fieldInfo);
00460
00461 // Getting the style information out:
00462 $color_style_parts = t3lib_div::trimExplode('-',$parts[4]);
00463 if (strcmp($color_style_parts[0],'')) {
00464 $this->setColorScheme($GLOBALS['TBE_STYLES']['colorschemes'][intval($color_style_parts[0])]);
00465 }
00466 if (strcmp($color_style_parts[1],'')) {
00467 $this->fieldStyle = $GLOBALS['TBE_STYLES']['styleschemes'][intval($color_style_parts[1])];
00468 if (!isset($this->fieldStyle)) $this->fieldStyle = $GLOBALS['TBE_STYLES']['styleschemes'][0];
00469 }
00470 if (strcmp($color_style_parts[2],'')) {
00471 $this->wrapBorder($out_array[$out_sheet],$out_pointer);
00472 $this->borderStyle = $GLOBALS['TBE_STYLES']['borderschemes'][intval($color_style_parts[2])];
00473 if (!isset($this->borderStyle)) $this->borderStyle = $GLOBALS['TBE_STYLES']['borderschemes'][0];
00474 }
00475
00476 // Render the field:
00477 $theField = $parts[0];
00478 if (!in_array($theField,$excludeElements)) {
00479 if ($TCA[$table]['columns'][$theField]) {
00480 $sFieldPal='';
00481
00482 if ($parts[2] && !isset($this->palettesRendered[$this->renderDepth][$table][$parts[2]])) {
00483 $sFieldPal=$this->getPaletteFields($table,$row,$parts[2]);
00484 $this->palettesRendered[$this->renderDepth][$table][$parts[2]] = 1;
00485 }
00486 $sField = $this->getSingleField($table,$theField,$row,$parts[1],0,$parts[3],$parts[2]);
00487 if ($sField) $sField.=$sFieldPal;
00488
00489 $out_array[$out_sheet][$out_pointer].= $sField;
00490 } elseif($theField=='--div--') {
00491 if ($cc>0) {
00492 $out_array[$out_sheet][$out_pointer].=$this->getDivider();
00493
00494 if ($this->enableTabMenu && $TCA[$table]['ctrl']['dividers2tabs']) {
00495 $this->wrapBorder($out_array[$out_sheet],$out_pointer);
00496 $out_sheet++;
00497 $out_array[$out_sheet] = array();
00498 $out_array_meta[$out_sheet]['title'] = $this->sL($parts[1]);
00499 }
00500 } else { // Setting alternative title for "General" tab if "--div--" is the very first element.
00501 $out_array_meta[$out_sheet]['title'] = $this->sL($parts[1]);
00502 }
00503 } elseif($theField=='--palette--') {
00504 if ($parts[2] && !isset($this->palettesRendered[$this->renderDepth][$table][$parts[2]])) {
00505 // render a 'header' if not collapsed
00506 if ($TCA[$table]['palettes'][$parts[2]]['canNotCollapse'] AND $parts[1]) {
00507 $out_array[$out_sheet][$out_pointer].=$this->getPaletteFields($table,$row,$parts[2],$this->sL($parts[1]));
00508 } else {
00509 $out_array[$out_sheet][$out_pointer].=$this->getPaletteFields($table,$row,$parts[2],'','',$this->sL($parts[1]));
00510 }
00511 $this->palettesRendered[$this->renderDepth][$table][$parts[2]] = 1;
00512 }
00513 }
00514 }
00515
00516 $cc++;
00517 }
00518 }
00519 }
00520 }
00521
00522 // Wrapping a border around it all:
00523 $this->wrapBorder($out_array[$out_sheet],$out_pointer);
00524
00525 // Resetting styles:
00526 $this->resetSchemes();
00527
00528 // Rendering Main palette, if any
00529 $mP = $TCA[$table]['ctrl']['mainpalette'];
00530 if ($mP && !isset($this->palettesRendered[$this->renderDepth][$table][$mP])) {
00531 $temp_palettesCollapsed=$this->palettesCollapsed;
00532 $this->palettesCollapsed=0;
00533 $out_array[$out_sheet][$out_pointer].=$this->getPaletteFields($table,$row,$mP,$this->getLL('l_generalOptions'));
00534 $this->palettesCollapsed=$temp_palettesCollapsed;
00535 $this->palettesRendered[$this->renderDepth][$table][$mP] = 1;
00536 }
00537 $this->wrapBorder($out_array[$out_sheet],$out_pointer);
00538
00539 if ($this->renderDepth) {
00540 $this->renderDepth--;
00541 }
00542
00543
00544 // Return the imploded $out_array:
00545 if ($out_sheet>0) { // There were --div-- dividers around...
00546
00547 // Create parts array for the tab menu:
00548 $parts = array();
00549 foreach($out_array as $idx => $sheetContent) {
00550 $parts[] = array(
00551 'label' => $out_array_meta[$idx]['title'],
00552 'content' => '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.
00553 implode('',$sheetContent).
00554 '</table>'
00555 );
00556 }
00557
00558 return '
00559 <tr>
00560 <td colspan="2">
00561 '.$this->getDynTabMenu($parts, 'TCEforms:'.$table.':'.$row['uid']).'
00562 </td>
00563 </tr>';
00564 } else { // Only one, so just implode:
00565 return implode('',$out_array[$out_sheet]);
00566 }
00567 }
|
|
||||||||||||||||
|
Will return the TCEform element for just a single field from a record. The field must be listed in the currently displayed fields (as found in [types][showitem]) for the record. This also means that the $table/$row supplied must be complete so the list of fields to show can be found correctly
Definition at line 373 of file class.t3lib_tceforms.php. References $excludeElements, $TCA, getSingleField(), and table(). 00373 {
00374 global $TCA;
00375
00376 if ($TCA[$table]) {
00377 t3lib_div::loadTCA($table);
00378 $typeNum = $this->getRTypeNum($table,$row);
00379 if ($TCA[$table]['types'][$typeNum]) {
00380 $itemList = $TCA[$table]['types'][$typeNum]['showitem'];
00381 if ($itemList) {
00382 $fields = t3lib_div::trimExplode(',',$itemList,1);
00383 $excludeElements = $this->excludeElements = $this->getExcludeElements($table,$row,$typeNum);
00384
00385 reset($fields);
00386 while(list(,$fieldInfo)=each($fields)) {
00387 $parts = explode(';',$fieldInfo);
00388
00389 $theField = trim($parts[0]);
00390 if (!in_array($theField,$excludeElements) && !strcmp($theField,$theFieldToReturn)) {
00391 if ($TCA[$table]['columns'][$theField]) {
00392 $sField = $this->getSingleField($table,$theField,$row,$parts[1],1,$parts[3],$parts[2]);
00393 return $sField['ITEM'];
00394 }
00395 }
00396 }
00397 }
00398 }
00399 }
00400 }
|
|
|
Initialize various internal variables.
Definition at line 328 of file class.t3lib_tceforms.php. 00328 {
00329 global $BE_USER;
00330 $this->prependFormFieldNames = 'data';
00331 $this->formName = 'editform';
00332 $this->setNewBEDesign();
00333 $this->docLarge = $BE_USER->uc['edit_wideDocument'] ? 1 : 0;
00334 $this->edit_showFieldHelp = $BE_USER->uc['edit_showFieldHelp'];
00335
00336 $this->edit_docModuleUpload = $BE_USER->uc['edit_docModuleUpload'];
00337 $this->titleLen = $BE_USER->uc['titleLen'];
00338 }
|
|
|
Definition at line 278 of file class.t3lib_tceforms.php. |
|
|
Definition at line 280 of file class.t3lib_tceforms.php. |
|
|
Definition at line 279 of file class.t3lib_tceforms.php. |
|
|
Definition at line 281 of file class.t3lib_tceforms.php. |
|
|
Definition at line 208 of file class.t3lib_tceforms.php. |
|
|
Definition at line 215 of file class.t3lib_tceforms.php. |
|
|
Definition at line 199 of file class.t3lib_tceforms.php. |
|
|
Definition at line 200 of file class.t3lib_tceforms.php. |
|
|
Definition at line 229 of file class.t3lib_tceforms.php. |
|
|
Definition at line 223 of file class.t3lib_tceforms.php. |
|
|
Definition at line 210 of file class.t3lib_tceforms.php. |
|
|
Definition at line 211 of file class.t3lib_tceforms.php. |
|
|
Definition at line 232 of file class.t3lib_tceforms.php. |
|
|
Definition at line 198 of file class.t3lib_tceforms.php. |
|
|
Definition at line 219 of file class.t3lib_tceforms.php. |
|
|
Definition at line 195 of file class.t3lib_tceforms.php. |
|
|
Definition at line 222 of file class.t3lib_tceforms.php. |
|
|
Definition at line 217 of file class.t3lib_tceforms.php. |
|
|
Definition at line 224 of file class.t3lib_tceforms.php. |
|
|
Definition at line 225 of file class.t3lib_tceforms.php. |
|
|
Definition at line 269 of file class.t3lib_tceforms.php. Referenced by getMainFields(), and getSoloField(). |
|
|
Definition at line 202 of file class.t3lib_tceforms.php. |
|
|
Definition at line 221 of file class.t3lib_tceforms.php. |
|
|
Definition at line 228 of file class.t3lib_tceforms.php. |
|
|
Definition at line 227 of file class.t3lib_tceforms.php. |
|
|
Definition at line 220 of file class.t3lib_tceforms.php. |
|
|
Definition at line 204 of file class.t3lib_tceforms.php. |
|
|
Definition at line 271 of file class.t3lib_tceforms.php. |
|
|
Definition at line 196 of file class.t3lib_tceforms.php. |
|
|
Definition at line 206 of file class.t3lib_tceforms.php. |
|
|
Definition at line 231 of file class.t3lib_tceforms.php. |
|
|
Definition at line 230 of file class.t3lib_tceforms.php. |
|
|
Definition at line 197 of file class.t3lib_tceforms.php. |
|
|
Definition at line 218 of file class.t3lib_tceforms.php. |
|
|
Definition at line 270 of file class.t3lib_tceforms.php. |
|
|
Definition at line 194 of file class.t3lib_tceforms.php. |
|
|
Definition at line 266 of file class.t3lib_tceforms.php. |
|
|
Definition at line 265 of file class.t3lib_tceforms.php. |
|
|
Definition at line 207 of file class.t3lib_tceforms.php. |
|
|
Definition at line 203 of file class.t3lib_tceforms.php. |
|
|
Definition at line 274 of file class.t3lib_tceforms.php. |
|
|
Definition at line 273 of file class.t3lib_tceforms.php. |
|
|
Definition at line 272 of file class.t3lib_tceforms.php. |
|
|
Definition at line 216 of file class.t3lib_tceforms.php. |
|
|
Definition at line 275 of file class.t3lib_tceforms.php. |
|
|
Definition at line 264 of file class.t3lib_tceforms.php. |
|
|
Definition at line 205 of file class.t3lib_tceforms.php. |
|
|
Definition at line 209 of file class.t3lib_tceforms.php. |
|
|
Definition at line 201 of file class.t3lib_tceforms.php. |
1.3.8-20040913