Index: t3lib/search/class.t3lib_search_livesearch_queryParser.php =================================================================== --- t3lib/search/class.t3lib_search_livesearch_queryParser.php (revision 9479) +++ t3lib/search/class.t3lib_search_livesearch_queryParser.php (revision ) @@ -44,7 +44,7 @@ /** * @var string */ - protected $tableName = ''; + protected $tableName = ''; /** * @var string @@ -90,6 +90,7 @@ if (is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']) && array_key_exists($this->commandKey, $GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch'])) { $tableName = $GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch'][$this->commandKey]; } + return $tableName; } @@ -110,10 +111,10 @@ * @return boolean */ public function isValidPageJump($query) { - $isValid = false; + $isValid = FALSE; if (preg_match('~^#(\d)+$~', $query)) { - $isValid = true; + $isValid = TRUE; } return $isValid; @@ -126,11 +127,11 @@ * @return boolean */ public function isValidCommand($query) { - $isValid = false; + $isValid = FALSE; if (strpos($query, self::COMMAND_KEY_INDICATOR) === 0 && - strpos($query, self::COMMAND_SPLIT_INDICATOR) > 1 && - $this->getTableNameFromCommand($query)) { + strpos($query, self::COMMAND_SPLIT_INDICATOR) > 1 && + $this->getTableNameFromCommand($query)) { - $isValid = true; + $isValid = TRUE; } return $isValid; @@ -172,4 +173,5 @@ return $resultQuery; } } + ?> \ No newline at end of file Index: t3lib/search/class.t3lib_search_livesearch.php =================================================================== --- t3lib/search/class.t3lib_search_livesearch.php (revision 9494) +++ t3lib/search/class.t3lib_search_livesearch.php (revision ) @@ -79,7 +79,7 @@ /** * @var t3lib_search_livesearch_queryParser */ - protected $queryParser = null; + protected $queryParser = NULL; /** * Initialize access settings. @@ -117,7 +117,7 @@ */ public function find($searchQuery) { $recordArray = array(); - $pageIdList = $this->getAvailablePageIds ( + $pageIdList = $this->getAvailablePageIds( implode(',', $GLOBALS['BE_USER']->returnWebmounts()), self::RECURSIVE_PAGE_LEVEL ); @@ -134,7 +134,7 @@ $recordArray = $this->findByGlobalTableList($pageIdList, $limit); } - // @todo Need to make sure we don't return too many records. How do we handle this when querying across multiple tables? + // @todo Need to make sure we don't return too many records. How do we handle this when querying across multiple tables? $recordArray = array_slice($recordArray, 0, $this->limitCount); return $recordArray; @@ -189,7 +189,7 @@ protected function findByTable($tableName, $pageIdList, $limit) { $getRecordArray = array(); $fieldsToSearchWithin = $this->extractSearchableFieldsFromTable($tableName); - $pageBasedPermission = ($tableName == 'pages' && $this->userPermissions) ? $this->userPermissions : '1=1 ' ; + $pageBasedPermission = ($tableName == 'pages' && $this->userPermissions) ? $this->userPermissions : '1=1 '; $where = 'pid IN(' . $pageIdList . ')' . $pageBasedPermission . $this->makeQuerySearchByTable($tableName, $fieldsToSearchWithin); $orderBy = $this->makeOrderByTable($tableName); $getRecordArray = $this->getRecordArray( @@ -220,26 +220,26 @@ */ protected function getRecordArray($tableName, $where, $orderBy, $limit) { $collect = array(); - $isFirst = true; + $isFirst = TRUE; $queryParts = array( - 'SELECT' => '*', + 'SELECT' => '*', - 'FROM' => $tableName, + 'FROM' => $tableName, - 'WHERE' => $where, + 'WHERE' => $where, 'ORDERBY' => $orderBy, - 'LIMIT' => $limit + 'LIMIT' => $limit ); - $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); + $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result); - while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { + while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { - $collect[] = array ( + $collect[] = array( 'id' => $tableName . ':' . $row['uid'], 'recordTitle' => ($isFirst) ? $this->getRecordTitlePrep($this->getTitleOfCurrentRecordType($tableName), self::GROUP_TITLE_MAX_LENGTH) : '', 'iconHTML' => t3lib_iconWorks::getSpriteIconForRecord($tableName, $row), 'title' => $this->getRecordTitlePrep($this->getTitleFromCurrentRow($tableName, $row), self::RECORD_TITLE_MAX_LENGTH), 'editLink' => $this->getEditLink($tableName, $row), ); - $isFirst = false; + $isFirst = FALSE; } return $collect; @@ -260,16 +260,16 @@ $editLink = ''; if ($tableName == 'pages') { - $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages',$row['uid'])); + $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages', $row['uid'])); - $permsEdit = $localCalcPerms&2; + $permsEdit = $localCalcPerms & 2; } else { - $permsEdit = $calcPerms&16; + $permsEdit = $calcPerms & 16; } // "Edit" link: ( Only if permissions to edit the page-record of the content of the parent page ($this->id) // @todo Is there an existing function to generate this link? if ($permsEdit) { - $editLink = 'alt_doc.php?' . '&edit['.$tableName.']['.$row['uid'].']=edit'; + $editLink = 'alt_doc.php?' . '&edit[' . $tableName . '][' . $row['uid'] . ']=edit'; } return $editLink; @@ -299,7 +299,8 @@ $titleLength = $GLOBALS['BE_USER']->uc['titleLen']; } - return htmlspecialchars(t3lib_div::fixed_lgd_cs($title, $titleLength));; + return htmlspecialchars(t3lib_div::fixed_lgd_cs($title, $titleLength)); + ; } /** @@ -326,9 +327,9 @@ protected function makeQuerySearchByTable($tableName, $fieldsToSearchWithin) { // free text search $queryLikeStatement = ' LIKE \'%' . $this->getQueryString($tableName) . '%\''; - $queryPart = ' AND (' . implode($queryLikeStatement . ' OR ', $fieldsToSearchWithin) . $queryLikeStatement . ')'; + $queryPart = ' AND (' . implode($queryLikeStatement . ' OR ', $fieldsToSearchWithin) . $queryLikeStatement . ')'; - $queryPart .= t3lib_BEfunc::deleteClause($tableName); + $queryPart .= t3lib_BEfunc::deleteClause($tableName); - $queryPart .= t3lib_BEfunc::versioningPlaceholderClause($tableName); + $queryPart .= t3lib_BEfunc::versioningPlaceholderClause($tableName); return $queryPart; } @@ -345,7 +346,7 @@ $orderBy = ''; if (is_array($GLOBALS['TCA'][$tableName]['ctrl']) && array_key_exists('sortby', $GLOBALS['TCA'][$tableName]['ctrl'])) { - $orderBy = 'ORDER BY '.$GLOBALS['TCA'][$tableName]['ctrl']['sortby']; + $orderBy = 'ORDER BY ' . $GLOBALS['TCA'][$tableName]['ctrl']['sortby']; } else { $orderBy = $GLOBALS['TCA'][$tableName]['ctrl']['default_sortby']; } @@ -363,27 +364,27 @@ $fieldListArray = array(); // Traverse configured columns and add them to field array, if available for user. - foreach((array) $GLOBALS['TCA'][$tableName]['columns'] as $fieldName => $fieldValue) { + foreach ((array) $GLOBALS['TCA'][$tableName]['columns'] as $fieldName => $fieldValue) { - // @todo Reformat + // @todo Reformat if ( - (!$fieldValue['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $tableName . ':' . $fieldName)) // does current user have access to the field + (!$fieldValue['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $tableName . ':' . $fieldName)) // does current user have access to the field && - ($fieldValue['config']['type'] != 'passthrough') // field type is not searchable + ($fieldValue['config']['type'] != 'passthrough') // field type is not searchable && - (!preg_match('/date|time|int/', $fieldValue['config']['eval'])) // field can't be of type date, time, int + (!preg_match('/date|time|int/', $fieldValue['config']['eval'])) // field can't be of type date, time, int && - ( - ($fieldValue['config']['type'] == 'text') + ( + ($fieldValue['config']['type'] == 'text') || - ($fieldValue['config']['type'] == 'input') - ) - ) { + ($fieldValue['config']['type'] == 'input') + ) + ) { $fieldListArray[] = $fieldName; } } // Add special fields: - if ($GLOBALS['BE_USER']->isAdmin()) { + if ($GLOBALS['BE_USER']->isAdmin()) { $fieldListArray[] = 'uid'; $fieldListArray[] = 'pid'; } @@ -450,7 +451,7 @@ $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->init('AND ' . $this->userPermissions); $tree->makeHTML = 0; - $tree->fieldArray = Array('uid','php_tree_stop'); + $tree->fieldArray = array('uid', 'php_tree_stop'); if ($depth) { $tree->getTree($id, $depth, ''); }