38 public $HTMLcolorList =
'aqua,beige,black,blue,brown,fuchsia,gold,gray,green,lime,maroon,navy,olive,orange,purple,red,silver,tan,teal,turquoise,yellow,white';
53 'advanced' => array(),
71 'enable' => array(
'Enable features',
'a'),
72 'dims' => array(
'Dimensions, widths, heights, pixels',
'b'),
73 'file' => array(
'Files',
'c'),
74 'typo' => array(
'Typography',
'd'),
75 'color' => array(
'Colors',
'e'),
76 'links' => array(
'Links and targets',
'f'),
77 'language' => array(
'Language specific constants',
'g'),
79 'cheader' => array(
'Content: \'Header\'',
'ma'),
80 'cheader_g' => array(
'Content: \'Header\', Graphical',
'ma'),
81 'ctext' => array(
'Content: \'Text\'',
'mb'),
82 'cimage' => array(
'Content: \'Image\'',
'md'),
83 'cbullets' => array(
'Content: \'Bullet list\'',
'me'),
84 'ctable' => array(
'Content: \'Table\'',
'mf'),
85 'cuploads' => array(
'Content: \'Filelinks\'',
'mg'),
86 'cmultimedia' => array(
'Content: \'Multimedia\'',
'mh'),
87 'cmedia' => array(
'Content: \'Media\'',
'mr'),
88 'cmailform' => array(
'Content: \'Form\'',
'mi'),
89 'csearch' => array(
'Content: \'Search\'',
'mj'),
90 'clogin' => array(
'Content: \'Login\'',
'mk'),
91 'cmenu' => array(
'Content: \'Menu/Sitemap\'',
'mm'),
92 'cshortcut' => array(
'Content: \'Insert records\'',
'mn'),
93 'clist' => array(
'Content: \'List of records\'',
'mo'),
94 'chtml' => array(
'Content: \'HTML\'',
'mq')
222 if (is_array($setupArray)) {
224 $this->getFileName_backPath = PATH_site;
225 foreach ($setupArray as $key => $val) {
227 if ($prefix || substr($key, 0, 16) !=
'TSConstantEditor') {
228 if (is_array($val)) {
229 $this->
flattenSetup($val, $prefix . $key, $key ==
'file.');
230 } elseif ($resourceFlag && $this->resourceCheck) {
231 $this->flatSetup[$prefix . $key] = $this->
getFileName($val);
232 if ($this->removeFromGetFilePath && substr($this->flatSetup[$prefix . $key], 0, strlen($this->removeFromGetFilePath)) == $this->removeFromGetFilePath) {
233 $this->flatSetup[$prefix . $key] = substr($this->flatSetup[$prefix . $key], strlen($this->removeFromGetFilePath));
236 $this->flatSetup[$prefix . $key] = $val;
251 $this->Cmarker = substr(md5(uniqid(
'', TRUE)), 0, 6);
252 return preg_replace_callback(
'/\\{\\$(.[^}]+)\\}/', array($this,
'substituteConstantsCallBack'), $all);
264 switch ($this->constantMode) {
266 $ret_val = isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ?
'##' . $this->Cmarker .
'_B##' . $matches[0] .
'##' . $this->Cmarker .
'_E##' : $matches[0];
269 $ret_val = isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ?
'##' . $this->Cmarker .
'_B##' . $this->flatSetup[$matches[1]] .
'##' . $this->Cmarker .
'_E##' : $matches[0];
272 $ret_val = $matches[0];
275 $ret_val = isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? $this->flatSetup[$matches[1]] : $matches[0];
288 switch ($this->constantMode) {
292 array(
'##' . $this->Cmarker .
'_B##',
'##' . $this->Cmarker .
'_E##'),
293 array(
'<font color="green"><strong>',
'</strong></font>'),
309 public function generateConfig_constants() {
311 $this->setup[
'resources'] = $this->resources;
322 $matchObj->setSimulateMatchResult(TRUE);
324 $cc = count($this->constants);
325 foreach ($this->constants as $str) {
328 if (strstr($str, $this->edit_divider)) {
329 $parts = explode($this->edit_divider, $str, 2);
333 $this->flatSetup = array();
339 $this->flatSetup = array();
341 $this->setup[
'constants'] =
$constants->setup;
354 $parts = explode(
'.', $theKey, 2);
355 if ((
string)$parts[0] !==
'' && is_array($theSetup[$parts[0] .
'.'])) {
356 if (trim($parts[1]) !==
'') {
357 return $this->
ext_getSetup($theSetup[$parts[0] .
'.'], trim($parts[1]));
359 return array($theSetup[$parts[0] .
'.'], $theSetup[$parts[0]]);
362 if (trim($theKey) !==
'') {
363 return array(array(), $theSetup[$theKey]);
365 return array($theSetup,
'');
382 public function ext_getObjTree($arr, $depth_in, $depthData, $parentType =
'', $parentValue =
'', $alphaSort =
'0') {
385 if ($alphaSort ==
'1') {
388 $keyArr_num = array();
389 $keyArr_alpha = array();
390 foreach ($arr as $key => $value) {
392 if (substr($key, -2) !=
'..') {
393 $key = preg_replace(
'/\\.$/',
'', $key);
394 if (substr($key, -1) !=
'.') {
395 if (\
TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($key)) {
396 $keyArr_num[$key] = $arr[$key];
398 $keyArr_alpha[$key] = $arr[$key];
404 $keyArr = $keyArr_num + $keyArr_alpha;
407 $depth_in = $depth_in .
'.';
409 foreach ($keyArr as $key => $value) {
411 $depth = $depth_in . $key;
413 if ($this->bType !==
'const' || $depth[0] !==
'_') {
414 $goto = substr(md5($depth), 0, 6);
417 $LN = $a == $c ?
'blank' :
'line';
418 $BTM = $a == $c ?
'bottom' :
'';
419 $PM = is_array($arr[$key .
'.']) && !$this->ext_noPMicons ? ($deeper ?
'minus' :
'plus') :
'join';
425 $urlParameters = array(
427 'tsbr[' . $depth .
']' => $deeper ? 0 : 1
433 $HTML .=
'<a name="' . $goto .
'" href="' . htmlspecialchars($aHref) .
'">' . $theIcon .
'</a>';
438 $label =
'<font color="#666666">' . $label .
'</font>';
440 if ($this->linkObjects) {
441 $urlParameters = array(
449 if ($this->bType !=
'const') {
450 $ln = is_array($arr[$key .
'.ln..']) ?
'Defined in: ' . $this->
lineNumberToScript($arr[($key .
'.ln..')]) :
'N/A';
454 if ($this->tsbrowser_searchKeys[$depth] & 4) {
455 $label =
'<strong><font color="red">' . $label .
'</font></strong>';
458 $label =
'<a href="' . htmlspecialchars($aHref) .
'" title="' . htmlspecialchars($ln) .
'">' . $label .
'</a>';
461 $HTML .=
'[' . $label .
']';
462 if (isset($arr[$key])) {
463 $theValue = $arr[$key];
464 if ($this->fixedLgd) {
465 $imgBlocks = ceil(1 + strlen($depthData) / 77);
466 $lgdChars = 68 - ceil(strlen((
'[' . $key .
']')) * 0.8) - $imgBlocks * 3;
470 if ($this->tsbrowser_searchKeys[$depth] & 2) {
471 $HTML .=
' = <strong><font color="red">' . $this->
makeHtmlspecialchars($theValue) .
'</font></strong>';
475 if ($this->ext_regComments && isset($arr[$key .
'..'])) {
476 $comment = $arr[$key .
'..'];
478 if (!preg_match(
'/### <INCLUDE_TYPOSCRIPT:.*/', $comment)) {
480 $comment = preg_replace(
'/[\\r\\n]/',
' ', $comment);
482 $comment = preg_replace(
'/[#\\*]{2,}/',
'', $comment);
484 $comment = preg_replace(
'/^[#\\*\\s]+/',
'# ', $comment);
487 $HTML .=
' <span class="comment">' . trim($comment) .
'</span>';
513 if (!is_array($this->lnToScript)) {
514 $this->lnToScript = array();
518 foreach ($this->hierarchyInfo as $templateNumber => $info) {
522 $linecountAfterIncludeProcessing = substr_count($this->config[$templateNumber], LF) + 2;
523 $c += $linecountAfterIncludeProcessing;
524 $this->lnToScript[$c] = $info[
'title'];
528 foreach ($lnArr as $k => $ln) {
529 foreach ($this->lnToScript as $endLn => $title) {
530 if ($endLn >= (
int)$ln) {
531 $lnArr[$k] =
'"' . $title .
'", ' . $ln;
537 return implode(
'; ', $lnArr);
548 return $this->ext_noSpecialCharsOnLabels ? $theValue : htmlspecialchars($theValue);
563 foreach ($arr as $key => $value) {
564 $key = preg_replace(
'/\\.$/',
'', $key);
565 if (substr($key, -1) !=
'.') {
571 $depth_in = $depth_in .
'.';
573 foreach ($keyArr as $key => $value) {
574 $depth = $depth_in . $key;
575 $deeper = is_array($arr[$key .
'.']);
576 if ($this->regexMode) {
578 if (preg_match(
'/' . $searchString .
'/', $arr[$key])) {
579 $this->tsbrowser_searchKeys[$depth] += 2;
582 if (preg_match(
'/' . $searchString .
'/', $key)) {
583 $this->tsbrowser_searchKeys[$depth] += 4;
586 if (preg_match(
'/' . $searchString .
'/', $depth_in)) {
587 $this->tsbrowser_searchKeys[$depth] = 1;
591 if (stristr($arr[$key], $searchString)) {
592 $this->tsbrowser_searchKeys[$depth] += 2;
595 if (stristr($key, $searchString)) {
596 $this->tsbrowser_searchKeys[$depth] += 4;
599 if (stristr($depth_in, $searchString)) {
600 $this->tsbrowser_searchKeys[$depth] = 1;
604 $cS = count($this->tsbrowser_searchKeys);
605 $keyArray = $this->
ext_getSearchKeys($arr[$key .
'.'], $depth, $searchString, $keyArray);
606 if ($cS != count($this->tsbrowser_searchKeys)) {
607 $keyArray[$depth] = 1;
622 if ($pid && is_array(
$GLOBALS[
'rootLine'])) {
623 foreach (
$GLOBALS[
'rootLine'] as $key => $val) {
624 if ($val[
'uid'] == $pid) {
643 foreach ($arr as $key => $value) {
644 $key = preg_replace(
'/\\.$/',
'', $key);
645 if (substr($key, -1) !=
'.') {
652 foreach ($keyArr as $key => $value) {
655 $deeper = is_array($arr[$key .
'.']);
658 $LN = $a == $c ?
'blank' :
'line';
659 $BTM = $a == $c ?
'top' :
'';
662 $alttext =
'[' . $row[
'templateID'] .
']';
665 if (in_array($row[
'templateID'], $this->clearList_const) || in_array($row[
'templateID'], $this->clearList_setup)) {
666 $urlParameters = array(
668 'template' => $row[
'templateID']
671 $A_B =
'<a href="' . htmlspecialchars($aHref) .
'">';
674 $A_B =
'<strong>' . $A_B;
683 $keyArray[] =
'<tr class="' . ($i++ % 2 == 0 ?
'bgColor4' :
'bgColor6') .
'"> 684 <td nowrap="nowrap">' . $HTML .
'</td> 686 <td align="center">' . ($row[
'clConf'] ? \
TYPO3\CMS\Backend\Utility\
IconUtility::getSpriteIcon(
'status-status-checked') :
'') .
' ' .
'</td> 687 <td align="center">' . ($row[
'clConst'] ? \
TYPO3\CMS\Backend\Utility\
IconUtility::getSpriteIcon(
'status-status-checked') :
'') .
' ' .
'</td> 688 <td align="center">' . ($row[
'pid'] ?:
'') .
'</td> 689 <td align="center">' . (strcmp($RL,
'') ? $RL :
'') .
'</td> 690 <td>' . ($row[
'next'] ?
' ' . $row[
'next'] .
' ' :
'') .
'</td> 709 $parent = $this->hierarchyInfo[$pointer - 1][
'templateParent'];
710 while ($pointer > 0 && $this->hierarchyInfo[$pointer - 1][
'templateParent'] == $parent) {
712 $row = $this->hierarchyInfo[$pointer];
713 $depthDataArr[$row[
'templateID']] = $row;
714 $depthDataArr[$row[
'templateID']][
'bgcolor_setup'] = isset($this->clearList_setup_temp[$row[
'templateID']]) ?
' class="bgColor5"' :
'';
715 $depthDataArr[$row[
'templateID']][
'bgcolor_const'] = isset($this->clearList_const_temp[$row[
'templateID']]) ?
' class="bgColor5"' :
'';
716 unset($this->clearList_setup_temp[$row[
'templateID']]);
717 unset($this->clearList_const_temp[$row[
'templateID']]);
718 $this->templateTitles[$row[
'templateID']] = $row[
'title'];
719 if ($row[
'templateID'] == $this->hierarchyInfo[$pointer - 1][
'templateParent']) {
723 return $depthDataArr;
741 array
$config, $lineNumbers = FALSE, $comments = FALSE, $crop = FALSE, $syntaxHL = FALSE, $syntaxHLBlockmode = 0
744 foreach ($config as $str) {
745 $all .=
'[GLOBAL]' . LF . $str;
749 $tsparser->lineNumberOffset = $this->ext_lineNumberOffset + 1;
750 $tsparser->parentObject = $this;
751 return $tsparser->doSyntaxHighlight($all, $lineNumbers ? array($this->ext_lineNumberOffset + 1) :
'', $syntaxHLBlockmode);
753 return $this->
ext_formatTS($all, $lineNumbers, $comments, $crop);
769 if (strlen($string) > $chars) {
770 if (strlen($string) > 24 && substr($string, 0, 12) ==
'##' . $this->Cmarker .
'_B##') {
771 return '##' . $this->Cmarker .
'_B##' .
GeneralUtility::fixed_lgd_cs(substr($string, 12, -12), ($chars - 3)) .
'##' . $this->Cmarker .
'_E##';
789 return '<a href="#" id="line-' . $lineNumber .
'" onClick="return brPoint(' . $lineNumber .
',' . ($this->ext_lineNumberOffset_mode ==
'setup' ? 1 : 0) .
');">' . $str .
'</a>';
803 $cArr = explode(LF, $input);
804 $n = ceil(log10(count($cArr) + $this->ext_lineNumberOffset));
806 foreach ($cArr as $k => $v) {
807 $lln = $k + $this->ext_lineNumberOffset + 1;
809 $lineNum = $this->
ext_lnBreakPointWrap($lln, str_replace(
' ',
' ', sprintf((
'% ' . $n .
'd'), $lln))) .
': ';
811 $v = htmlspecialchars($v);
815 $cArr[$k] = $lineNum . str_replace(
' ',
' ', $v);
816 $firstChar = substr(trim($v), 0, 1);
817 if ($firstChar ==
'[') {
818 $cArr[$k] =
'<font color="green"><strong>' . $cArr[$k] .
'</strong></font>';
819 } elseif ($firstChar ==
'/' || $firstChar ==
'#') {
821 $cArr[$k] =
'<span class="typo3-dimmed">' . $cArr[$k] .
'</span>';
827 $output = implode($cArr,
'<br />') .
'<br />';
843 $addC =
' AND uid=' . $template_uid;
845 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'sys_template',
'pid=' . (
int)$id . $addC .
' ' . $this->whereClause,
'',
'sorting',
'1');
846 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
848 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
865 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'sys_template',
'pid=' . (
int)$id .
' ' . $this->whereClause,
'',
'sorting');
866 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
868 if (is_array($row)) {
872 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
887 $editableComments = array();
888 foreach ($this->flatSetup as
$const => $value) {
889 if (substr(
$const, -2) !=
'..' && isset($this->flatSetup[
$const .
'..'])) {
890 $comment = trim($this->flatSetup[$const .
'..']);
891 $c_arr = explode(LF, $comment);
892 foreach ($c_arr as $k => $v) {
893 $line = trim(preg_replace(
'/^[#\\/]*/',
'', $v));
895 $parts = explode(
';', $line);
896 foreach ($parts as $par) {
897 if (strstr($par,
'=')) {
898 $keyValPair = explode(
'=', $par, 2);
899 switch (trim(strtolower($keyValPair[0]))) {
902 $editableComments[
$const][
'type'] = trim($keyValPair[1]);
906 $catSplit = explode(
'/', strtolower($keyValPair[1]));
907 $catSplit[0] = trim($catSplit[0]);
908 if (isset($this->categoryLabels[$catSplit[0]])) {
909 $catSplit[0] = $this->categoryLabels[$catSplit[0]];
911 $editableComments[
$const][
'cat'] = $catSplit[0];
913 $catSplit[1] = trim($catSplit[1]);
914 if ($catSplit[1] && isset($this->subCategories[$catSplit[1]])) {
915 $editableComments[
$const][
'subcat_name'] = $catSplit[1];
916 $editableComments[
$const][
'subcat'] = $this->subCategories[$catSplit[1]][1] .
'/' . $catSplit[1] .
'/' . trim($catSplit[2]) .
'z';
918 $editableComments[
$const][
'subcat'] =
'x' .
'/' . trim($catSplit[2]) .
'z';
923 $editableComments[
$const][
'label'] = trim($keyValPair[1]);
925 case 'customcategory':
927 $customCategory = explode(
'=', $keyValPair[1], 2);
928 if (trim($customCategory[0])) {
929 $categoryKey = strtolower($customCategory[0]);
930 $this->categoryLabels[$categoryKey] =
$GLOBALS[
'LANG']->sL($customCategory[1]);
933 case 'customsubcategory':
935 $customSubcategory = explode(
'=', $keyValPair[1], 2);
936 if (trim($customSubcategory[0])) {
937 $subCategoryKey = strtolower($customSubcategory[0]);
938 $this->subCategories[$subCategoryKey][0] =
$GLOBALS[
'LANG']->sL($customSubcategory[1]);
947 if (isset($editableComments[$const])) {
949 $editableComments[
$const][
'value'] = trim($value);
950 if (isset($default[$const])) {
951 $editableComments[
$const][
'default_value'] = trim($default[$const]);
955 return $editableComments;
967 foreach ($editConstArray as $constName => $constData) {
968 if (!$constData[
'type']) {
969 $constData[
'type'] =
'string';
971 $cats = explode(
',', $constData[
'cat']);
973 foreach ($cats as $theCat) {
974 $theCat = trim($theCat);
976 $this->categories[$theCat][$constName] = $constData[
'subcat'];
991 foreach ($this->categories as $k => $v) {
993 $retArr[$k] = strtoupper($k) .
' (' . count($v) .
')';
1008 $type = trim($type);
1010 $retArr[
'type'] =
'string';
1012 $m = strcspn($type,
' [');
1013 $retArr[
'type'] = strtolower(substr($type, 0, $m));
1015 $p = trim(substr($type, $m));
1017 preg_match(
'/\\[(.*)\\]/', $p, $reg);
1020 $retArr[
'paramstr'] = $p;
1021 switch ($retArr[
'type']) {
1023 if ($retArr[
'paramstr'][0] ===
'-') {
1025 $retArr[
'params'][0] = (int)(
'-' . $retArr[
'params'][0]);
1029 $retArr[
'paramstr'] = $retArr[
'params'][0] .
' - ' . $retArr[
'params'][1];
1032 $retArr[
'params'] = explode(
',', $retArr[
'paramstr']);
1049 $catConf = $this->setup[
'constants'][
'TSConstantEditor.'][$category .
'.'];
1051 if (is_array($catConf)) {
1052 foreach ($catConf as $key => $val) {
1065 if (\
TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($key)) {
1066 $constRefs = explode(
',', $val);
1067 foreach ($constRefs as
$const) {
1068 $const = trim($const);
1069 if ($const && $const <= 20) {
1077 $this->helpConfig = $out;
1088 return '<img src="' . $this->ext_localWebGfxPrefix .
'gfx/' . $key .
'.gif" align="top" hspace=2>';
1099 if (substr($imgConf, 0, 4) ==
'gfx/') {
1100 $iFile = $this->ext_localGfxPrefix . $imgConf;
1101 $tFile = $this->ext_localWebGfxPrefix . $imgConf;
1102 } elseif (substr($imgConf, 0, 4) ==
'EXT:') {
1106 $tFile =
$GLOBALS[
'BACK_PATH'] .
'../' . $f;
1109 $imageInfo = @getImagesize($iFile);
1110 return '<img src="' . $tFile .
'" ' . $imageInfo[3] .
'>';
1121 $fN =
'data[' . $params[
'name'] .
']';
1122 $fV = $params[
'value'];
1124 if (preg_match(
'/^{[\\$][a-zA-Z0-9\\.]*}$/', trim($fV), $reg)) {
1127 $fV = htmlspecialchars($fV);
1128 return array($fN, $fV, $params);
1140 reset($theConstants);
1141 $output =
'<script type="text/javascript" src="' .
$GLOBALS[
'BACK_PATH'] .
'js/constantEditor.js"></script> 1144 if (is_array($this->categories[$category])) {
1145 $help = $this->helpConfig;
1146 if (!$this->doNotSortCategoriesBeforeMakingForm) {
1147 asort($this->categories[$category]);
1149 foreach ($this->categories[$category] as $name => $type) {
1150 $params = $theConstants[$name];
1151 if (is_array($params)) {
1152 if ($subcat != $params[
'subcat_name']) {
1153 $subcat = $params[
'subcat_name'];
1154 $subcat_name = $params[
'subcat_name'] ? $this->subCategories[$params[
'subcat_name']][0] :
'Others';
1155 $output .=
'<h3 class="typo3-tstemplate-ceditor-subcat">' . $subcat_name .
'</h3>';
1157 $label =
$GLOBALS[
'LANG']->sL($params[
'label']);
1158 $label_parts = explode(
':', $label, 2);
1159 if (count($label_parts) == 2) {
1160 $head = trim($label_parts[0]);
1161 $body = trim($label_parts[1]);
1163 $head = trim($label_parts[0]);
1166 if (strlen($head) > 35) {
1175 $raname = substr(md5($params[
'name']), 0, 10);
1176 $aname =
'\'' . $raname .
'\'';
1177 list($fN, $fV, $params) = $this->
ext_fNandV($params);
1178 switch ($typeDat[
'type']) {
1182 $p_field =
'<input id="' . $fN .
'" type="text" name="' . $fN .
'" value="' . $fV .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(5) .
' onChange="uFormUrl(' . $aname .
')" />';
1183 if ($typeDat[
'paramstr']) {
1184 $p_field .=
' Range: ' . $typeDat[
'paramstr'];
1185 } elseif ($typeDat[
'type'] ==
'int+') {
1186 $p_field .=
' Range: 0 - ';
1188 $p_field .=
' (Integer)';
1192 $colorNames = explode(
',',
',' . $this->HTMLcolorList);
1194 foreach ($colorNames as $val) {
1196 if ($val == strtolower($params[
'value'])) {
1199 $p_field .=
'<option value="' . htmlspecialchars($val) .
'"' . $sel .
'>' . $val .
'</option>';
1201 $p_field =
'<select id="select-' . $fN .
'" rel="' . $fN .
'" name="C' . $fN .
'" class="typo3-tstemplate-ceditor-color-select" onChange="uFormUrl(' . $aname .
');">' . $p_field .
'</select>';
1202 $p_field .=
'<input type="text" id="input-' . $fN .
'" rel="' . $fN .
'" name="' . $fN .
'" class="typo3-tstemplate-ceditor-color-input" value="' . $fV .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(7) .
' onChange="uFormUrl(' . $aname .
')" />';
1205 $wArr = explode(
'|', $fV);
1206 $p_field =
'<input type="text" id="' . $fN .
'" name="' . $fN .
'" value="' . $wArr[0] .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(29) .
' onChange="uFormUrl(' . $aname .
')" />';
1208 $p_field .=
'<input type="text" name="W' . $fN .
'" value="' . $wArr[1] .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(15) .
' onChange="uFormUrl(' . $aname .
')" />';
1211 $wArr = explode(
',', $fV);
1213 $p_field = ($labels[0] ? $labels[0] :
'x') .
':<input type="text" name="' . $fN .
'" value="' . $wArr[0] .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
' onChange="uFormUrl(' . $aname .
')" />';
1215 $p_field .= ($labels[1] ? $labels[1] :
'y') .
':<input type="text" name="W' . $fN .
'" value="' . $wArr[1] .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
' onChange="uFormUrl(' . $aname .
')" />';
1216 $labelsCount = count($labels);
1217 for ($aa = 2; $aa < $labelsCount; $aa++) {
1219 $p_field .=
' , ' . $labels[$aa] .
':<input type="text" name="W' . $aa . $fN .
'" value="' . $wArr[$aa] .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
' onChange="uFormUrl(' . $aname .
')" />';
1221 $p_field .=
'<input type="hidden" name="W' . $aa . $fN .
'" value="' . $wArr[$aa] .
'" />';
1226 if (is_array($typeDat[
'params'])) {
1228 foreach ($typeDat[
'params'] as $val) {
1229 $vParts = explode(
'=', $val, 2);
1230 $label = $vParts[0];
1231 $val = isset($vParts[1]) ? $vParts[1] : $vParts[0];
1234 if ($val == $params[
'value']) {
1237 $p_field .=
'<option value="' . htmlspecialchars($val) .
'"' . $sel .
'>' .
$GLOBALS[
'LANG']->sL($label) .
'</option>';
1239 $p_field =
'<select id="' . $fN .
'" name="' . $fN .
'" onChange="uFormUrl(' . $aname .
')">' . $p_field .
'</select>';
1243 $p_field =
'<input type="hidden" name="' . $fN .
'" value="0" />';
1248 $p_field .=
'<input id="' . $fN .
'" type="checkbox" name="' . $fN .
'" value="' . ($typeDat[
'paramstr'] ? $typeDat[
'paramstr'] : 1) .
'"' . $sel .
' onClick="uFormUrl(' . $aname .
')" />';
1251 $p_field =
'<input type="hidden" name="' . $fN .
'" value="#" />';
1256 $p_field .=
'<input id="' . $fN .
'" type="checkbox" name="' . $fN .
'" value=""' . $sel .
' onClick="uFormUrl(' . $aname .
')" />';
1259 $p_field =
'<option value=""></option>';
1262 $extList = $typeDat[
'paramstr'];
1263 $p_field =
'<option value="">(' . $extList .
')</option>';
1264 if ($extList ==
'IMAGE_EXT') {
1265 $extList =
$GLOBALS[
'TYPO3_CONF_VARS'][
'GFX'][
'imagefile_ext'];
1267 if (trim($params[
'value'])) {
1268 $val = $params[
'value'];
1269 $p_field .=
'<option value=""></option>';
1270 $p_field .=
'<option value="' . htmlspecialchars($val) .
'" selected>' . $val .
'</option>';
1272 $p_field =
'<select id="' . $fN .
'" name="' . $fN .
'" onChange="uFormUrl(' . $aname .
')">' . $p_field .
'</select>';
1273 $p_field .= $theImage;
1276 $userFunction = $typeDat[
'paramstr'];
1277 $userFunctionParams = array(
'fieldName' => $fN,
'fieldValue' => $fV);
1283 $fwidth = $typeDat[
'type'] ==
'small' ? 10 : 46;
1284 $p_field =
'<input id="' . $fN .
'" type="text" name="' . $fN .
'" value="' . $fV .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth($fwidth) .
' onChange="uFormUrl(' . $aname .
')" />';
1287 $userTyposcriptID =
'userTS-' . $params[
'name'];
1288 $defaultTyposcriptID =
'defaultTS-' . $params[
'name'];
1289 $checkboxName =
'check[' . $params[
'name'] .
']';
1290 $checkboxID = $checkboxName;
1292 if ($typeDat[
'type'] ==
'color' && substr($params[
'value'], 0, 2) !=
'{$') {
1293 $color =
'<div id="colorbox-' . $fN .
'" class="typo3-tstemplate-ceditor-colorblock" style="background-color:' . $params[
'value'] .
';"> </div>';
1297 if (!$this->ext_dontCheckIssetValues) {
1299 if (isset($this->objReg[$params[
'name']])) {
1300 $checkboxValue =
'checked';
1301 $userTyposcriptStyle =
'';
1302 $defaultTyposcriptStyle =
'style="display:none;"';
1304 $checkboxValue =
'';
1305 $userTyposcriptStyle =
'style="display:none;"';
1306 $defaultTyposcriptStyle =
'';
1309 'class' =>
'typo3-tstemplate-ceditor-control undoIcon',
1310 'alt' =>
'Revert to default Constant',
1311 'title' =>
'Revert to default Constant',
1312 'rel' => $params[
'name']
1315 'class' =>
'typo3-tstemplate-ceditor-control editIcon',
1316 'alt' =>
'Edit this Constant',
1317 'title' =>
'Edit this Constant',
1318 'rel' => $params[
'name']
1320 $constantCheckbox =
'<input type="hidden" name="' . $checkboxName .
'" id="' . $checkboxID .
'" value="' . $checkboxValue .
'"/>';
1322 if (!$params[
'default_value']) {
1323 $params[
'default_value'] =
'[Empty]';
1325 $constantDefaultRow =
'<div class="typo3-tstemplate-ceditor-row" id="' . $defaultTyposcriptID .
'" ' . $defaultTyposcriptStyle .
'>' . $editIconHTML . htmlspecialchars($params[
'default_value']) . $color .
'</div>';
1327 $constantEditRow =
'<div class="typo3-tstemplate-ceditor-row" id="' . $userTyposcriptID .
'" ' . $userTyposcriptStyle .
'>' . $deleteIconHTML . $p_field . $color .
'</div>';
1328 $constantLabel =
'<dt class="typo3-tstemplate-ceditor-label">' . htmlspecialchars($head) .
'</dt>';
1329 $constantName =
'<dt class="typo3-dimmed">[' . $params[
'name'] .
']</dt>';
1330 $constantDescription = $body ?
'<dd>' . htmlspecialchars($body) .
'</dd>' :
'';
1331 $constantData =
'<dd>' . $constantCheckbox . $constantEditRow . $constantDefaultRow .
'</dd>';
1332 $output .=
'<a name="' . $raname .
'"></a>' . $help[
'constants'][$params[
'name']];
1333 $output .=
'<dl class="typo3-tstemplate-ceditor-constant">' . $constantLabel . $constantName . $constantDescription . $constantData .
'</dl>';
1335 debug(
'Error. Constant did not exist. Should not happen.');
1358 $this->objReg = array();
1371 while (isset($this->raw[$this->rawP])) {
1372 $line = ltrim($this->raw[$this->rawP]);
1373 if (strstr($line, $this->edit_divider)) {
1375 $this->objReg = array();
1379 if ($line[0] ===
'[') {
1381 } elseif (strcspn($line,
'}#/') != 0) {
1382 $varL = strcspn($line,
' {=<');
1383 $var = substr($line, 0, $varL);
1384 $line = ltrim(substr($line, $varL));
1387 $this->objReg[$pre . $var] = $this->rawP - 1;
1390 $this->ext_inBrace++;
1394 $this->lastComment =
'';
1395 } elseif ($line[0] ===
'}') {
1396 $this->lastComment =
'';
1397 $this->ext_inBrace--;
1398 if ($this->ext_inBrace < 0) {
1399 $this->ext_inBrace = 0;
1419 $theValue =
' ' . trim($var);
1420 if (isset($this->objReg[$key])) {
1421 $lineNum = $this->objReg[$key];
1422 $parts = explode(
'=', $this->raw[$lineNum], 2);
1423 if (count($parts) == 2) {
1424 $parts[1] = $theValue;
1426 $this->raw[$lineNum] = implode($parts,
'=');
1428 $this->raw[] = $key .
' =' . $theValue;
1442 if (isset($this->objReg[$key])) {
1443 $lineNum = $this->objReg[$key];
1444 unset($this->raw[$lineNum]);
1458 $tsbrArray = array();
1459 foreach ($arr as $theK => $theV) {
1460 $theKeyParts = explode(
'.', $theK);
1462 $c = count($theKeyParts);
1464 foreach ($theKeyParts as $p) {
1466 $depth .= ($depth ?
'.' :
'') . $p;
1467 $tsbrArray[$depth] = $c == $a ? $theV : 1;
1471 foreach ($tsbrArray as $theK => $theV) {
1473 $settings[$theK] = 1;
1475 unset($settings[$theK]);
1491 public function ext_procesInput($http_post_vars, $http_post_files, $theConstants, $tplRow) {
1492 $data = $http_post_vars[
'data'];
1493 $check = $http_post_vars[
'check'];
1494 $Wdata = $http_post_vars[
'Wdata'];
1495 $W2data = $http_post_vars[
'W2data'];
1496 $W3data = $http_post_vars[
'W3data'];
1497 $W4data = $http_post_vars[
'W4data'];
1498 $W5data = $http_post_vars[
'W5data'];
1499 if (is_array($data)) {
1500 foreach ($data as $key => $var) {
1501 if (isset($theConstants[$key])) {
1503 if ($this->ext_dontCheckIssetValues || isset($check[$key])) {
1505 list($var) = explode(LF, $var);
1507 switch ($typeDat[
'type']) {
1509 if ($typeDat[
'paramstr']) {
1516 $var = max(0, (
int)$var);
1521 $var = preg_replace(
'/[^A-Fa-f0-9]*/',
'', $var);
1522 $useFulHex = strlen($var) > 3;
1523 $col[] = HexDec($var[0]);
1524 $col[] = HexDec($var[1]);
1525 $col[] = HexDec($var[2]);
1527 $col[] = HexDec($var[3]);
1528 $col[] = HexDec($var[4]);
1529 $col[] = HexDec($var[5]);
1531 $var = substr((
'0' . DecHex($col[0])), -1) . substr((
'0' . DecHex($col[1])), -1) . substr((
'0' . DecHex($col[2])), -1);
1533 $var .= substr((
'0' . DecHex($col[3])), -1) . substr((
'0' . DecHex($col[4])), -1) . substr((
'0' . DecHex($col[5])), -1);
1535 $var =
'#' . strtoupper($var);
1546 if (isset($Wdata[$key])) {
1547 $var .=
'|' . $Wdata[$key];
1551 if (isset($Wdata[$key])) {
1552 $var = (int)$var .
',' . (
int)$Wdata[$key];
1553 if (isset($W2data[$key])) {
1554 $var .=
',' . (int)$W2data[$key];
1555 if (isset($W3data[$key])) {
1556 $var .=
',' . (int)$W3data[$key];
1557 if (isset($W4data[$key])) {
1558 $var .=
',' . (int)$W4data[$key];
1559 if (isset($W5data[$key])) {
1560 $var .=
',' . (int)$W5data[$key];
1569 $var = $typeDat[
'paramstr'] ? $typeDat[
'paramstr'] : 1;
1573 if ($this->ext_printAll || (
string)$theConstants[$key][
'value'] !== (string)$var) {
1578 unset($check[$key]);
1586 if (!$this->ext_dontCheckIssetValues && is_array($check)) {
1587 foreach ($check as $key => $var) {
1588 if (isset($theConstants[$key])) {
1589 $dValue = $theConstants[$key][
'default_value'];
ext_getTSCE_config_image($imgConf)
flattenSetup($setupArray, $prefix, $resourceFlag)
ext_getRootlineNumber($pid)
ext_formatTS($input, $ln, $comments=1, $crop=0)
lineNumberToScript(array $lnArr)
ext_categorizeEditableConstants($editConstArray)
$ext_noSpecialCharsOnLabels
substituteConstantsCallBack($matches)
ext_outputTS(array $config, $lineNumbers=FALSE, $comments=FALSE, $crop=FALSE, $syntaxHL=FALSE, $syntaxHLBlockmode=0)
ext_lnBreakPointWrap($lineNumber, $str)
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
$ext_lineNumberOffset_mode
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
ext_getObjTree($arr, $depth_in, $depthData, $parentType='', $parentValue='', $alphaSort='0')
static workspaceOL($table, &$row, $wsid=-99, $unsetMovePointers=FALSE)
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
ext_compareFlatSetups($default)
$ext_dontCheckIssetValues
ext_getFirstTemplate($id, $template_uid=0)
ext_removeValueInConf($key)
static makeInstance($className)
ext_regObjectPositions($constants)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
ext_getCategoryLabelArray()
ext_fixed_lgd($string, $chars)
ext_getTemplateHierarchyArr($arr, $depthData, $keyArray, $first=0)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
ext_putValueInConf($key, $var)
static getSpriteIconForRecord($table, array $row, array $options=array())
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
ext_process_hierarchyInfo(array $depthDataArr, &$pointer)
ext_depthKeys($arr, $settings)
substituteConstants($all)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
$doNotSortCategoriesBeforeMakingForm
ext_printFields($theConstants, $category)
ext_procesInput($http_post_vars, $http_post_files, $theConstants, $tplRow)
debug($variable='', $name=' *variable *', $line=' *line *', $file=' *file *', $recursiveDepth=3, $debugLevel=E_DEBUG)
static fixed_lgd_cs($string, $chars, $appendString='...')
ext_getSearchKeys($arr, $depth_in, $searchString, $keyArray)
static getRecordPath($uid, $clause, $titleLimit, $fullTitleLimit=0)
makeHtmlspecialchars($theValue)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)
ext_getSetup($theSetup, $theKey)
ext_getTSCE_config($category)
static stripPathSitePrefix($path)
ext_prevPageWithTemplate($id, $perms_clause)
getFileName($fileFromSetup)