Index: t3lib/class.t3lib_befunc.php
===================================================================
--- t3lib/class.t3lib_befunc.php (revision 9522)
+++ t3lib/class.t3lib_befunc.php (revision )
@@ -1,29 +1,29 @@
exec_SELECTquery(
$fields,
$table,
- 'uid=' . intval($uid) . ($useDeleteClause ? self::deleteClause($table) : '') . $where
+ 'uid=' . intval($uid) . ($useDeleteClause ? self::deleteClause($table) : '') . $where
);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
@@ -251,13 +249,13 @@
* @param boolean Use the deleteClause to check if a record is deleted (default true)
* @return array Returns the row if found, otherwise nothing
*/
- public static function getRecordWSOL($table, $uid, $fields = '*', $where = '', $useDeleteClause = true) {
+ public static function getRecordWSOL($table, $uid, $fields = '*', $where = '', $useDeleteClause = TRUE) {
if ($fields !== '*') {
- $internalFields = t3lib_div::uniqueList($fields.',uid,pid'.($table == 'pages' ? ',t3ver_swapmode' : ''));
+ $internalFields = t3lib_div::uniqueList($fields . ',uid,pid' . ($table == 'pages' ? ',t3ver_swapmode' : ''));
$row = self::getRecord($table, $uid, $internalFields, $where, $useDeleteClause);
self::workspaceOL($table, $row);
- if (is_array ($row)) {
+ if (is_array($row)) {
foreach (array_keys($row) as $key) {
if (!t3lib_div::inList($fields, $key) && $key{0} !== '_') {
unset ($row[$key]);
@@ -309,28 +307,30 @@
* @param boolean Use the deleteClause to check if a record is deleted (default true)
* @return mixed Multidimensional array with selected records (if any is selected)
*/
- public static function getRecordsByField($theTable, $theField, $theValue, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '', $useDeleteClause = true) {
+ public static function getRecordsByField($theTable, $theField, $theValue, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '', $useDeleteClause = TRUE) {
global $TCA;
if (is_array($TCA[$theTable])) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
- '*',
- $theTable,
+ '*',
+ $theTable,
- $theField.'='.$GLOBALS['TYPO3_DB']->fullQuoteStr($theValue, $theTable).
+ $theField . '=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($theValue, $theTable) .
- ($useDeleteClause ? self::deleteClause($theTable).' ' : '').
+ ($useDeleteClause ? self::deleteClause($theTable) . ' ' : '') .
self::versioningPlaceholderClause($theTable) . ' ' .
- $whereClause, // whereClauseMightContainGroupOrderBy
+ $whereClause, // whereClauseMightContainGroupOrderBy
- $groupBy,
- $orderBy,
- $limit
- );
+ $groupBy,
+ $orderBy,
+ $limit
+ );
$rows = array();
- while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+ while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$rows[] = $row;
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
- if (count($rows)) return $rows;
+ if (count($rows)) {
+ return $rows;
- }
- }
+ }
+ }
+ }
/**
* Returns a WHERE clause which will make an AND search for the words in the $searchWords array in any of the fields in array $fields.
@@ -390,18 +390,20 @@
*/
public static function getSQLselectableList($in_list, $tablename, $default_tablename) {
$list = Array();
- if ((string)trim($in_list)!='') {
+ if ((string) trim($in_list) != '') {
$tempItemArray = explode(',', trim($in_list));
foreach ($tempItemArray as $key => $val) {
$val = strrev($val);
$parts = explode('_', $val, 2);
- if ((string)trim($parts[0])!='') {
+ if ((string) trim($parts[0]) != '') {
$theID = intval(strrev($parts[0]));
$theTable = trim($parts[1]) ? strrev(trim($parts[1])) : $default_tablename;
- if ($theTable==$tablename) {$list[] = $theID;}
+ if ($theTable == $tablename) {
+ $list[] = $theID;
- }
- }
- }
+ }
+ }
+ }
+ }
return implode(',', $list);
}
@@ -423,19 +425,19 @@
if (is_array($ctrl)) {
if (is_array($ctrl['enablecolumns'])) {
if ($ctrl['enablecolumns']['disabled']) {
- $field = $table.'.'.$ctrl['enablecolumns']['disabled'];
+ $field = $table . '.' . $ctrl['enablecolumns']['disabled'];
- $query[] = $field.'=0';
+ $query[] = $field . '=0';
- $invQuery[] = $field.'!=0';
+ $invQuery[] = $field . '!=0';
}
if ($ctrl['enablecolumns']['starttime']) {
- $field = $table.'.'.$ctrl['enablecolumns']['starttime'];
+ $field = $table . '.' . $ctrl['enablecolumns']['starttime'];
- $query[] = '('.$field.'<='.$GLOBALS['SIM_ACCESS_TIME'].')';
+ $query[] = '(' . $field . '<=' . $GLOBALS['SIM_ACCESS_TIME'] . ')';
- $invQuery[] = '('.$field.'!=0 AND '.$field.'>'.$GLOBALS['SIM_ACCESS_TIME'].')';
+ $invQuery[] = '(' . $field . '!=0 AND ' . $field . '>' . $GLOBALS['SIM_ACCESS_TIME'] . ')';
}
if ($ctrl['enablecolumns']['endtime']) {
- $field = $table.'.'.$ctrl['enablecolumns']['endtime'];
+ $field = $table . '.' . $ctrl['enablecolumns']['endtime'];
- $query[] = '('.$field.'=0 OR '.$field.'>'.$GLOBALS['SIM_ACCESS_TIME'].')';
+ $query[] = '(' . $field . '=0 OR ' . $field . '>' . $GLOBALS['SIM_ACCESS_TIME'] . ')';
- $invQuery[] = '('.$field.'!=0 AND '.$field.'<='.$GLOBALS['SIM_ACCESS_TIME'].')';
+ $invQuery[] = '(' . $field . '!=0 AND ' . $field . '<=' . $GLOBALS['SIM_ACCESS_TIME'] . ')';
}
}
}
@@ -454,14 +456,14 @@
* @return mixed Multidimensional array with selected records; if none exist, false is returned
*/
public static function getRecordLocalization($table, $uid, $language, $andWhereClause = '') {
- $recordLocalization = false;
+ $recordLocalization = FALSE;
if (self::isTableLocalizable($table)) {
$tcaCtrl = $GLOBALS['TCA'][$table]['ctrl'];
$recordLocalization = self::getRecordsByField(
$table,
$tcaCtrl['transOrigPointerField'],
$uid,
- 'AND '.$tcaCtrl['languageField'].'='.intval($language).($andWhereClause ? ' '.$andWhereClause : ''),
+ 'AND ' . $tcaCtrl['languageField'] . '=' . intval($language) . ($andWhereClause ? ' ' . $andWhereClause : ''),
'',
'',
'1'
@@ -471,14 +473,6 @@
}
-
-
-
-
-
-
-
-
/*******************************************
*
* SQL-related, DEPRECATED functions
@@ -509,14 +503,14 @@
t3lib_div::logDeprecatedFunction();
$query = $GLOBALS['TYPO3_DB']->SELECTquery(
- $select,
+ $select,
- $local_table.','.$mm_table.($foreign_table?','.$foreign_table:''),
+ $local_table . ',' . $mm_table . ($foreign_table ? ',' . $foreign_table : ''),
- $local_table.'.uid='.$mm_table.'.uid_local'.($foreign_table?' AND '.$foreign_table.'.uid='.$mm_table.'.uid_foreign':'').' '.
+ $local_table . '.uid=' . $mm_table . '.uid_local' . ($foreign_table ? ' AND ' . $foreign_table . '.uid=' . $mm_table . '.uid_foreign' : '') . ' ' .
- $whereClause, // whereClauseMightContainGroupOrderBy
+ $whereClause, // whereClauseMightContainGroupOrderBy
- $groupBy,
- $orderBy,
- $limit
- );
+ $groupBy,
+ $orderBy,
+ $limit
+ );
return $query;
}
@@ -552,14 +546,6 @@
}
-
-
-
-
-
-
-
-
/*******************************************
*
* Page tree, TCA related
@@ -648,9 +634,9 @@
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pid,uid,title,TSconfig,is_siteroot,storage_pid,t3ver_oid,t3ver_wsid,t3ver_state,t3ver_swapmode,t3ver_stage,be_layout',
'pages',
- 'uid=' . intval($uid) . ' ' .
- self::deleteClause('pages') . ' ' .
+ 'uid=' . intval($uid) . ' ' .
+ self::deleteClause('pages') . ' ' .
- $clause // whereClauseMightContainGroupOrderBy
+ $clause // whereClauseMightContainGroupOrderBy
);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
@@ -691,7 +677,7 @@
// First, find out what mount index to use (if more than one DB mount exists):
$mountIndex = 0;
$mountKeys = array_flip($BE_USER->returnWebmounts());
- foreach($rL as $rLDat) {
+ foreach ($rL as $rLDat) {
if (isset($mountKeys[$rLDat['uid']])) {
$mountIndex = $mountKeys[$rLDat['uid']];
break;
@@ -699,7 +685,7 @@
}
// Traverse rootline and open paths:
- foreach($rL as $rLDat) {
+ foreach ($rL as $rLDat) {
$expandedPages[$mountIndex][$rLDat['uid']] = 1;
}
@@ -721,7 +707,9 @@
* @return mixed Path of record (string) OR array with short/long title if $fullTitleLimit is set.
*/
public static function getRecordPath($uid, $clause, $titleLimit, $fullTitleLimit = 0) {
- if (!$titleLimit) { $titleLimit = 1000; }
+ if (!$titleLimit) {
+ $titleLimit = 1000;
+ }
$loopCheck = 100;
$output = $fullOutput = '/';
@@ -736,8 +724,8 @@
if ($record['uid'] === 0) {
continue;
}
- if ($record['_ORIG_pid'] && $record['t3ver_swapmode'] > 0) { // Branch points
+ if ($record['_ORIG_pid'] && $record['t3ver_swapmode'] > 0) { // Branch points
- $output = ' [#VEP#]' . $output; // Adding visual token - Versioning Entry Point - that tells that THIS position was where the versionized branch got connected to the main tree. I will have to find a better name or something...
+ $output = ' [#VEP#]' . $output; // Adding visual token - Versioning Entry Point - that tells that THIS position was where the versionized branch got connected to the main tree. I will have to find a better name or something...
}
$output = '/' . t3lib_div::fixed_lgd_cs(strip_tags($record['title']), $titleLimit) . $output;
if ($fullTitleLimit) {
@@ -764,18 +752,18 @@
// All TCA keys:
$theExcludeArray = Array();
$tc_keys = array_keys($TCA);
- foreach($tc_keys as $table) {
+ foreach ($tc_keys as $table) {
// Load table
t3lib_div::loadTCA($table);
// All field names configured:
if (is_array($TCA[$table]['columns'])) {
$f_keys = array_keys($TCA[$table]['columns']);
- foreach($f_keys as $field) {
+ foreach ($f_keys as $field) {
if ($TCA[$table]['columns'][$field]['exclude']) {
// Get Human Readable names of fields and table:
- $Fname = $GLOBALS['LANG']->sl($TCA[$table]['ctrl']['title']).': '.$GLOBALS['LANG']->sl($TCA[$table]['columns'][$field]['label']);
+ $Fname = $GLOBALS['LANG']->sl($TCA[$table]['ctrl']['title']) . ': ' . $GLOBALS['LANG']->sl($TCA[$table]['columns'][$field]['label']);
// add entry:
- $theExcludeArray[] = Array($Fname, $table.':'.$field);
+ $theExcludeArray[] = Array($Fname, $table . ':' . $field);
}
}
}
@@ -834,7 +822,7 @@
// All TCA keys:
$allowDenyOptions = Array();
$tc_keys = array_keys($TCA);
- foreach($tc_keys as $table) {
+ foreach ($tc_keys as $table) {
// Load table
t3lib_div::loadTCA($table);
@@ -842,40 +830,40 @@
// All field names configured:
if (is_array($TCA[$table]['columns'])) {
$f_keys = array_keys($TCA[$table]['columns']);
- foreach($f_keys as $field) {
+ foreach ($f_keys as $field) {
$fCfg = $TCA[$table]['columns'][$field]['config'];
- if ($fCfg['type']=='select' && $fCfg['authMode']) {
+ if ($fCfg['type'] == 'select' && $fCfg['authMode']) {
// Check for items:
if (is_array($fCfg['items'])) {
// Get Human Readable names of fields and table:
- $allowDenyOptions[$table.':'.$field]['tableFieldLabel'] = $GLOBALS['LANG']->sl($TCA[$table]['ctrl']['title']).': '.$GLOBALS['LANG']->sl($TCA[$table]['columns'][$field]['label']);
+ $allowDenyOptions[$table . ':' . $field]['tableFieldLabel'] = $GLOBALS['LANG']->sl($TCA[$table]['ctrl']['title']) . ': ' . $GLOBALS['LANG']->sl($TCA[$table]['columns'][$field]['label']);
// Check for items:
- foreach($fCfg['items'] as $iVal) {
+ foreach ($fCfg['items'] as $iVal) {
- if (strcmp($iVal[1], '')) { // Values '' is not controlled by this setting.
+ if (strcmp($iVal[1], '')) { // Values '' is not controlled by this setting.
// Find iMode:
$iMode = '';
- switch((string)$fCfg['authMode']) {
+ switch ((string) $fCfg['authMode']) {
case 'explicitAllow':
$iMode = 'ALLOW';
- break;
+ break;
case 'explicitDeny':
$iMode = 'DENY';
- break;
+ break;
case 'individual':
if (!strcmp($iVal[4], 'EXPL_ALLOW')) {
$iMode = 'ALLOW';
} elseif (!strcmp($iVal[4], 'EXPL_DENY')) {
$iMode = 'DENY';
}
- break;
+ break;
}
// Set iMode:
if ($iMode) {
- $allowDenyOptions[$table.':'.$field]['items'][$iVal[1]] = array($iMode, $GLOBALS['LANG']->sl($iVal[0]), $adLabel[$iMode]);
+ $allowDenyOptions[$table . ':' . $field]['items'][$iVal[1]] = array($iMode, $GLOBALS['LANG']->sl($iVal[0]), $adLabel[$iMode]);
}
}
}
@@ -898,11 +886,11 @@
*
* @return array Array with languages (title, uid, flagIcon)
*/
- public static function getSystemLanguages() {
+ public static function getSystemLanguages() {
$languages = t3lib_div::makeInstance('t3lib_transl8tools')->getSystemLanguages();
$sysLanguages = array();
foreach ($languages as $language) {
- if($language['uid'] !== -1) {
+ if ($language['uid'] !== -1) {
$sysLanguages[] = array(
0 => htmlspecialchars($language['title']) . ' [' . $language['uid'] . ']',
1 => $language['uid'],
@@ -921,7 +909,7 @@
* @return boolean Whether a table is localizable
*/
public static function isTableLocalizable($table) {
- $isLocalizable = false;
+ $isLocalizable = FALSE;
if (isset($GLOBALS['TCA'][$table]['ctrl']) && is_array($GLOBALS['TCA'][$table]['ctrl'])) {
$tcaCtrl = $GLOBALS['TCA'][$table]['ctrl'];
$isLocalizable = (isset($tcaCtrl['languageField']) && $tcaCtrl['languageField'] && isset($tcaCtrl['transOrigPointerField']) && $tcaCtrl['transOrigPointerField']);
@@ -939,17 +927,17 @@
* @return mixed If table is localizable, the set localizationMode is returned (if property is not set, 'select' is returned by default); if table is not localizable, false is returned
*/
public static function getInlineLocalizationMode($table, $fieldOrConfig) {
- $localizationMode = false;
+ $localizationMode = FALSE;
if (is_array($fieldOrConfig) && count($fieldOrConfig)) {
$config = $fieldOrConfig;
} elseif (is_string($fieldOrConfig) && isset($GLOBALS['TCA'][$table]['columns'][$fieldOrConfig]['config'])) {
$config = $GLOBALS['TCA'][$table]['columns'][$fieldOrConfig]['config'];
}
- if (is_array($config) && isset($config['type']) && $config['type']=='inline' && self::isTableLocalizable($table)) {
+ if (is_array($config) && isset($config['type']) && $config['type'] == 'inline' && self::isTableLocalizable($table)) {
$localizationMode = (isset($config['behaviour']['localizationMode']) && $config['behaviour']['localizationMode'] ? $config['behaviour']['localizationMode'] : 'select');
// The mode 'select' is not possible when child table is not localizable at all:
- if ($localizationMode=='select' && !self::isTableLocalizable($config['foreign_table'])) {
+ if ($localizationMode == 'select' && !self::isTableLocalizable($config['foreign_table'])) {
- $localizationMode = false;
+ $localizationMode = FALSE;
}
}
return $localizationMode;
@@ -966,7 +954,7 @@
* @return array Returns page record if OK, otherwise false.
*/
public static function readPageAccess($id, $perms_clause) {
- if ((string)$id!='') {
+ if ((string) $id != '') {
$id = intval($id);
if (!$id) {
if ($GLOBALS['BE_USER']->isAdmin()) {
@@ -986,7 +974,7 @@
}
}
}
- return false;
+ return FALSE;
}
/**
@@ -1002,7 +990,7 @@
global $TCA;
t3lib_div::loadTCA($table);
- if ($TCA[$table]) {
+ if ($TCA[$table]) {
// Get type value:
$fieldValue = self::getTCAtypeValue($table, $rec);
@@ -1015,7 +1003,7 @@
$altFieldList = array();
// Traverse fields in types config and parse the configuration into a nice array:
- foreach($fieldList as $k => $v) {
+ foreach ($fieldList as $k => $v) {
list($pFieldName, $pAltTitle, $pPalette, $pSpec) = t3lib_div::trimExplode(';', $v);
$defaultExtras = is_array($TCA[$table]['columns'][$pFieldName]) ? $TCA[$table]['columns'][$pFieldName]['defaultExtras'] : '';
$specConfParts = self::getSpecConfParts($pSpec, $defaultExtras);
@@ -1059,7 +1047,9 @@
if ($TCA[$table]) {
$field = $TCA[$table]['ctrl']['type'];
$fieldValue = $field ? ($rec[$field] ? $rec[$field] : 0) : 0;
- if (!is_array($TCA[$table]['types'][$fieldValue])) $fieldValue = 1;
+ if (!is_array($TCA[$table]['types'][$fieldValue])) {
+ $fieldValue = 1;
+ }
return $fieldValue;
}
}
@@ -1074,14 +1064,14 @@
* @param string The ['defaultExtras'] value from field configuration
* @return array
*/
- public static function getSpecConfParts($str, $defaultExtras) {
+ public static function getSpecConfParts($str, $defaultExtras) {
// Add defaultExtras:
- $specConfParts = t3lib_div::trimExplode(':', $defaultExtras.':'.$str, 1);
+ $specConfParts = t3lib_div::trimExplode(':', $defaultExtras . ':' . $str, 1);
$reg = array();
if (count($specConfParts)) {
- foreach($specConfParts as $k2 => $v2) {
+ foreach ($specConfParts as $k2 => $v2) {
unset($specConfParts[$k2]);
if (preg_match('/(.*)\[(.*)\]/', $v2, $reg)) {
$specConfParts[trim($reg[1])] = array(
@@ -1110,7 +1100,7 @@
if (is_array($pArr)) {
foreach ($pArr as $k => $v) {
$parts = explode('=', $v, 2);
- if (count($parts)==2) {
+ if (count($parts) == 2) {
$out[trim($parts[0])] = trim($parts[1]);
} else {
$out[$k] = $v;
@@ -1138,27 +1128,27 @@
global $TYPO3_CONF_VARS;
// Get pointer field etc from TCA-config:
- $ds_pointerField = $conf['ds_pointerField'];
+ $ds_pointerField = $conf['ds_pointerField'];
- $ds_array = $conf['ds'];
+ $ds_array = $conf['ds'];
- $ds_tableField = $conf['ds_tableField'];
+ $ds_tableField = $conf['ds_tableField'];
- $ds_searchParentField = $conf['ds_pointerField_searchParent'];
+ $ds_searchParentField = $conf['ds_pointerField_searchParent'];
// Find source value:
$dataStructArray = '';
- if (is_array($ds_array)) { // If there is a data source array, that takes precedence
+ if (is_array($ds_array)) { // If there is a data source array, that takes precedence
// If a pointer field is set, take the value from that field in the $row array and use as key.
- if ($ds_pointerField) {
+ if ($ds_pointerField) {
// Up to two pointer fields can be specified in a comma separated list.
$pointerFields = t3lib_div::trimExplode(',', $ds_pointerField);
- if(count($pointerFields) == 2) { // If we have two pointer fields, the array keys should contain both field values separated by comma. The asterisk "*" catches all values. For backwards compatibility, it's also possible to specify only the value of the first defined ds_pointerField.
+ if (count($pointerFields) == 2) { // If we have two pointer fields, the array keys should contain both field values separated by comma. The asterisk "*" catches all values. For backwards compatibility, it's also possible to specify only the value of the first defined ds_pointerField.
- if($ds_array[$row[$pointerFields[0]].','.$row[$pointerFields[1]]]) { // Check if we have a DS for the combination of both pointer fields values
+ if ($ds_array[$row[$pointerFields[0]] . ',' . $row[$pointerFields[1]]]) { // Check if we have a DS for the combination of both pointer fields values
- $srcPointer = $row[$pointerFields[0]].','.$row[$pointerFields[1]];
+ $srcPointer = $row[$pointerFields[0]] . ',' . $row[$pointerFields[1]];
- } elseif($ds_array[$row[$pointerFields[1]].',*']) { // Check if we have a DS for the value of the first pointer field suffixed with ",*"
+ } elseif ($ds_array[$row[$pointerFields[1]] . ',*']) { // Check if we have a DS for the value of the first pointer field suffixed with ",*"
- $srcPointer = $row[$pointerFields[1]].',*';
+ $srcPointer = $row[$pointerFields[1]] . ',*';
- } elseif($ds_array['*,'.$row[$pointerFields[1]]]) { // Check if we have a DS for the value of the second pointer field prefixed with "*,"
+ } elseif ($ds_array['*,' . $row[$pointerFields[1]]]) { // Check if we have a DS for the value of the second pointer field prefixed with "*,"
- $srcPointer = '*,'.$row[$pointerFields[1]];
+ $srcPointer = '*,' . $row[$pointerFields[1]];
- } elseif($ds_array[$row[$pointerFields[0]]]) { // Check if we have a DS for just the value of the first pointer field (mainly for backwards compatibility)
+ } elseif ($ds_array[$row[$pointerFields[0]]]) { // Check if we have a DS for just the value of the first pointer field (mainly for backwards compatibility)
$srcPointer = $row[$pointerFields[0]];
}
} else {
@@ -1166,44 +1156,50 @@
}
$srcPointer = isset($ds_array[$srcPointer]) ? $srcPointer : 'default';
- } else $srcPointer = 'default';
+ } else {
+ $srcPointer = 'default';
+ }
// Get Data Source: Detect if it's a file reference and in that case read the file and parse as XML. Otherwise the value is expected to be XML.
- if (substr($ds_array[$srcPointer], 0, 5)=='FILE:') {
+ if (substr($ds_array[$srcPointer], 0, 5) == 'FILE:') {
$file = t3lib_div::getFileAbsFileName(substr($ds_array[$srcPointer], 5));
if ($file && @is_file($file)) {
$dataStructArray = t3lib_div::xml2array(t3lib_div::getUrl($file));
- } else $dataStructArray = 'The file "'.substr($ds_array[$srcPointer], 5).'" in ds-array key "'.$srcPointer.'" was not found ("'.$file.'")'; // Error message.
- } else {
+ } else {
+ $dataStructArray = 'The file "' . substr($ds_array[$srcPointer], 5) . '" in ds-array key "' . $srcPointer . '" was not found ("' . $file . '")';
+ } // Error message.
+ } else {
$dataStructArray = t3lib_div::xml2array($ds_array[$srcPointer]);
}
- } elseif ($ds_pointerField) { // If pointer field AND possibly a table/field is set:
+ } elseif ($ds_pointerField) { // If pointer field AND possibly a table/field is set:
// Value of field pointed to:
$srcPointer = $row[$ds_pointerField];
// Searching recursively back if 'ds_pointerField_searchParent' is defined (typ. a page rootline, or maybe a tree-table):
if ($ds_searchParentField && !$srcPointer) {
- $rr = self::getRecord($table, $row['uid'], 'uid,' . $ds_searchParentField); // Get the "pid" field - we cannot know that it is in the input record! ###NOTE_A###
+ $rr = self::getRecord($table, $row['uid'], 'uid,' . $ds_searchParentField); // Get the "pid" field - we cannot know that it is in the input record! ###NOTE_A###
if ($WSOL) {
self::workspaceOL($table, $rr);
- self::fixVersioningPid($table, $rr, TRUE); // Added "TRUE" 23/03/06 before 4.0. (Also to similar call below!). Reason: When t3lib_refindex is scanning the system in Live workspace all Pages with FlexForms will not find their inherited datastructure. Thus all references from workspaces are removed! Setting TRUE means that versioning PID doesn't check workspace of the record. I can't see that this should give problems anywhere. See more information inside t3lib_refindex!
+ self::fixVersioningPid($table, $rr, TRUE); // Added "TRUE" 23/03/06 before 4.0. (Also to similar call below!). Reason: When t3lib_refindex is scanning the system in Live workspace all Pages with FlexForms will not find their inherited datastructure. Thus all references from workspaces are removed! Setting TRUE means that versioning PID doesn't check workspace of the record. I can't see that this should give problems anywhere. See more information inside t3lib_refindex!
}
- $uidAcc = array(); // Used to avoid looping, if any should happen.
+ $uidAcc = array(); // Used to avoid looping, if any should happen.
$subFieldPointer = $conf['ds_pointerField_searchParent_subField'];
- while(!$srcPointer) {
+ while (!$srcPointer) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
- 'uid,'.$ds_pointerField.','.$ds_searchParentField.($subFieldPointer?','.$subFieldPointer:''),
+ 'uid,' . $ds_pointerField . ',' . $ds_searchParentField . ($subFieldPointer ? ',' . $subFieldPointer : ''),
- $table,
+ $table,
- 'uid=' . intval($newRecordPidValue ? $newRecordPidValue : $rr[$ds_searchParentField]) . self::deleteClause($table) ###NOTE_A###
+ 'uid=' . intval($newRecordPidValue ? $newRecordPidValue : $rr[$ds_searchParentField]) . self::deleteClause($table) ###NOTE_A###
- );
+ );
$newRecordPidValue = 0;
$rr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
// break if no result from SQL db or if looping...
- if (!is_array($rr) || isset($uidAcc[$rr['uid']])) break;
+ if (!is_array($rr) || isset($uidAcc[$rr['uid']])) {
+ break;
+ }
$uidAcc[$rr['uid']] = 1;
if ($WSOL) {
@@ -1216,7 +1212,7 @@
// If there is a srcPointer value:
if ($srcPointer) {
- if (t3lib_div::testInt($srcPointer)) { // If integer, then its a record we will look up:
+ if (t3lib_div::testInt($srcPointer)) { // If integer, then its a record we will look up:
list($tName, $fName) = explode(':', $ds_tableField, 2);
if ($tName && $fName && is_array($GLOBALS['TCA'][$tName])) {
$dataStructRec = self::getRecord($tName, $srcPointer);
@@ -1224,18 +1220,26 @@
self::workspaceOL($tName, $dataStructRec);
}
$dataStructArray = t3lib_div::xml2array($dataStructRec[$fName]);
- } else $dataStructArray = 'No tablename ('.$tName.') or fieldname ('.$fName.') was found an valid!';
+ } else {
+ $dataStructArray = 'No tablename (' . $tName . ') or fieldname (' . $fName . ') was found an valid!';
+ }
- } else { // Otherwise expect it to be a file:
+ } else { // Otherwise expect it to be a file:
$file = t3lib_div::getFileAbsFileName($srcPointer);
if ($file && @is_file($file)) {
$dataStructArray = t3lib_div::xml2array(t3lib_div::getUrl($file));
- } else $dataStructArray = 'The file "'.$srcPointer.'" was not found ("'.$file.'")'; // Error message.
+ } else {
+ $dataStructArray = 'The file "' . $srcPointer . '" was not found ("' . $file . '")';
+ } // Error message.
}
- } else $dataStructArray = 'No source value in fieldname "'.$ds_pointerField.'"'; // Error message.
- } else $dataStructArray = 'No proper configuration!';
+ } else {
+ $dataStructArray = 'No source value in fieldname "' . $ds_pointerField . '"';
+ } // Error message.
+ } else {
+ $dataStructArray = 'No proper configuration!';
+ }
// Hook for post-processing the Flexform DS. Introduces the possibility to configure Flexforms via TSConfig
- if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['getFlexFormDSClass'])) {
+ if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['getFlexFormDSClass'])) {
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['getFlexFormDSClass'] as $classRef) {
$hookObj = t3lib_div::getUserObj($classRef);
if (method_exists($hookObj, 'getFlexFormDS_postProcessDS')) {
@@ -1261,7 +1265,7 @@
}
- $flexForms = array();
+ $flexForms = array();
foreach ($GLOBALS['TCA'][$table]['columns'] as $tableField => $fieldConf) {
if (!empty($fieldConf['config']['type']) && !empty($fieldConf['config']['ds']) && $fieldConf['config']['type'] == 'flex') {
@@ -1277,7 +1281,7 @@
foreach ($fieldConf['config']['ds'] as $flexFormKey => $dataStruct) {
// Get extension identifier (uses second value if it's not empty, "list" or "*", else first one)
$identFields = t3lib_div::trimExplode(',', $flexFormKey);
- $extIdent = $identFields[0];
+ $extIdent = $identFields[0];
if (!empty($identFields[1]) && $identFields[1] != 'list' && $identFields[1] != '*') {
$extIdent = $identFields[1];
}
@@ -1322,7 +1326,7 @@
$flexForms[$tableField][$extIdent] = array(
'title' => $title,
- 'ds' => $dataStruct,
+ 'ds' => $dataStruct,
);
}
}
@@ -1332,12 +1336,6 @@
}
-
-
-
-
-
-
/*******************************************
*
* Caching related
@@ -1370,7 +1368,7 @@
'ident' => $ident,
'tstamp' => $GLOBALS['EXEC_TIME']
);
- $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_hash', 'hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_hash'));
+ $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_hash', 'hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_hash'));
$GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_hash', $insertFields);
}
}
@@ -1385,7 +1383,7 @@
* @return string
*/
public static function getHash($hash, $expTime = 0) {
- $hashContent = null;
+ $hashContent = NULL;
if (TYPO3_UseCachingFramework) {
$contentHashCache = $GLOBALS['typo3CacheManager']->getCache('cache_hash');
$cacheEntry = $contentHashCache->get($hash);
@@ -1396,24 +1394,18 @@
} else {
$expTime = intval($expTime);
if ($expTime) {
- $whereAdd = ' AND tstamp > '.(time()-$expTime);
+ $whereAdd = ' AND tstamp > ' . (time() - $expTime);
}
- $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('content', 'cache_hash', 'hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_hash').$whereAdd);
+ $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('content', 'cache_hash', 'hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_hash') . $whereAdd);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
- $hashContent = (is_array($row) ? $row['content'] : null);
+ $hashContent = (is_array($row) ? $row['content'] : NULL);
}
return $hashContent;
}
-
-
-
-
-
-
/*******************************************
*
* TypoScript related
@@ -1436,11 +1428,11 @@
if (!is_array($rootLine)) {
$rootLine = self::BEgetRootLine($id, '', TRUE);
}
- ksort($rootLine); // Order correctly
+ ksort($rootLine); // Order correctly
$TSdataArray = array();
- $TSdataArray['defaultPageTSconfig'] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig']; // Setting default configuration:
+ $TSdataArray['defaultPageTSconfig'] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig']; // Setting default configuration:
- foreach($rootLine as $k => $v) {
+ foreach ($rootLine as $k => $v) {
- $TSdataArray['uid_'.$v['uid']] = $v['TSconfig'];
+ $TSdataArray['uid_' . $v['uid']] = $v['TSconfig'];
}
$TSdataArray = t3lib_TSparser::checkIncludeLines_array($TSdataArray);
if ($returnPartArray) {
@@ -1498,14 +1490,14 @@
*/
public static function updatePagesTSconfig($id, $pageTS, $TSconfPrefix, $impParams = '') {
$id = intval($id);
- if (is_array($pageTS) && $id>0) {
+ if (is_array($pageTS) && $id > 0) {
if (!is_array($impParams)) {
$impParams = self::implodeTSParams(self::getPagesTSconfig($id));
}
$set = array();
foreach ($pageTS as $f => $v) {
- $f = $TSconfPrefix.$f;
+ $f = $TSconfPrefix . $f;
- if ((!isset($impParams[$f])&&trim($v)) || strcmp(trim($impParams[$f]), trim($v))) {
+ if ((!isset($impParams[$f]) && trim($v)) || strcmp(trim($impParams[$f]), trim($v))) {
$set[$f] = trim($v);
}
}
@@ -1518,15 +1510,15 @@
foreach ($set as $f => $v) {
$inserted = 0;
foreach ($TSlines as $ki => $kv) {
- if (substr($kv, 0, strlen($f)+1)==$f.'=') {
+ if (substr($kv, 0, strlen($f) + 1) == $f . '=') {
- $TSlines[$ki] = $f.'='.$v;
+ $TSlines[$ki] = $f . '=' . $v;
$inserted = 1;
break;
}
}
if (!$inserted) {
$TSlines = array_reverse($TSlines);
- $TSlines[] = $f.'='.$v;
+ $TSlines[] = $f . '=' . $v;
$TSlines = array_reverse($TSlines);
}
}
@@ -1535,7 +1527,7 @@
// store those changes
$TSconf = implode(LF, $TSlines);
- $GLOBALS['TYPO3_DB']->exec_UPDATEquery('pages', 'uid='.intval($id), array('TSconfig' => $TSconf));
+ $GLOBALS['TYPO3_DB']->exec_UPDATEquery('pages', 'uid=' . intval($id), array('TSconfig' => $TSconf));
}
}
}
@@ -1555,7 +1547,7 @@
if (is_array($val)) {
$implodeParams = array_merge($implodeParams, self::implodeTSParams($val, $k . $kb));
} else {
- $implodeParams[$k.$kb] = $val;
+ $implodeParams[$k . $kb] = $val;
}
}
}
@@ -1563,12 +1555,6 @@
}
-
-
-
-
-
-
/*******************************************
*
* Users / Groups related
@@ -1588,7 +1574,7 @@
$be_user_Array = Array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, 'be_users', 'pid=0 ' . $where . self::deleteClause('be_users'), '', 'username');
- while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+ while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$be_user_Array[$row['uid']] = $row;
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
@@ -1608,7 +1594,7 @@
$be_group_Array = Array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, 'be_groups', 'pid=0 ' . $where . self::deleteClause('be_groups'), '', 'title');
- while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+ while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$be_group_Array[$row['uid']] = $row;
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
@@ -1627,7 +1613,7 @@
public static function getListGroupNames($fields = 'title, uid') {
$exQ = ' AND hide_in_lists=0';
if (!$GLOBALS['BE_USER']->isAdmin()) {
- $exQ.=' AND uid IN ('.($GLOBALS['BE_USER']->user['usergroup_cached_list']?$GLOBALS['BE_USER']->user['usergroup_cached_list']:0).')';
+ $exQ .= ' AND uid IN (' . ($GLOBALS['BE_USER']->user['usergroup_cached_list'] ? $GLOBALS['BE_USER']->user['usergroup_cached_list'] : 0) . ')';
}
return self::getGroupNames($fields, $exQ);
}
@@ -1648,7 +1634,7 @@
foreach ($usernames as $uid => $row) {
$userN = $uid;
$set = 0;
- if ($row['uid']!=$GLOBALS['BE_USER']->user['uid']) {
+ if ($row['uid'] != $GLOBALS['BE_USER']->user['uid']) {
foreach ($groupArray as $v) {
if ($v && t3lib_div::inList($row['usergroup_cached_list'], $v)) {
$userN = $row['username'];
@@ -1660,9 +1646,11 @@
$set = 1;
}
$usernames[$uid]['username'] = $userN;
- if ($excludeBlindedFlag && !$set) {unset($usernames[$uid]);}
+ if ($excludeBlindedFlag && !$set) {
+ unset($usernames[$uid]);
- }
- }
+ }
+ }
+ }
return $usernames;
}
@@ -1685,24 +1673,15 @@
$set = 1;
}
$groups[$uid]['title'] = $groupN;
- if ($excludeBlindedFlag && !$set) {unset($groups[$uid]);}
+ if ($excludeBlindedFlag && !$set) {
+ unset($groups[$uid]);
- }
- }
+ }
+ }
+ }
return $groups;
}
-
-
-
-
-
-
-
-
-
-
-
/*******************************************
*
* Output related
@@ -1717,8 +1696,8 @@
* @return integer
*/
public static function daysUntil($tstamp) {
- $delta_t = $tstamp-$GLOBALS['EXEC_TIME'];
+ $delta_t = $tstamp - $GLOBALS['EXEC_TIME'];
- return ceil($delta_t/(3600*24));
+ return ceil($delta_t / (3600 * 24));
}
/**
@@ -1729,7 +1708,7 @@
* @return string Formatted time
*/
public static function date($tstamp) {
- return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], (int)$tstamp);
+ return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], (int) $tstamp);
}
/**
@@ -1740,7 +1719,7 @@
* @return string Formatted time
*/
public static function datetime($value) {
- return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' '.$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $value);
+ return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $value);
}
/**
@@ -1753,12 +1732,12 @@
* @return string Formatted time
*/
public static function time($value, $withSeconds = TRUE) {
- $hh = floor($value/3600);
+ $hh = floor($value / 3600);
- $min = floor(($value-$hh*3600)/60);
+ $min = floor(($value - $hh * 3600) / 60);
- $sec = $value-$hh*3600-$min*60;
+ $sec = $value - $hh * 3600 - $min * 60;
- $l = sprintf('%02d', $hh).':'.sprintf('%02d', $min);
+ $l = sprintf('%02d', $hh) . ':' . sprintf('%02d', $min);
if ($withSeconds) {
- $l .= ':'.sprintf('%02d', $sec);
+ $l .= ':' . sprintf('%02d', $sec);
}
return $l;
}
@@ -1774,17 +1753,20 @@
public static function calcAge($seconds, $labels = 'min|hrs|days|yrs') {
$labelArr = explode('|', $labels);
$prefix = '';
- if ($seconds<0) {$prefix = '-'; $seconds = abs($seconds);}
+ if ($seconds < 0) {
+ $prefix = '-';
+ $seconds = abs($seconds);
+ }
- if ($seconds<3600) {
+ if ($seconds < 3600) {
- $seconds = round ($seconds/60).' '.trim($labelArr[0]);
+ $seconds = round($seconds / 60) . ' ' . trim($labelArr[0]);
- } elseif ($seconds<24*3600) {
+ } elseif ($seconds < 24 * 3600) {
- $seconds = round ($seconds/3600).' '.trim($labelArr[1]);
+ $seconds = round($seconds / 3600) . ' ' . trim($labelArr[1]);
- } elseif ($seconds<365*24*3600) {
+ } elseif ($seconds < 365 * 24 * 3600) {
- $seconds = round ($seconds/(24*3600)).' '.trim($labelArr[2]);
+ $seconds = round($seconds / (24 * 3600)) . ' ' . trim($labelArr[2]);
} else {
- $seconds = round ($seconds/(365*24*3600)).' '.trim($labelArr[3]);
+ $seconds = round($seconds / (365 * 24 * 3600)) . ' ' . trim($labelArr[3]);
}
- return $prefix.$seconds;
+ return $prefix . $seconds;
}
/**
@@ -1799,8 +1781,8 @@
*/
public static function dateTimeAge($tstamp, $prefix = 1, $date = '') {
return $tstamp ?
- ($date=='date' ? self::date($tstamp) : self::datetime($tstamp)) .
+ ($date == 'date' ? self::date($tstamp) : self::datetime($tstamp)) .
- ' (' . self::calcAge($prefix * ($GLOBALS['EXEC_TIME'] - $tstamp), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')) . ')'
+ ' (' . self::calcAge($prefix * ($GLOBALS['EXEC_TIME'] - $tstamp), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')) . ')'
: '';
}
@@ -1820,8 +1802,8 @@
t3lib_div::logDeprecatedFunction();
global $CLIENT;
- $attrib= ($CLIENT['BROWSER']=='net'&&$CLIENT['VERSION']<5)||$CLIENT['BROWSER']=='konqu' ? 'alt' : 'title';
+ $attrib = ($CLIENT['BROWSER'] == 'net' && $CLIENT['VERSION'] < 5) || $CLIENT['BROWSER'] == 'konqu' ? 'alt' : 'title';
- return strcmp($content, '')?' '.$attrib.'="'.($hsc?htmlspecialchars($content):$content).'"' : $attrib;
+ return strcmp($content, '') ? ' ' . $attrib . '="' . ($hsc ? htmlspecialchars($content) : $content) . '"' : $attrib;
}
/**
@@ -1833,8 +1815,8 @@
*/
public static function titleAltAttrib($content) {
$out = '';
- $out.=' alt="'.htmlspecialchars($content).'"';
+ $out .= ' alt="' . htmlspecialchars($content) . '"';
- $out.=' title="'.htmlspecialchars($content).'"';
+ $out .= ' title="' . htmlspecialchars($content) . '"';
return $out;
}
@@ -1862,20 +1844,22 @@
// Find uploaddir automatically
$uploaddir = (is_null($uploaddir)) ? $TCA[$table]['columns'][$field]['config']['uploadfolder'] : $uploaddir;
- $uploaddir = preg_replace('#/$#','', $uploaddir);
+ $uploaddir = preg_replace('#/$#', '', $uploaddir);
// Set thumbs-script:
if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails']) {
$thumbScript = 'gfx/notfound_thumb.gif';
- } elseif(!$thumbScript) {
+ } elseif (!$thumbScript) {
$thumbScript = 'thumbs.php';
}
// Check and parse the size parameter
$sizeParts = array();
if ($size = trim($size)) {
- $sizeParts = explode('x', $size.'x'.$size);
+ $sizeParts = explode('x', $size . 'x' . $size);
- if(!intval($sizeParts[0])) $size = '';
+ if (!intval($sizeParts[0])) {
+ $size = '';
- }
+ }
+ }
// Traverse files:
$thumbs = explode(',', $row[$field]);
@@ -1884,26 +1868,28 @@
if (trim($theFile)) {
$fI = t3lib_div::split_fileref($theFile);
$ext = $fI['fileext'];
- // New 190201 start
+ // New 190201 start
$max = 0;
if (t3lib_div::inList('gif,jpg,png', $ext)) {
- $imgInfo = @getimagesize(PATH_site.$uploaddir.'/'.$theFile);
+ $imgInfo = @getimagesize(PATH_site . $uploaddir . '/' . $theFile);
- if (is_array($imgInfo)) {$max = max($imgInfo[0], $imgInfo[1]);}
+ if (is_array($imgInfo)) {
+ $max = max($imgInfo[0], $imgInfo[1]);
- }
+ }
+ }
// use the original image if it's size fits to the thumbnail size
- if ($max && $max<=(count($sizeParts)&&max($sizeParts)?max($sizeParts):56)) {
+ if ($max && $max <= (count($sizeParts) && max($sizeParts) ? max($sizeParts) : 56)) {
- $theFile = $url = ($abs?'':'../').($uploaddir?$uploaddir.'/':'').trim($theFile);
+ $theFile = $url = ($abs ? '' : '../') . ($uploaddir ? $uploaddir . '/' : '') . trim($theFile);
- $onClick = 'top.launchView(\''.$theFile.'\',\'\',\''.$backPath.'\');return false;';
+ $onClick = 'top.launchView(\'' . $theFile . '\',\'\',\'' . $backPath . '\');return false;';
- $thumbData.= ' ';
+ $thumbData .= ' ';
- // New 190201 stop
+ // New 190201 stop
- } elseif ($ext=='ttf' || t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $ext)) {
+ } elseif ($ext == 'ttf' || t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $ext)) {
- $theFile_abs = PATH_site.($uploaddir?$uploaddir.'/':'').trim($theFile);
+ $theFile_abs = PATH_site . ($uploaddir ? $uploaddir . '/' : '') . trim($theFile);
- $theFile = ($abs?'':'../').($uploaddir?$uploaddir.'/':'').trim($theFile);
+ $theFile = ($abs ? '' : '../') . ($uploaddir ? $uploaddir . '/' : '') . trim($theFile);
if (!is_readable($theFile_abs)) {
$flashMessage = t3lib_div::makeInstance(
't3lib_FlashMessage',
- $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_missing_text') . ' ' . $theFile . '',
+ $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_missing_text') . ' ' . $theFile . '',
$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_missing'),
t3lib_FlashMessage::ERROR
);
@@ -1911,18 +1897,18 @@
continue;
}
- $check = basename($theFile_abs).':'.filemtime($theFile_abs).':'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
+ $check = basename($theFile_abs) . ':' . filemtime($theFile_abs) . ':' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
- $params = '&file='.rawurlencode($theFile);
+ $params = '&file=' . rawurlencode($theFile);
- $params.= $size?'&size='.$size:'';
+ $params .= $size ? '&size=' . $size : '';
- $params.= '&md5sum='.t3lib_div::shortMD5($check);
+ $params .= '&md5sum=' . t3lib_div::shortMD5($check);
- $url = $thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].$params;
+ $url = $thumbScript . '?&dummy=' . $GLOBALS['EXEC_TIME'] . $params;
- $onClick = 'top.launchView(\''.$theFile.'\',\'\',\''.$backPath.'\');return false;';
+ $onClick = 'top.launchView(\'' . $theFile . '\',\'\',\'' . $backPath . '\');return false;';
- $thumbData.= ' ';
+ $thumbData .= ' ';
} else {
$icon = self::getFileIcon($ext);
- $url = 'gfx/fileicons/'.$icon;
+ $url = 'gfx/fileicons/' . $icon;
- $thumbData.= ' ';
+ $thumbData .= ' ';
}
}
}
@@ -1940,13 +1926,13 @@
* @return string Image tag
*/
public static function getThumbNail($thumbScript, $theFile, $tparams = '', $size = '') {
- $check = basename($theFile).':'.filemtime($theFile).':'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
+ $check = basename($theFile) . ':' . filemtime($theFile) . ':' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
- $params = '&file='.rawurlencode($theFile);
+ $params = '&file=' . rawurlencode($theFile);
- $params.= trim($size)?'&size='.trim($size):'';
+ $params .= trim($size) ? '&size=' . trim($size) : '';
- $params.= '&md5sum='.t3lib_div::shortMD5($check);
+ $params .= '&md5sum=' . t3lib_div::shortMD5($check);
- $url = $thumbScript.'?&dummy='.$GLOBALS['EXEC_TIME'].$params;
+ $url = $thumbScript . '?&dummy=' . $GLOBALS['EXEC_TIME'] . $params;
- $th = '';
+ $th = '';
return $th;
}
@@ -1962,30 +1948,34 @@
public static function titleAttribForPages($row, $perms_clause = '', $includeAttrib = 1) {
global $TCA, $LANG;
$parts = array();
- $parts[] = 'id='.$row['uid'];
+ $parts[] = 'id=' . $row['uid'];
- if ($row['alias']) $parts[] = $LANG->sL($TCA['pages']['columns']['alias']['label']).' '.$row['alias'];
- if ($row['pid']<0) $parts[] = 'v#1.'.$row['t3ver_id'];
+ if ($row['alias']) {
+ $parts[] = $LANG->sL($TCA['pages']['columns']['alias']['label']) . ' ' . $row['alias'];
+ }
+ if ($row['pid'] < 0) {
+ $parts[] = 'v#1.' . $row['t3ver_id'];
+ }
- switch($row['t3ver_state']) {
+ switch ($row['t3ver_state']) {
case 1:
- $parts[] = 'PLH WSID#'.$row['t3ver_wsid'];
+ $parts[] = 'PLH WSID#' . $row['t3ver_wsid'];
- break;
+ break;
case 2:
$parts[] = 'Deleted element!';
- break;
+ break;
case 3:
- $parts[] = 'NEW LOCATION (PLH) WSID#'.$row['t3ver_wsid'];
+ $parts[] = 'NEW LOCATION (PLH) WSID#' . $row['t3ver_wsid'];
- break;
+ break;
case 4:
- $parts[] = 'OLD LOCATION (PNT) WSID#'.$row['t3ver_wsid'];
+ $parts[] = 'OLD LOCATION (PNT) WSID#' . $row['t3ver_wsid'];
- break;
+ break;
case -1:
$parts[] = 'New element!';
- break;
+ break;
}
if ($row['doktype'] == t3lib_pageSelect::DOKTYPE_LINK) {
- $parts[] = $LANG->sL($TCA['pages']['columns']['url']['label']).' '.$row['url'];
+ $parts[] = $LANG->sL($TCA['pages']['columns']['url']['label']) . ' ' . $row['url'];
} elseif ($row['doktype'] == t3lib_pageSelect::DOKTYPE_SHORTCUT) {
if ($perms_clause) {
$label = self::getRecordPath(intval($row['shortcut']), $perms_clause, 20);
@@ -1994,10 +1984,10 @@
$label = $lRec['title'];
}
if ($row['shortcut_mode'] != t3lib_pageSelect::SHORTCUT_MODE_NONE) {
- $label.=', '.$LANG->sL($TCA['pages']['columns']['shortcut_mode']['label']).' '.
+ $label .= ', ' . $LANG->sL($TCA['pages']['columns']['shortcut_mode']['label']) . ' ' .
- $LANG->sL(self::getLabelFromItemlist('pages', 'shortcut_mode', $row['shortcut_mode']));
+ $LANG->sL(self::getLabelFromItemlist('pages', 'shortcut_mode', $row['shortcut_mode']));
}
- $parts[] = $LANG->sL($TCA['pages']['columns']['shortcut']['label']).' '.$label;
+ $parts[] = $LANG->sL($TCA['pages']['columns']['shortcut']['label']) . ' ' . $label;
} elseif ($row['doktype'] == t3lib_pageSelect::DOKTYPE_MOUNTPOINT) {
if ($perms_clause) {
$label = self::getRecordPath(intval($row['mount_pid']), $perms_clause, 20);
@@ -2005,19 +1995,27 @@
$lRec = self::getRecordWSOL('pages', intval($row['mount_pid']), 'title');
$label = $lRec['title'];
}
- $parts[] = $LANG->sL($TCA['pages']['columns']['mount_pid']['label']).' '.$label;
+ $parts[] = $LANG->sL($TCA['pages']['columns']['mount_pid']['label']) . ' ' . $label;
if ($row['mount_pid_ol']) {
$parts[] = $LANG->sL($TCA['pages']['columns']['mount_pid_ol']['label']);
}
}
- if ($row['nav_hide']) $parts[] = rtrim($LANG->sL($TCA['pages']['columns']['nav_hide']['label']), ':');
- if ($row['hidden']) $parts[] = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.hidden');
- if ($row['starttime']) $parts[] = $LANG->sL($TCA['pages']['columns']['starttime']['label']) . ' ' . self::dateTimeAge($row['starttime'], -1, 'date');
- if ($row['endtime']) $parts[] = $LANG->sL($TCA['pages']['columns']['endtime']['label']) . ' ' . self::dateTimeAge($row['endtime'], -1, 'date');
+ if ($row['nav_hide']) {
+ $parts[] = rtrim($LANG->sL($TCA['pages']['columns']['nav_hide']['label']), ':');
+ }
+ if ($row['hidden']) {
+ $parts[] = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.hidden');
+ }
+ if ($row['starttime']) {
+ $parts[] = $LANG->sL($TCA['pages']['columns']['starttime']['label']) . ' ' . self::dateTimeAge($row['starttime'], -1, 'date');
+ }
+ if ($row['endtime']) {
+ $parts[] = $LANG->sL($TCA['pages']['columns']['endtime']['label']) . ' ' . self::dateTimeAge($row['endtime'], -1, 'date');
+ }
if ($row['fe_group']) {
$fe_groups = array();
foreach (t3lib_div::intExplode(',', $row['fe_group']) as $fe_group) {
- if ($fe_group<0) {
+ if ($fe_group < 0) {
$fe_groups[] = $LANG->sL(self::getLabelFromItemlist('pages', 'fe_group', $fe_group));
} else {
$lRec = self::getRecordWSOL('fe_groups', $fe_group, 'title');
@@ -2025,10 +2023,10 @@
}
}
$label = implode(', ', $fe_groups);
- $parts[] = $LANG->sL($TCA['pages']['columns']['fe_group']['label']).' '.$label;
+ $parts[] = $LANG->sL($TCA['pages']['columns']['fe_group']['label']) . ' ' . $label;
}
$out = htmlspecialchars(implode(' - ', $parts));
- return $includeAttrib ? 'title="'.$out.'"' : $out;
+ return $includeAttrib ? 'title="' . $out . '"' : $out;
}
/**
@@ -2042,52 +2040,52 @@
* @return string
*/
public static function getRecordIconAltText($row, $table = 'pages') {
- if ($table=='pages') {
+ if ($table == 'pages') {
$out = self::titleAttribForPages($row, '', 0);
} else {
$ctrl = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns'];
- $out = 'id='.$row['uid']; // Uid is added
+ $out = 'id=' . $row['uid']; // Uid is added
- if ($table=='pages' && $row['alias']) {
+ if ($table == 'pages' && $row['alias']) {
- $out.=' / '.$row['alias'];
+ $out .= ' / ' . $row['alias'];
}
- if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $row['pid']<0) {
+ if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $row['pid'] < 0) {
- $out.=' - v#1.'.$row['t3ver_id'];
+ $out .= ' - v#1.' . $row['t3ver_id'];
}
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
- switch($row['t3ver_state']) {
+ switch ($row['t3ver_state']) {
case 1:
- $out.= ' - PLH WSID#'.$row['t3ver_wsid'];
+ $out .= ' - PLH WSID#' . $row['t3ver_wsid'];
- break;
+ break;
case 2:
- $out.= ' - Deleted element!';
+ $out .= ' - Deleted element!';
- break;
+ break;
case 3:
- $out.= ' - NEW LOCATION (PLH) WSID#'.$row['t3ver_wsid'];
+ $out .= ' - NEW LOCATION (PLH) WSID#' . $row['t3ver_wsid'];
- break;
+ break;
case 4:
- $out.= ' - OLD LOCATION (PNT) WSID#'.$row['t3ver_wsid'];
+ $out .= ' - OLD LOCATION (PNT) WSID#' . $row['t3ver_wsid'];
- break;
+ break;
case -1:
- $out.= ' - New element!';
+ $out .= ' - New element!';
- break;
+ break;
}
}
- if ($ctrl['disabled']) { // Hidden ...
+ if ($ctrl['disabled']) { // Hidden ...
- $out.=($row[$ctrl['disabled']]?' - '.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.hidden'):'');
+ $out .= ($row[$ctrl['disabled']] ? ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.hidden') : '');
}
if ($ctrl['starttime']) {
if ($row[$ctrl['starttime']] > $GLOBALS['EXEC_TIME']) {
$out .= ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.starttime') . ':' .
- self::date($row[$ctrl['starttime']]) . ' (' . self::daysUntil($row[$ctrl['starttime']]) . ' ' .
- $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.days') . ')';
+ self::date($row[$ctrl['starttime']]) . ' (' . self::daysUntil($row[$ctrl['starttime']]) . ' ' .
+ $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.days') . ')';
}
}
if ($row[$ctrl['endtime']]) {
$out .= ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.endtime') . ': ' .
- self::date($row[$ctrl['endtime']]) . ' (' . self::daysUntil($row[$ctrl['endtime']]) . ' ' .
- $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.days') . ')';
+ self::date($row[$ctrl['endtime']]) . ' (' . self::daysUntil($row[$ctrl['endtime']]) . ' ' .
+ $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.days') . ')';
}
}
return htmlspecialchars($out);
@@ -2112,10 +2110,12 @@
// Traverse the items-array...
foreach ($TCA[$table]['columns'][$col]['config']['items'] as $k => $v) {
// ... and return the first found label where the value was equal to $key
- if (!strcmp($v[1], $key)) return $v[0];
+ if (!strcmp($v[1], $key)) {
+ return $v[0];
- }
- }
- }
+ }
+ }
+ }
+ }
/**
* Returns the label-value for fieldname $col in table, $table
@@ -2138,7 +2138,7 @@
}
if ($printAllWrap) {
$parts = explode('|', $printAllWrap);
- return $parts[0].$col.$parts[1];
+ return $parts[0] . $col . $parts[1];
}
}
@@ -2155,7 +2155,7 @@
*/
public static function getRecordTitle($table, $row, $prep = FALSE, $forceResult = TRUE) {
global $TCA;
- if (is_array($TCA[$table])) {
+ if (is_array($TCA[$table])) {
// If configured, call userFunc
if ($TCA[$table]['ctrl']['label_userFunc']) {
@@ -2169,15 +2169,17 @@
} else {
// No userFunc: Build label
- $t = self::getProcessedValue($table, $TCA[$table]['ctrl']['label'], $row[$TCA[$table]['ctrl']['label']], 0, 0, false, $row['uid'], $forceResult);
+ $t = self::getProcessedValue($table, $TCA[$table]['ctrl']['label'], $row[$TCA[$table]['ctrl']['label']], 0, 0, FALSE, $row['uid'], $forceResult);
if ($TCA[$table]['ctrl']['label_alt'] && ($TCA[$table]['ctrl']['label_alt_force'] || !strcmp($t, ''))) {
$altFields = t3lib_div::trimExplode(',', $TCA[$table]['ctrl']['label_alt'], 1);
$tA = array();
- if (!empty($t)) $tA[] = $t;
+ if (!empty($t)) {
+ $tA[] = $t;
+ }
foreach ($altFields as $fN) {
$t = trim(strip_tags($row[$fN]));
if (strcmp($t, '')) {
- $t = self::getProcessedValue($table, $fN, $t, 0, 0, false, $row['uid']);
+ $t = self::getProcessedValue($table, $fN, $t, 0, 0, FALSE, $row['uid']);
if (!$TCA[$table]['ctrl']['label_alt_force']) {
break;
}
@@ -2221,7 +2223,7 @@
$title = htmlspecialchars(t3lib_div::fixed_lgd_cs($title, $titleLength));
// If title was cropped, offer a tooltip:
if ($titleOrig != $title) {
- $title = ''.$title.'';
+ $title = '' . $title . '';
}
return $title;
}
@@ -2233,8 +2235,10 @@
* @return string Localized [No title] string
*/
public static function getNoRecordTitle($prep = FALSE) {
- $noTitle = '['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title', 1).']';
+ $noTitle = '[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title', 1) . ']';
- if ($prep) $noTitle = ''.$noTitle.'';
+ if ($prep) {
+ $noTitle = '' . $noTitle . '';
+ }
return $noTitle;
}
@@ -2270,10 +2274,10 @@
// Depending on the fields configuration, make a meaningful output value.
$theColConf = $TCA[$table]['columns'][$col]['config'];
- /*****************
- *HOOK: pre-processing the human readable output from a record
- ****************/
+ /*****************
+ *HOOK: pre-processing the human readable output from a record
+ ****************/
- if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['preProcessValue'])) {
+ if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['preProcessValue'])) {
// create NULL-reference
$null = NULL;
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['preProcessValue'] as $_funcRef) {
@@ -2282,20 +2286,20 @@
}
$l = '';
- switch((string)$theColConf['type']) {
+ switch ((string) $theColConf['type']) {
case 'radio':
$l = self::getLabelFromItemlist($table, $col, $value);
$l = $GLOBALS['LANG']->sL($l);
- break;
+ break;
case 'select':
if ($theColConf['MM']) {
if ($uid) {
// Display the title of MM related records in lists
if ($noRecordLookup) {
$MMfield = $theColConf['foreign_table'] . '.uid';
- } else {
+ } else {
$MMfields = array($theColConf['foreign_table'] . '.' . $TCA[$theColConf['foreign_table']]['ctrl']['label']);
- foreach (t3lib_div::trimExplode(',', $TCA[$theColConf['foreign_table']]['ctrl']['label_alt'], 1) as $f) {
+ foreach (t3lib_div::trimExplode(',', $TCA[$theColConf['foreign_table']]['ctrl']['label_alt'], 1) as $f) {
$MMfields[] = $theColConf['foreign_table'] . '.' . $f;
}
$MMfield = join(',', $MMfields);
@@ -2305,11 +2309,11 @@
$dbGroup->start($value, $theColConf['foreign_table'], $theColConf['MM'], $uid, $table, $theColConf);
$selectUids = $dbGroup->tableArray[$theColConf['foreign_table']];
- if (is_array($selectUids) && count($selectUids)>0) {
+ if (is_array($selectUids) && count($selectUids) > 0) {
$MMres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid, ' . $MMfield,
$theColConf['foreign_table'],
- 'uid IN (' . implode(',', $selectUids) . ')'
+ 'uid IN (' . implode(',', $selectUids) . ')'
);
while ($MMrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMres)) {
$mmlA[] = ($noRecordLookup ? $MMrow['uid'] : self::getRecordTitle($theColConf['foreign_table'], $MMrow, FALSE, $forceResult));
@@ -2338,44 +2342,46 @@
$lA = array();
foreach ($rParts as $rVal) {
$rVal = intval($rVal);
- if ($rVal>0) {
+ if ($rVal > 0) {
$r = self::getRecordWSOL($theColConf['foreign_table'], $rVal);
} else {
$r = self::getRecordWSOL($theColConf['neg_foreign_table'], -$rVal);
}
if (is_array($r)) {
- $lA[] = $GLOBALS['LANG']->sL($rVal>0?$theColConf['foreign_table_prefix']:$theColConf['neg_foreign_table_prefix']) . self::getRecordTitle($rVal>0?$theColConf['foreign_table']:$theColConf['neg_foreign_table'], $r, FALSE, $forceResult);
+ $lA[] = $GLOBALS['LANG']->sL($rVal > 0 ? $theColConf['foreign_table_prefix'] : $theColConf['neg_foreign_table_prefix']) . self::getRecordTitle($rVal > 0 ? $theColConf['foreign_table'] : $theColConf['neg_foreign_table'], $r, FALSE, $forceResult);
} else {
- $lA[] = $rVal?'['.$rVal.'!]':'';
+ $lA[] = $rVal ? '[' . $rVal . '!]' : '';
}
}
$l = implode(', ', $lA);
}
}
}
- break;
+ break;
case 'group':
$l = implode(', ', t3lib_div::trimExplode(',', $value, 1));
- break;
+ break;
case 'check':
- if (!is_array($theColConf['items']) || count($theColConf['items'])==1) {
+ if (!is_array($theColConf['items']) || count($theColConf['items']) == 1) {
$l = $value ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:no');
} else {
$lA = Array();
foreach ($theColConf['items'] as $key => $val) {
- if ($value & pow(2, $key)) {$lA[] = $GLOBALS['LANG']->sL($val[0]);}
+ if ($value & pow(2, $key)) {
+ $lA[] = $GLOBALS['LANG']->sL($val[0]);
- }
+ }
+ }
$l = implode(', ', $lA);
}
- break;
+ break;
case 'input':
if (isset($value)) {
if (t3lib_div::inList($theColConf['eval'], 'date')) {
$l = self::date($value) .
- ' (' .
- ($GLOBALS['EXEC_TIME'] - $value > 0 ? '-' : '') .
- self::calcAge(abs($GLOBALS['EXEC_TIME'] - $value), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')) .
- ')';
+ ' (' .
+ ($GLOBALS['EXEC_TIME'] - $value > 0 ? '-' : '') .
+ self::calcAge(abs($GLOBALS['EXEC_TIME'] - $value), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')) .
+ ')';
} elseif (t3lib_div::inList($theColConf['eval'], 'time')) {
$l = self::time($value, FALSE);
} elseif (t3lib_div::inList($theColConf['eval'], 'timesec')) {
@@ -2386,10 +2392,10 @@
$l = $value;
}
}
- break;
+ break;
case 'flex':
$l = strip_tags($value);
- break;
+ break;
default:
if ($defaultPassthrough) {
$l = $value;
@@ -2398,22 +2404,22 @@
} elseif ($value) {
$l = t3lib_div::fixed_lgd_cs(strip_tags($value), 200);
}
- break;
+ break;
}
// If this field is a password field, then hide the password by changing it to a random number of asterisk (*)
if (stristr($theColConf['eval'], 'password')) {
unset($l);
$randomNumber = rand(5, 12);
- for ($i=0; $i < $randomNumber; $i++) {
+ for ($i = 0; $i < $randomNumber; $i++) {
$l .= '*';
}
}
- /*****************
- *HOOK: post-processing the human readable output from a record
- ****************/
+ /*****************
+ *HOOK: post-processing the human readable output from a record
+ ****************/
- if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'])) {
+ if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'])) {
// create NULL-reference
$null = NULL;
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'] as $_funcRef) {
@@ -2451,10 +2457,10 @@
$fVnew = self::getProcessedValue($table, $fN, $fV, $fixed_lgd_chars, 1, 0, $uid, $forceResult);
if (!isset($fVnew)) {
if (is_array($TCA[$table])) {
- if ($fN==$TCA[$table]['ctrl']['tstamp'] || $fN==$TCA[$table]['ctrl']['crdate']) {
+ if ($fN == $TCA[$table]['ctrl']['tstamp'] || $fN == $TCA[$table]['ctrl']['crdate']) {
$fVnew = self::datetime($fV);
- } elseif ($fN=='pid'){
+ } elseif ($fN == 'pid') {
- $fVnew = self::getRecordPath($fV, '1=1', 20); // Fetches the path with no regard to the users permissions to select pages.
+ $fVnew = self::getRecordPath($fV, '1=1', 20); // Fetches the path with no regard to the users permissions to select pages.
} else {
$fVnew = $fV;
}
@@ -2487,31 +2493,43 @@
*/
public static function getCommonSelectFields($table, $prefix = '', $fields = array()) {
global $TCA;
- $fields[] = $prefix.'uid';
+ $fields[] = $prefix . 'uid';
- $fields[] = $prefix.$TCA[$table]['ctrl']['label'];
+ $fields[] = $prefix . $TCA[$table]['ctrl']['label'];
if ($TCA[$table]['ctrl']['label_alt']) {
$secondFields = t3lib_div::trimExplode(',', $TCA[$table]['ctrl']['label_alt'], 1);
- foreach($secondFields as $fieldN) {
+ foreach ($secondFields as $fieldN) {
- $fields[] = $prefix.$fieldN;
+ $fields[] = $prefix . $fieldN;
}
}
if ($TCA[$table]['ctrl']['versioningWS']) {
- $fields[] = $prefix.'t3ver_id';
+ $fields[] = $prefix . 't3ver_id';
- $fields[] = $prefix.'t3ver_state';
+ $fields[] = $prefix . 't3ver_state';
- $fields[] = $prefix.'t3ver_wsid';
+ $fields[] = $prefix . 't3ver_wsid';
- $fields[] = $prefix.'t3ver_count';
+ $fields[] = $prefix . 't3ver_count';
}
- if ($TCA[$table]['ctrl']['selicon_field']) $fields[] = $prefix.$TCA[$table]['ctrl']['selicon_field'];
- if ($TCA[$table]['ctrl']['typeicon_column']) $fields[] = $prefix.$TCA[$table]['ctrl']['typeicon_column'];
+ if ($TCA[$table]['ctrl']['selicon_field']) {
+ $fields[] = $prefix . $TCA[$table]['ctrl']['selicon_field'];
+ }
+ if ($TCA[$table]['ctrl']['typeicon_column']) {
+ $fields[] = $prefix . $TCA[$table]['ctrl']['typeicon_column'];
+ }
- if (is_array($TCA[$table]['ctrl']['enablecolumns'])) {
+ if (is_array($TCA[$table]['ctrl']['enablecolumns'])) {
- if ($TCA[$table]['ctrl']['enablecolumns']['disabled']) $fields[] = $prefix.$TCA[$table]['ctrl']['enablecolumns']['disabled'];
- if ($TCA[$table]['ctrl']['enablecolumns']['starttime']) $fields[] = $prefix.$TCA[$table]['ctrl']['enablecolumns']['starttime'];
- if ($TCA[$table]['ctrl']['enablecolumns']['endtime']) $fields[] = $prefix.$TCA[$table]['ctrl']['enablecolumns']['endtime'];
- if ($TCA[$table]['ctrl']['enablecolumns']['fe_group']) $fields[] = $prefix.$TCA[$table]['ctrl']['enablecolumns']['fe_group'];
+ if ($TCA[$table]['ctrl']['enablecolumns']['disabled']) {
+ $fields[] = $prefix . $TCA[$table]['ctrl']['enablecolumns']['disabled'];
- }
+ }
+ if ($TCA[$table]['ctrl']['enablecolumns']['starttime']) {
+ $fields[] = $prefix . $TCA[$table]['ctrl']['enablecolumns']['starttime'];
+ }
+ if ($TCA[$table]['ctrl']['enablecolumns']['endtime']) {
+ $fields[] = $prefix . $TCA[$table]['ctrl']['enablecolumns']['endtime'];
+ }
+ if ($TCA[$table]['ctrl']['enablecolumns']['fe_group']) {
+ $fields[] = $prefix . $TCA[$table]['ctrl']['enablecolumns']['fe_group'];
+ }
+ }
return implode(',', array_unique($fields));
}
@@ -2533,56 +2551,49 @@
$lines = array();
foreach ($configArray as $fname => $config) {
if (is_array($config)) {
- $lines[$fname] = ''.htmlspecialchars($config[1]).'
';
+ $lines[$fname] = '' . htmlspecialchars($config[1]) . '
';
- $lines[$fname].=$config[2].'
';
+ $lines[$fname] .= $config[2] . '
';
- switch($config[0]) {
+ switch ($config[0]) {
case 'string':
case 'short':
- $formEl = 'formWidth($config[0]=='short'?24:48).' />';
+ $formEl = 'formWidth($config[0] == 'short' ? 24 : 48) . ' />';
- break;
+ break;
case 'check':
- $formEl = '';
+ $formEl = '';
- break;
+ break;
case 'comment':
$formEl = '';
- break;
+ break;
case 'select':
$opt = array();
foreach ($config[3] as $k => $v) {
- $opt[] = '';
+ $opt[] = '';
}
- $formEl = '';
+ $formEl = '';
- break;
+ break;
default:
debug($config);
- break;
+ break;
}
- $lines[$fname].=$formEl;
+ $lines[$fname] .= $formEl;
- $lines[$fname].='
';
+ $lines[$fname] .= '
';
} else {
$lines[$fname] = '
' . $icon . ' |
- '.$fullText.' | +' . $fullText . ' |