' . $HTML . ' |
' . ($row['root'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : '') . ' |
- ' . ($row['clConf'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') :'') . ' ' . ' |
+ ' . ($row['clConf'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : '') . ' ' . ' |
' . ($row['clConst'] ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : '') . ' ' . ' |
' . ($row['pid'] ? $row['pid'] : '') . ' |
' . (strcmp($RL, '') ? $RL : '') . ' |
' . ($row['next'] ? ' ' . $row['next'] . ' ' : '') . ' |
';
- if ($deeper) {
+ if ($deeper) {
- $keyArray = $this->ext_getTemplateHierarchyArr($arr[$key . '.'], $depthData . ($first ? '' : 'formWidth(4).' onChange="uFormUrl('.$aname.')" />';
+ $p_field .= ' , ' . $labels[$aa] . ':formWidth(4) . ' onChange="uFormUrl(' . $aname . ')" />';
} else {
- $p_field.='';
+ $p_field .= '';
}
}
break;
case 'options':
- if (is_array($typeDat['params'])) {
+ if (is_array($typeDat['params'])) {
- $p_field='';
+ $p_field = '';
foreach ($typeDat['params'] as $val) {
- $vParts = explode('=',$val,2);
+ $vParts = explode('=', $val, 2);
$label = $vParts[0];
$val = isset($vParts[1]) ? $vParts[1] : $vParts[0];
- // option tag:
+ // option tag:
- $sel='';
+ $sel = '';
- if ($val==$params['value']) {
+ if ($val == $params['value']) {
- $sel=' selected';
+ $sel = ' selected';
}
- $p_field.='';
+ $p_field .= '';
}
- $p_field='';
+ $p_field = '';
}
break;
case 'boolean':
- $p_field='';
+ $p_field = '';
- $sel='';
+ $sel = '';
- if ($fV) {
+ if ($fV) {
- $sel=' checked';
+ $sel = ' checked';
}
- $p_field.='';
+ $p_field .= '';
break;
case 'comment':
- $p_field='';
+ $p_field = '';
- $sel='';
+ $sel = '';
- if (!$fV) {
+ if (!$fV) {
- $sel=' checked';
+ $sel = ' checked';
}
- $p_field.='';
+ $p_field .= '';
break;
case 'file':
- $p_field='';
+ $p_field = '';
- $theImage='';
+ $theImage = '';
- $selectThisFile = $this->extractFromResources($this->setup['resources'],$params['value']);
+ $selectThisFile = $this->extractFromResources($this->setup['resources'], $params['value']);
- if ($params['value'] && !$selectThisFile) {
+ if ($params['value'] && !$selectThisFile) {
- if (in_array($params['value'],$this->dirResources)) {
+ if (in_array($params['value'], $this->dirResources)) {
- $selectThisFile=$params['value'];
+ $selectThisFile = $params['value'];
}
}
- // extensionlist
+ // extensionlist
$extList = $typeDat['paramstr'];
- $p_field='';
+ $p_field = '';
- if ($extList=='IMAGE_EXT') {
+ if ($extList == 'IMAGE_EXT') {
$extList = $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'];
}
reset($this->rArr);
- $onlineResourceFlag=$this->ext_defaultOnlineResourceFlag;
+ $onlineResourceFlag = $this->ext_defaultOnlineResourceFlag;
foreach ($this->rArr as $c => $val) {
- $val=trim($val);
+ $val = trim($val);
- $fI=t3lib_div::split_fileref($val);
+ $fI = t3lib_div::split_fileref($val);
- if ($val && (!$extList || t3lib_div::inList($extList,$fI['fileext']))) {
+ if ($val && (!$extList || t3lib_div::inList($extList, $fI['fileext']))) {
if ($onlineResourceFlag <= 0 && strstr($fI['path'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'])) {
- if ($onlineResourceFlag<0) {
+ if ($onlineResourceFlag < 0) {
- $p_field.='';
+ $p_field .= '';
}
- $p_field.='';
+ $p_field .= '';
- $onlineResourceFlag=1;
+ $onlineResourceFlag = 1;
}
- $dims=$this->resourceDimensions[$val];
+ $dims = $this->resourceDimensions[$val];
- $sel='';
+ $sel = '';
- // Check if $params['value'] is in the list of resources.
+ // Check if $params['value'] is in the list of resources.
- if ($selectThisFile && $selectThisFile==$val) {
+ if ($selectThisFile && $selectThisFile == $val) {
- $sel=' selected';
+ $sel = ' selected';
- if ($onlineResourceFlag<=0) {
+ if ($onlineResourceFlag <= 0) {
- $theImage=t3lib_BEfunc::thumbCode(array('resources'=>$selectThisFile),'sys_template','resources',$GLOBALS['BACK_PATH'],'');
+ $theImage = t3lib_BEfunc::thumbCode(
+ array(
+ 'resources' => $selectThisFile
+ ),
+ 'sys_template',
+ 'resources',
+ $GLOBALS['BACK_PATH'],
+ ''
+ );
} else {
- $theImage=t3lib_BEfunc::thumbCode(array('resources'=>$fI['file']),'sys_template','resources',$GLOBALS['BACK_PATH'],'',$fI['path']);
+ $theImage = t3lib_BEfunc::thumbCode(
+ array(
+ 'resources' => $fI['file']
+ ),
+ 'sys_template',
+ 'resources',
+ $GLOBALS['BACK_PATH'],
+ '',
+ $fI['path']
+ );
}
}
- if ($onlineResourceFlag<=0) {
+ if ($onlineResourceFlag <= 0) {
$onlineResourceFlag--;
- // Value is set with a *
+ // Value is set with a *
$val = $this->ext_setStar($val);
- $p_field.='';
+ $p_field .= '';
} else {
- $p_field.='';
+ $p_field .= '';
}
}
}
- if (trim($params['value']) && !$selectThisFile) {
+ if (trim($params['value']) && !$selectThisFile) {
$val = $params['value'];
- $p_field.='';
+ $p_field .= '';
- $p_field.='';
+ $p_field .= '';
}
- $p_field='';
+ $p_field = '';
- $p_field.=$theImage;
+ $p_field .= $theImage;
- if (!$this->ext_noCEUploadAndCopying) {
+ if (!$this->ext_noCEUploadAndCopying) {
- // Copy a resource
+ // Copy a resource
- $copyFile = $this->extractFromResources($this->setup['resources'],$params['value']);
+ $copyFile = $this->extractFromResources($this->setup['resources'], $params['value']);
- if (!$copyFile) {
+ if (!$copyFile) {
- if ($params['value']) {
+ if ($params['value']) {
- $copyFile=PATH_site.$this->ext_detectAndFixExtensionPrefix($params['value']);
+ $copyFile = PATH_site . $this->ext_detectAndFixExtensionPrefix($params['value']);
}
} else {
- $copyFile='';
+ $copyFile = '';
}
- if ($copyFile && @is_file($copyFile)) {
+ if ($copyFile && @is_file($copyFile)) {
- $p_field .= '
' . t3lib_iconWorks::getSpriteIcon('actions-edit-copy') . '';
+ $p_field .= '
' .
+ t3lib_iconWorks::getSpriteIcon('actions-edit-copy') . '';
}
- // Upload?
+ // Upload?
- $p_field.='
';
+ $p_field .= '
';
- $p_field.='formWidth().' onChange="uFormUrl('.$aname.')" size="50" />';
+ $p_field .= 'formWidth() .
+ ' onChange="uFormUrl(' . $aname . ')" size="50" />';
}
break;
case 'user':
- $userFunction = $typeDat['paramstr'];
+ $userFunction = $typeDat['paramstr'];
$userFunctionParams = array('fieldName' => $fN, 'fieldValue' => $fV);
- $p_field = t3lib_div::callUserFunction($userFunction, $userFunctionParams, $this, '');
+ $p_field = t3lib_div::callUserFunction($userFunction, $userFunctionParams, $this, '');
break;
case 'small':
default:
- $fwidth= $typeDat['type']=='small' ? 10 : 46;
+ $fwidth = $typeDat['type'] == 'small' ? 10 : 46;
- $p_field='formWidth($fwidth).' onChange="uFormUrl('.$aname.')" />';
+ $p_field = 'formWidth($fwidth) . ' onChange="uFormUrl(' . $aname . ')" />';
break;
}
- // Define default names and IDs
+ // Define default names and IDs
- $userTyposcriptID = 'userTS-'.$params['name'];
+ $userTyposcriptID = 'userTS-' . $params['name'];
- $defaultTyposcriptID = 'defaultTS-'.$params['name'];
+ $defaultTyposcriptID = 'defaultTS-' . $params['name'];
- $checkboxName = 'check['.$params['name'].']';
+ $checkboxName = 'check[' . $params['name'] . ']';
$checkboxID = $checkboxName;
- // Handle type=color specially
+ // Handle type=color specially
- if ($typeDat['type']=='color' && substr($params['value'],0,2)!='{$') {
+ if ($typeDat['type'] == 'color' && substr($params['value'], 0, 2) != '{$') {
- $color = '
';
+ $color = '
';
} else {
$color = '';
}
@@ -1359,7 +1412,7 @@
if (!$this->ext_dontCheckIssetValues) {
/* Set the default styling options */
- if(isset($this->objReg[$params['name']])) {
+ if (isset($this->objReg[$params['name']])) {
$checkboxValue = 'checked';
$userTyposcriptStyle = '';
$defaultTyposcriptStyle = 'style="display:none;"';
@@ -1370,27 +1423,47 @@
}
- $deleteIconHTML = t3lib_iconWorks::getSpriteIcon('actions-edit-undo',array('class'=>"typo3-tstemplate-ceditor-control undoIcon",'alt'=>"Revert to default Constant",'title'=>"Revert to default Constant",'rel'=>$params['name']));
- $editIconHTML = t3lib_iconWorks::getSpriteIcon('actions-document-open',array('class'=>"typo3-tstemplate-ceditor-control editIcon",'alt'=>"Edit this Constant",'title'=>"Edit this Constant",'rel'=>$params['name']));
+ $deleteIconHTML = t3lib_iconWorks::getSpriteIcon(
+ 'actions-edit-undo',
+ array(
+ 'class' => "typo3-tstemplate-ceditor-control undoIcon",
+ 'alt' => "Revert to default Constant",
+ 'title' => "Revert to default Constant",
+ 'rel' => $params['name']
+ )
+ );
+ $editIconHTML = t3lib_iconWorks::getSpriteIcon(
+ 'actions-document-open',
+ array(
+ 'class' => "typo3-tstemplate-ceditor-control editIcon",
+ 'alt' => "Edit this Constant",
+ 'title' => "Edit this Constant",
+ 'rel' => $params['name']
+ )
+ );
- $constantCheckbox = '';
+ $constantCheckbox = '';
- // If there's no default value for the field, use a static label.
+ // If there's no default value for the field, use a static label.
- if(!$params['default_value']) {
+ if (!$params['default_value']) {
$params['default_value'] = '[Empty]';
}
- $constantDefaultRow=''.$editIconHTML.htmlspecialchars($params['default_value']).$color.'
';
+ $constantDefaultRow = '' . $editIconHTML .
+ htmlspecialchars($params['default_value']) . $color . '
';
}
- $constantEditRow = ''.$deleteIconHTML.$p_field.$color.'
';
+ $constantEditRow = '' . $deleteIconHTML . $p_field . $color . '
';
- $constantLabel = ''.htmlspecialchars($head).'';
+ $constantLabel = '' . htmlspecialchars($head) . '';
- $constantName = '['.$params['name'].']';
+ $constantName = '[' . $params['name'] . ']';
- $constantDescription = $body ? ''.htmlspecialchars($body).'' : '';
+ $constantDescription = $body ? '' . htmlspecialchars($body) . '' : '';
- $constantData = ''.$constantCheckbox.$constantEditRow.$constantDefaultRow.'';
+ $constantData = '' . $constantCheckbox . $constantEditRow . $constantDefaultRow . '';
- $output.=''.$help['constants'][$params['name']];
+ $output .= '' . $help['constants'][$params['name']];
- $output.=''.$constantLabel.$constantName.$constantDescription.$constantData.'
';
+ $output .= '' . $constantLabel . $constantName .
+ $constantDescription . $constantData . '
';
} else {
debug('Error. Constant did not exist. Should not happen.');
}
@@ -1400,16 +1473,6 @@
}
-
-
-
-
-
-
-
-
-
-
/***************************
*
* Processing input values
@@ -1420,12 +1483,13 @@
* @param [type] $constants: ...
* @return [type] ...
*/
- function ext_regObjectPositions($constants) {
+ function ext_regObjectPositions($constants) {
- // This runs through the lines of the constants-field of the active template and registers the constants-names and linepositions in an array, $this->objReg
+ // This runs through the lines of the constants-field of the active template and registers the constants-names
+ // and linepositions in an array, $this->objReg
- $this->raw = explode(LF,$constants);
+ $this->raw = explode(LF, $constants);
- $this->rawP=0;
+ $this->rawP = 0;
- $this->objReg=array(); // resetting the objReg if the divider is found!!
+ $this->objReg = array(); // resetting the objReg if the divider is found!!
$this->ext_regObjects('');
}
@@ -1435,36 +1499,36 @@
* @param [type] $pre: ...
* @return [type] ...
*/
- function ext_regObjects($pre) {
+ function ext_regObjects($pre) {
// works with regObjectPositions. "expands" the names of the TypoScript objects
- while (isset($this->raw[$this->rawP])) {
+ while (isset($this->raw[$this->rawP])) {
$line = ltrim($this->raw[$this->rawP]);
- if (strstr($line,$this->edit_divider)) {
+ if (strstr($line, $this->edit_divider)) {
- $this->objReg=array(); // resetting the objReg if the divider is found!!
+ $this->objReg = array(); // resetting the objReg if the divider is found!!
}
$this->rawP++;
- if ($line) {
+ if ($line) {
- if (substr($line,0,1)=='[') {
+ if (substr($line, 0, 1) == '[') {
-// return $line;
+ // return $line;
- } elseif (strcspn($line,'}#/')!=0) {
+ } elseif (strcspn($line, '}#/') != 0) {
- $varL = strcspn($line,' {=<');
+ $varL = strcspn($line, ' {=<');
- $var=substr($line,0,$varL);
+ $var = substr($line, 0, $varL);
- $line = ltrim(substr($line,$varL));
+ $line = ltrim(substr($line, $varL));
- switch(substr($line,0,1)) {
+ switch (substr($line, 0, 1)) {
case '=':
- $this->objReg[$pre.$var]=$this->rawP-1;
+ $this->objReg[$pre . $var] = $this->rawP - 1;
break;
case '{':
$this->ext_inBrace++;
- $this->ext_regObjects($pre.$var.'.');
+ $this->ext_regObjects($pre . $var . '.');
break;
}
- $this->lastComment='';
+ $this->lastComment = '';
- } elseif (substr($line,0,1)=='}') {
+ } elseif (substr($line, 0, 1) == '}') {
- $this->lastComment='';
+ $this->lastComment = '';
$this->ext_inBrace--;
- if ($this->ext_inBrace<0) {
+ if ($this->ext_inBrace < 0) {
- $this->ext_inBrace=0;
+ $this->ext_inBrace = 0;
} else {
break;
}
@@ -1480,21 +1544,21 @@
* @param [type] $var: ...
* @return [type] ...
*/
- function ext_putValueInConf($key, $var) {
+ function ext_putValueInConf($key, $var) {
// Puts the value $var to the TypoScript value $key in the current lines of the templates.
// If the $key is not found in the template constants field, a new line is inserted in the bottom.
- $theValue = ' '.trim($var);
+ $theValue = ' ' . trim($var);
- if (isset($this->objReg[$key])) {
+ if (isset($this->objReg[$key])) {
$lineNum = $this->objReg[$key];
- $parts = explode('=',$this->raw[$lineNum],2);
+ $parts = explode('=', $this->raw[$lineNum], 2);
- if (count($parts)==2) {
+ if (count($parts) == 2) {
- $parts[1]= $theValue;
+ $parts[1] = $theValue;
}
- $this->raw[$lineNum]=implode($parts,'=');
+ $this->raw[$lineNum] = implode($parts, '=');
} else {
- $this->raw[]=$key.' ='.$theValue;
+ $this->raw[] = $key . ' =' . $theValue;
}
- $this->changed=1;
+ $this->changed = 1;
}
/**
@@ -1503,13 +1567,13 @@
* @param [type] $key: ...
* @return [type] ...
*/
- function ext_removeValueInConf($key) {
+ function ext_removeValueInConf($key) {
// Removes the value in the configuration
- if (isset($this->objReg[$key])) {
+ if (isset($this->objReg[$key])) {
$lineNum = $this->objReg[$key];
unset($this->raw[$lineNum]);
}
- $this->changed=1;
+ $this->changed = 1;
}
/**
@@ -1519,22 +1583,22 @@
* @param [type] $settings: ...
* @return [type] ...
*/
- function ext_depthKeys($arr,$settings) {
+ function ext_depthKeys($arr, $settings) {
- $tsbrArray=array();
+ $tsbrArray = array();
foreach ($arr as $theK => $theV) {
- $theKeyParts = explode('.',$theK);
+ $theKeyParts = explode('.', $theK);
- $depth='';
+ $depth = '';
- $c=count($theKeyParts);
+ $c = count($theKeyParts);
- $a=0;
+ $a = 0;
foreach ($theKeyParts as $p) {
$a++;
- $depth.=($depth?'.':'').$p;
+ $depth .= ($depth ? '.' : '') . $p;
- $tsbrArray[$depth]= ($c==$a) ? $theV : 1;
+ $tsbrArray[$depth] = ($c == $a) ? $theV : 1;
}
}
// Modify settings
foreach ($tsbrArray as $theK => $theV) {
- if ($theV) {
+ if ($theV) {
$settings[$theK] = 1;
} else {
unset($settings[$theK]);
@@ -1552,80 +1616,80 @@
* @param [type] $tplRow: ...
* @return [type] ...
*/
- function ext_procesInput($http_post_vars,$http_post_files,$theConstants,$tplRow) {
+ function ext_procesInput($http_post_vars, $http_post_files, $theConstants, $tplRow) {
- $data=$http_post_vars['data'];
+ $data = $http_post_vars['data'];
- $check=$http_post_vars['check'];
+ $check = $http_post_vars['check'];
- $copyResource=$http_post_vars['_copyResource'];
+ $copyResource = $http_post_vars['_copyResource'];
- $Wdata=$http_post_vars['Wdata'];
+ $Wdata = $http_post_vars['Wdata'];
- $W2data=$http_post_vars['W2data'];
+ $W2data = $http_post_vars['W2data'];
- $W3data=$http_post_vars['W3data'];
+ $W3data = $http_post_vars['W3data'];
- $W4data=$http_post_vars['W4data'];
+ $W4data = $http_post_vars['W4data'];
- $W5data=$http_post_vars['W5data'];
+ $W5data = $http_post_vars['W5data'];
- if (is_array($data)) {
+ if (is_array($data)) {
foreach ($data as $key => $var) {
- if (isset($theConstants[$key])) {
+ if (isset($theConstants[$key])) {
- if ($this->ext_dontCheckIssetValues || isset($check[$key])) { // If checkbox is set, update the value
+ if ($this->ext_dontCheckIssetValues || isset($check[$key])) { // If checkbox is set, update the value
- list($var) = explode(LF,$var); // exploding with linebreak, just to make sure that no multiline input is given!
+ list($var) = explode(LF, $var); // exploding with linebreak, just to make sure that no multiline input is given!
- $typeDat=$this->ext_getTypeData($theConstants[$key]['type']);
+ $typeDat = $this->ext_getTypeData($theConstants[$key]['type']);
- switch($typeDat['type']) {
+ switch ($typeDat['type']) {
case 'int':
- if ($typeDat['paramstr']) {
+ if ($typeDat['paramstr']) {
- $var=t3lib_div::intInRange($var,$typeDat['params'][0],$typeDat['params'][1]);
+ $var = t3lib_div::intInRange($var, $typeDat['params'][0], $typeDat['params'][1]);
} else {
- $var=intval($var);
+ $var = intval($var);
}
break;
case 'int+':
$var = max(0, intval($var));
- break;
+ break;
case 'color':
- $col=array();
+ $col = array();
- if($var && !t3lib_div::inList($this->HTMLcolorList,strtolower($var))) {
+ if ($var && !t3lib_div::inList($this->HTMLcolorList, strtolower($var))) {
- $var = preg_replace('/[^A-Fa-f0-9]*/','',$var);
+ $var = preg_replace('/[^A-Fa-f0-9]*/', '', $var);
$useFullHex = strlen($var) > 3;
- $col[]=HexDec(substr($var,0,1));
+ $col[] = HexDec(substr($var, 0, 1));
- $col[]=HexDec(substr($var,1,1));
+ $col[] = HexDec(substr($var, 1, 1));
- $col[]=HexDec(substr($var,2,1));
+ $col[] = HexDec(substr($var, 2, 1));
- if($useFullHex) {
+ if ($useFullHex) {
- $col[]=HexDec(substr($var,3,1));
+ $col[] = HexDec(substr($var, 3, 1));
- $col[]=HexDec(substr($var,4,1));
+ $col[] = HexDec(substr($var, 4, 1));
- $col[]=HexDec(substr($var,5,1));
+ $col[] = HexDec(substr($var, 5, 1));
}
- $var = substr('0'.DecHex($col[0]),-1).substr('0'.DecHex($col[1]),-1).substr('0'.DecHex($col[2]),-1);
+ $var = substr('0' . DecHex($col[0]), -1) . substr('0' . DecHex($col[1]), -1) . substr('0' . DecHex($col[2]), -1);
- if($useFullHex) {
+ if ($useFullHex) {
- $var .= substr('0'.DecHex($col[3]),-1).substr('0'.DecHex($col[4]),-1).substr('0'.DecHex($col[5]),-1);
+ $var .= substr('0' . DecHex($col[3]), -1) . substr('0' . DecHex($col[4]), -1) . substr('0' . DecHex($col[5]), -1);
}
- $var = '#'.strtoupper($var);
+ $var = '#' . strtoupper($var);
}
break;
case 'comment':
- if ($var) {
+ if ($var) {
- $var='#';
+ $var = '#';
} else {
- $var='';
+ $var = '';
}
break;
case 'wrap':
- if (isset($Wdata[$key])) {
+ if (isset($Wdata[$key])) {
- $var.='|'.$Wdata[$key];
+ $var .= '|' . $Wdata[$key];
}
break;
case 'offset':
- if (isset($Wdata[$key])) {
+ if (isset($Wdata[$key])) {
- $var=intval($var).','.intval($Wdata[$key]);
+ $var = intval($var) . ',' . intval($Wdata[$key]);
- if (isset($W2data[$key])) {
+ if (isset($W2data[$key])) {
- $var.=','.intval($W2data[$key]);
+ $var .= ',' . intval($W2data[$key]);
- if (isset($W3data[$key])) {
+ if (isset($W3data[$key])) {
- $var.=','.intval($W3data[$key]);
+ $var .= ',' . intval($W3data[$key]);
- if (isset($W4data[$key])) {
+ if (isset($W4data[$key])) {
- $var.=','.intval($W4data[$key]);
+ $var .= ',' . intval($W4data[$key]);
- if (isset($W5data[$key])) {
+ if (isset($W5data[$key])) {
- $var.=','.intval($W5data[$key]);
+ $var .= ',' . intval($W5data[$key]);
}
}
}
@@ -1633,13 +1697,13 @@
}
break;
case 'boolean':
- if ($var) {
+ if ($var) {
$var = $typeDat['paramstr'] ? $typeDat['paramstr'] : 1;
}
break;
case 'file':
- if (!$this->ext_noCEUploadAndCopying) {
+ if (!$this->ext_noCEUploadAndCopying) {
- if ($http_post_files['upload_data']['name'][$key] && $http_post_files['upload_data']['tmp_name'][$key]!='none') {
+ if ($http_post_files['upload_data']['name'][$key] && $http_post_files['upload_data']['tmp_name'][$key] != 'none') {
$var = $this->upload_copy_file(
$typeDat,
$tplRow,
@@ -1647,7 +1711,7 @@
$http_post_files['upload_data']['tmp_name'][$key]
);
}
- if ($copyResource[$key]) {
+ if ($copyResource[$key]) {
$var = $this->upload_copy_file(
$typeDat,
$tplRow,
@@ -1658,10 +1722,10 @@
}
break;
}
- if ($this->ext_printAll || strcmp($theConstants[$key]['value'],$var)) {
+ if ($this->ext_printAll || strcmp($theConstants[$key]['value'], $var)) {
- $this->ext_putValueInConf($key, $var); // Put value in, if changed.
+ $this->ext_putValueInConf($key, $var); // Put value in, if changed.
}
- unset($check[$key]); // Remove the entry because it has been "used"
+ unset($check[$key]); // Remove the entry because it has been "used"
} else {
$this->ext_removeValueInConf($key);
}
@@ -1669,9 +1733,9 @@
}
}
// Remaining keys in $check indicates fields that are just clicked "on" to be edited. Therefore we get the default value and puts that in the template as a start...
- if (!$this->ext_dontCheckIssetValues && is_array($check)) {
+ if (!$this->ext_dontCheckIssetValues && is_array($check)) {
foreach ($check as $key => $var) {
- if (isset($theConstants[$key])) {
+ if (isset($theConstants[$key])) {
$dValue = $theConstants[$key]['default_value'];
$this->ext_putValueInConf($key, $dValue);
}
@@ -1688,39 +1752,39 @@
* @param [type] $tmp_name: ...
* @return [type] ...
*/
- function upload_copy_file($typeDat,&$tplRow,$theRealFileName,$tmp_name) {
+ function upload_copy_file($typeDat, &$tplRow, $theRealFileName, $tmp_name) {
// extensions
$extList = $typeDat['paramstr'];
- if ($extList=='IMAGE_EXT') {
+ if ($extList == 'IMAGE_EXT') {
$extList = $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'];
}
- $fI=t3lib_div::split_fileref($theRealFileName);
+ $fI = t3lib_div::split_fileref($theRealFileName);
- if ($theRealFileName && (!$extList || t3lib_div::inList($extList,$fI['fileext']))) {
+ if ($theRealFileName && (!$extList || t3lib_div::inList($extList, $fI['fileext']))) {
- $tmp_upload_name = t3lib_div::upload_to_tempfile($tmp_name); // If there is an uploaded file, move it for the sake of safe_mode.
+ $tmp_upload_name = t3lib_div::upload_to_tempfile($tmp_name); // If there is an uploaded file, move it for the sake of safe_mode.
// Saving resource
- $alternativeFileName=array();
+ $alternativeFileName = array();
$alternativeFileName[$tmp_upload_name] = $theRealFileName;
// Making list of resources
$resList = $tplRow['resources'];
- $resList = $tmp_upload_name.','.$resList;
+ $resList = $tmp_upload_name . ',' . $resList;
- $resList=implode(t3lib_div::trimExplode(',',$resList,1),',');
+ $resList = implode(t3lib_div::trimExplode(',', $resList, 1), ',');
// Making data-array
$saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
- $recData=array();
+ $recData = array();
$recData['sys_template'][$saveId]['resources'] = $resList;
// Saving
$tce = t3lib_div::makeInstance('t3lib_TCEmain');
- $tce->stripslashes_values=0;
+ $tce->stripslashes_values = 0;
$tce->alternativeFileName = $alternativeFileName;
- $tce->start($recData,Array());
+ $tce->start($recData, Array());
$tce->process_datamap();
t3lib_div::unlink_tempfile($tmp_upload_name);
- $tmpRow = t3lib_BEfunc::getRecordWSOL('sys_template',$saveId,'resources');
+ $tmpRow = t3lib_BEfunc::getRecordWSOL('sys_template', $saveId, 'resources');
$tplRow['resources'] = $tmpRow['resources'];
@@ -1737,10 +1801,10 @@
* @param [type] $perms_clause: ...
* @return [type] ...
*/
- function ext_prevPageWithTemplate($id,$perms_clause) {
+ function ext_prevPageWithTemplate($id, $perms_clause) {
- $rootLine = t3lib_BEfunc::BEgetRootLine($id,$perms_clause?' AND '.$perms_clause:'');
+ $rootLine = t3lib_BEfunc::BEgetRootLine($id, $perms_clause ? ' AND ' . $perms_clause : '');
foreach ($rootLine as $p) {
- if ($this->ext_getFirstTemplate($p['uid'])) {
+ if ($this->ext_getFirstTemplate($p['uid'])) {
return $p;
}
}
@@ -1752,9 +1816,9 @@
* @param [type] $val: ...
* @return [type] ...
*/
- function ext_setStar($val) {
+ function ext_setStar($val) {
- $fParts = explode('.',strrev($val),2);
+ $fParts = explode('.', strrev($val), 2);
- $val=preg_replace('/_[0-9][0-9]$/','',strrev($fParts[1])).'*.'.strrev($fParts[0]);
+ $val = preg_replace('/_[0-9][0-9]$/', '', strrev($fParts[1])) . '*.' . strrev($fParts[0]);
return $val;
}
@@ -1764,12 +1828,12 @@
* @param [type] $value: ...
* @return [type] ...
*/
- function ext_detectAndFixExtensionPrefix($value) {
+ function ext_detectAndFixExtensionPrefix($value) {
- if (substr($value,0,4)=='EXT:') {
+ if (substr($value, 0, 4) == 'EXT:') {
- $parts = explode('/',substr($value,4),2);
+ $parts = explode('/', substr($value, 4), 2);
$extPath = t3lib_extMgm::siteRelPath($parts[0]);
- $value = $extPath.$parts[1];
+ $value = $extPath . $parts[1];
return $value;
} else {
return $value;
@@ -1778,7 +1842,7 @@
}
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tsparser_ext.php']) {
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tsparser_ext.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tsparser_ext.php']);
}