75 $this->userPermissions =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
87 $pageId = $this->queryParser->getId($searchQuery);
89 if (!empty($pageRecord)) {
101 public function find($searchQuery) {
102 $recordArray = array();
104 $mounts =
$GLOBALS[
'BE_USER']->returnWebmounts();
105 foreach ($mounts as $pageId) {
108 $pageIdList = implode(
',', array_unique(explode(
',', implode(
',', $pageList))));
111 if ($this->queryParser->isValidCommand($searchQuery)) {
112 $this->
setQueryString($this->queryParser->getSearchQueryValue($searchQuery));
113 $tableName = $this->queryParser->getTableNameFromCommand($searchQuery);
115 $recordArray[] = $this->
findByTable($tableName, $pageIdList, $limit);
131 $pageRecord = array();
132 $row = BackendUtility::getRecord(self::PAGE_JUMP_TABLE, $id);
133 if (is_array($row)) {
147 $getRecordArray = array();
148 foreach (
$GLOBALS[
'TCA'] as $tableName => $value) {
149 $recordArray = $this->
findByTable($tableName, $pageIdList,
'0,' . $limit);
150 $recordCount = count($recordArray);
152 $limit = $limit - $recordCount;
153 $getRecordArray[] = $recordArray;
159 return $getRecordArray;
176 $getRecordArray = array();
177 if (count($fieldsToSearchWithin) > 0) {
178 $pageBasedPermission = $tableName ==
'pages' && $this->userPermissions ? $this->userPermissions :
'1=1 ';
179 $where =
'pid IN (' . $pageIdList .
') AND ' . $pageBasedPermission . $this->
makeQuerySearchByTable($tableName, $fieldsToSearchWithin);
182 return $getRecordArray;
202 'FROM' => $tableName,
204 'ORDERBY' => $orderBy,
211 'id' => $tableName .
':' . $row[
'uid'],
212 'pageId' => $tableName ===
'pages' ? $row[
'uid'] : $row[
'pid'],
234 $calcPerms =
$GLOBALS[
'BE_USER']->calcPerms($pageInfo);
236 if ($tableName ==
'pages') {
237 $localCalcPerms =
$GLOBALS[
'BE_USER']->calcPerms(BackendUtility::getRecord(
'pages', $row[
'uid']));
238 $permsEdit = $localCalcPerms & 2;
240 $permsEdit = $calcPerms & 16;
246 $editLink =
'alt_doc.php?' .
'&edit[' . $tableName .
'][' . $row[
'uid'] .
']=edit&returnUrl=' . rawurlencode($returnUrl);
273 $titleLength =
$GLOBALS[
'BE_USER']->uc[
'titleLen'];
287 $whereParts = array();
290 foreach ($fieldsToSearchWithin as $fieldName) {
291 if ($fieldName ==
'uid' || $fieldName ==
'pid' || isset(
$GLOBALS[
'TCA'][$tableName][
'columns'][$fieldName])) {
292 $fieldConfig = &
$GLOBALS[
'TCA'][$tableName][
'columns'][$fieldName][
'config'];
294 if ($fieldName ==
'uid' || $fieldName ==
'pid' || $fieldConfig[
'type'] ==
'input' && $fieldConfig[
'eval'] &&
GeneralUtility::inList($fieldConfig[
'eval'],
'int')) {
297 $fieldConfig[
'type'] ==
'text' ||
298 $fieldConfig[
'type'] ==
'flex' ||
299 ($fieldConfig[
'type'] ==
'input' && (!$fieldConfig[
'eval'] ||
300 !preg_match(
'/date|time|int/', $fieldConfig[
'eval'])))) {
302 $whereParts[] = $fieldName .
' LIKE \'%' . $this->queryString .
'%\'';
307 $like =
'\'%
' . $GLOBALS['TYPO3_DB
']->escapeStrForLike($GLOBALS['TYPO3_DB
']->quoteStr($this->queryString, $tableName), $tableName) . '%\
'';
308 foreach ($fieldsToSearchWithin as $fieldName) {
309 if (isset(
$GLOBALS[
'TCA'][$tableName][
'columns'][$fieldName])) {
310 $fieldConfig = &
$GLOBALS[
'TCA'][$tableName][
'columns'][$fieldName][
'config'];
312 $format =
'LOWER(%s) LIKE LOWER(%s)';
313 if (is_array($fieldConfig[
'search'])) {
314 if (in_array(
'case', $fieldConfig[
'search'])) {
315 $format =
'%s LIKE %s';
318 if ($fieldConfig[
'search'][
'andWhere']) {
319 $format =
'((' . $fieldConfig[
'search'][
'andWhere'] .
') AND (' . $format .
'))';
323 if ($fieldConfig[
'type'] ==
'text' || $fieldConfig[
'type'] ==
'flex' || $fieldConfig[
'type'] ==
'input' && (!$fieldConfig[
'eval'] || !preg_match(
'/date|time|int/', $fieldConfig[
'eval']))) {
324 $whereParts[] = sprintf($format, $fieldName, $like);
330 if (count($whereParts) > 0) {
331 $queryPart =
' AND (' . implode(
' OR ', $whereParts) .
')';
337 $queryPart =
' AND 0 = 1';
350 if (is_array(
$GLOBALS[
'TCA'][$tableName][
'ctrl']) && array_key_exists(
'sortby',
$GLOBALS[
'TCA'][$tableName][
'ctrl'])) {
351 $sortBy = trim(
$GLOBALS[
'TCA'][$tableName][
'ctrl'][
'sortby']);
352 if (!empty($sortBy)) {
353 $orderBy =
'ORDER BY ' . $sortBy;
356 $orderBy =
$GLOBALS[
'TCA'][$tableName][
'ctrl'][
'default_sortby'];
358 return $GLOBALS[
'TYPO3_DB']->stripOrderBy($orderBy);
369 if (isset(
$GLOBALS[
'TCA'][$tableName][
'ctrl'][
'searchFields'])) {
372 $fieldListArray = array();
375 if (
$GLOBALS[
'BE_USER']->isAdmin()) {
376 $fieldListArray[] =
'uid';
377 $fieldListArray[] =
'pid';
379 return $fieldListArray;
389 return $GLOBALS[
'TYPO3_DB']->quoteStr($this->queryString, $tableName);
401 $this->limitCount = $limit;
437 $tree->init(
'AND ' . $this->userPermissions);
439 $tree->fieldArray = array(
'uid',
'php_tree_stop');
441 $tree->getTree($id, $depth,
'');
446 $idList = implode(
',', $tree->ids);
getEditLink($tableName, $row)
static readPageAccess($id, $perms_clause)
extractSearchableFieldsFromTable($tableName)
static canBeInterpretedAsInteger($var)
static getWorkspaceWhereClause($table, $workspaceId=NULL)
getQueryString($tableName='')
makeQuerySearchByTable($tableName, array $fieldsToSearchWithin)
const RECORD_TITLE_MAX_LENGTH
static makeInstance($className)
setLimitCount($limitCount)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
getRecordTitlePrep($title, $titleLength=0)
static removeXSS($string)
makeOrderByTable($tableName)
static getRecordTitle($table, $row, $prep=FALSE, $forceResult=TRUE)
static getSpriteIconForRecord($table, array $row, array $options=array())
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
const GROUP_TITLE_MAX_LENGTH
getAvailablePageIds($id, $depth)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
getTitleOfCurrentRecordType($tableName)
setQueryString($queryString)
static versioningPlaceholderClause($table)
getRecordArray($tableName, $where, $orderBy, $limit)
setStartCount($startCount)
static fixed_lgd_cs($string, $chars, $appendString='...')
static convertToPositiveInteger($theInt)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)
const RECURSIVE_PAGE_LEVEL
static deleteClause($table, $tableAlias='')
findByTable($tableName, $pageIdList, $limit)
findByGlobalTableList($pageIdList)