2 namespace TYPO3\CMS\Backend\Form\Wizard;
111 if (isset(
$config[
'pidList'])) {
113 $depth = (int)
$config[
'pidDepth'];
114 foreach ($pageIds as $pageId) {
121 if (isset(
$config[
'maxItemsInResultList'])) {
122 $this->maxItems =
$config[
'maxItemsInResultList'];
124 if ($this->table ==
'pages') {
125 $this->addWhere =
' AND ' .
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
129 if (
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'versioningWS'] ==
true) {
130 $this->addWhere .=
' AND t3ver_wsid = 0';
132 if (isset(
$config[
'addWhere'])) {
133 $this->addWhere .=
' ' .
$config[
'addWhere'];
153 $start = $recursionCounter * 50;
156 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*', $this->table, $this->selectClause,
'', $this->orderByStatement, $start .
', 50');
157 $allRowsCount =
$GLOBALS[
'TYPO3_DB']->sql_num_rows($res);
159 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
161 if (count($rows) > $this->maxItems) {
170 $spriteIcon = $this->iconFactory->getIconForRecord($this->table, $row,
Icon::SIZE_SMALL)->render();
171 $uid = $row[
't3ver_oid'] > 0 ? $row[
't3ver_oid'] : $row[
'uid'];
173 if (strlen($path) > 30) {
175 $croppedPath =
'<abbr title="' . htmlspecialchars($path) .
'">' .
177 $languageService->csConvObj->crop($languageService->charSet, $path, 10)
179 . $languageService->csConvObj->crop($languageService->charSet, $path, -20)
183 $croppedPath = htmlspecialchars($path);
187 'text' =>
'<span class="suggest-label">' . $label .
'</span><span class="suggest-uid">[' . $uid .
']</span><br />
188 <span class="suggest-path">' . $croppedPath .
'</span>',
189 'table' => $this->mmForeignTable ? $this->mmForeignTable : $this->table,
194 'class' => isset($this->config[
'cssClass']) ? $this->config[
'cssClass'] :
'',
195 'sprite' => $spriteIcon
197 $rows[$this->table .
'_' . $uid] = $this->
renderRecord($row, $entry);
199 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
201 if (count($rows) < $this->maxItems && $allRowsCount >= 50 && $recursionCounter < $this->maxItems) {
202 $tmp = self::queryTable(
$params, ++$recursionCounter);
203 $rows = array_merge($tmp, $rows);
217 $searchWholePhrase = !isset($this->config[
'searchWholePhrase']) || $this->config[
'searchWholePhrase'];
218 $searchString = $this->params[
'value'];
219 $searchUid = (int)$searchString;
220 if ($searchString !==
'') {
221 $searchString =
$GLOBALS[
'TYPO3_DB']->quoteStr($searchString, $this->table);
222 $likeCondition =
' LIKE \'' . ($searchWholePhrase ?
'%' :
'') .
$GLOBALS[
'TYPO3_DB']->escapeStrForLike($searchString, $this->table) .
'%\'';
226 $selectFields = array_unique($selectFields);
227 $selectParts = array();
228 foreach ($selectFields as $field) {
229 $selectParts[] = $field . $likeCondition;
231 $this->selectClause =
'(' . implode(
' OR ', $selectParts) .
')';
232 if ($searchUid > 0 && $searchUid == $searchString) {
233 $this->selectClause =
'(' . $this->selectClause .
' OR uid = ' . $searchUid .
')';
236 if (isset(
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'delete'])) {
239 if (!empty($this->allowedPages)) {
240 $pidList =
$GLOBALS[
'TYPO3_DB']->cleanIntArray($this->allowedPages);
241 if (!empty($pidList)) {
242 $this->selectClause .=
' AND pid IN (' . implode(
', ', $pidList) .
') ';
246 if (isset($this->config[
'searchCondition']) && $this->config[
'searchCondition'] !==
'') {
247 $this->selectClause .=
' AND ' . $this->config[
'searchCondition'];
262 $pageIds = array($uid);
264 $pages = array($uid);
266 while ($depth - $level > 0 && !empty($pageIds)) {
268 $pidList =
$GLOBALS[
'TYPO3_DB']->cleanIntArray($pageIds);
269 $rows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'uid',
'pages',
'pid IN (' . implode(
', ', $pidList) .
')',
'',
'',
'',
'uid');
271 $pageIds = array_keys($rows);
272 $pages = array_merge($pages, $pageIds);
288 if (
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'label']) {
336 if (
$GLOBALS[
'BE_USER']->workspace != 0 &&
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'versioningWS'] ==
true) {
351 return $this->iconFactory->getIconForRecord($this->mmForeignTable ?: $this->table, $row,
Icon::SIZE_SMALL)->render();
366 $titleLimit = max($this->config[
'maxPathTitleLength'], 0);
367 if (($this->mmForeignTable ? $this->mmForeignTable : $this->table) ==
'pages') {
371 $path = substr($path, 0, strrpos($path,
'/', -2)) .
'/';
401 if ($this->config[
'renderFunc'] !=
'') {
403 'table' => $this->table,
404 'uid' => $row[
'uid'],