74 $GLOBALS[
'LANG']->includeLLFile(
'EXT:indexed_search/modfunc1/locallang.xlf');
87 0 => $LANG->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_0'),
88 1 => $LANG->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_1'),
89 2 => $LANG->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_2'),
90 3 => $LANG->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_3'),
91 999 => $LANG->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_infi')
95 1 =>
'Technical Details',
96 2 =>
'Words and content' 111 if ($this->pObj->id <= 0) {
115 $this->indexerConfig = unserialize(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXT'][
'extConf'][
'indexed_search']);
117 $this->enableMetaphoneSearch = isset($this->indexerConfig[
'enableMetaphoneSearch']) ? ($this->indexerConfig[
'enableMetaphoneSearch'] ? TRUE : FALSE) : TRUE;
134 if (is_array($TYPO3_CONF_VARS[
'EXTCONF'][
'indexed_search'][
'external_parsers'])) {
135 foreach ($TYPO3_CONF_VARS[
'EXTCONF'][
'indexed_search'][
'external_parsers'] as $extension => $_objRef) {
138 if (!$this->external_parsers[$extension]->softInit($extension)) {
139 unset($this->external_parsers[$extension]);
146 $this->pObj->content = str_replace(
'/*###POSTCSSMARKER###*/',
' 147 TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } 148 ', $this->pObj->content);
152 $theOutput .= $this->pObj->doc->spacer(5);
156 $theOutput .= $this->pObj->doc->spacer(5);
160 $theOutput .= $this->pObj->doc->spacer(5);
164 $theOutput .= $this->pObj->doc->spacer(5);
169 $h_func =
BackendUtility::getFuncMenu($this->pObj->id,
'SET[type]', $this->pObj->MOD_SETTINGS[
'type'], $this->pObj->MOD_MENU[
'type']);
170 $h_func .=
BackendUtility::getFuncMenu($this->pObj->id,
'SET[depth]', $this->pObj->MOD_SETTINGS[
'depth'], $this->pObj->MOD_MENU[
'depth']);
172 $theOutput .= $this->pObj->doc->header($LANG->getLL(
'title'));
173 $theOutput .= $this->pObj->doc->section(
'', $h_func, 0, 1);
194 $perms_clause =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
195 $tree->init(
'AND ' . $perms_clause);
197 $tree->tree[] = array(
198 'row' => $this->pObj->pageinfo,
201 if ($this->pObj->MOD_SETTINGS[
'depth']) {
202 $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS[
'depth'],
'');
206 foreach ($tree->tree as $data) {
211 $code =
'<br /><br /> 212 <table border="0" cellspacing="1" cellpadding="2" class="c-list">' . $this->
printPhashRowHeader() . $code .
'</table>';
214 $theOutput .= $this->pObj->doc->section(
'', $code, 0, 1);
216 $theOutput .= $this->pObj->doc->section(
'',
'<br /><br />' . $this->pObj->doc->icons(1) .
'There were no indexed pages found in the tree.<br /><br />', 0, 1);
231 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'ISEC.phash_t3, ISEC.rl0, ISEC.rl1, ISEC.rl2, ISEC.page_id, ISEC.uniqid, ' .
'IP.phash, IP.phash_grouping, IP.cHashParams, IP.data_filename, IP.data_page_id, ' .
'IP.data_page_reg1, IP.data_page_type, IP.data_page_mp, IP.gr_list, IP.item_type, ' .
'IP.item_title, IP.item_description, IP.item_mtime, IP.tstamp, IP.item_size, ' .
'IP.contentHash, IP.crdate, IP.parsetime, IP.sys_language_uid, IP.item_crdate, ' .
'IP.externalUrl, IP.recordUid, IP.freeIndexUid, IP.freeIndexSetId, count(*) AS count_val',
'index_phash IP, index_section ISEC',
'IP.phash = ISEC.phash AND ISEC.page_id = ' . (
int)$data[
'uid'],
'IP.phash,IP.phash_grouping,IP.cHashParams,IP.data_filename,IP.data_page_id,IP.data_page_reg1,IP.data_page_type,IP.data_page_mp,IP.gr_list,IP.item_type,IP.item_title,IP.item_description,IP.item_mtime,IP.tstamp,IP.item_size,IP.contentHash,IP.crdate,IP.parsetime,IP.sys_language_uid,IP.item_crdate,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2,ISEC.page_id,ISEC.uniqid,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId',
'IP.item_type, IP.tstamp', $this->maxListPerPage + 1);
240 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
241 if ($rowCount == $this->maxListPerPage) {
249 $phashAcc[] = $row[
'phash'];
250 $this->allPhashListed[] = $row[
'phash'];
254 $cellAttrib = $data[
'_CSSCLASS'] ?
' class="' . $data[
'_CSSCLASS'] .
'"' :
'';
256 $firstColContent =
'<td rowspan="' . $rowCount .
'"' . $cellAttrib .
'>' . $firstColContent .
'</td>';
257 foreach ($lines as $rowSet) {
258 foreach ($rowSet as $rows) {
260 <tr class="bgColor-20">' . $firstColContent . implode(
'', $rows) .
'</tr>';
261 $firstColContent =
'';
264 if ($rowCount > $this->maxListPerPage) {
267 <tr class="bgColor-20"> 269 <td colspan="' . ($this->
returnNumberOfColumns() - 1) .
'">' . $this->pObj->doc->icons(3) .
'<span class="">There were more than ' . $this->maxListPerPage .
' rows. <a href="' . htmlspecialchars(
BackendUtility::getModuleUrl(
'web_info', array(
'id' => $this->pObj->id,
'listAll' => 1))) .
'">Click here to list them ALL!</a></span></td> 274 <tr class="bgColor-20"> 275 <td' . $cellAttrib .
'>' . $firstColContent .
'</td> 280 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'IP.*',
'index_phash IP',
'IP.data_page_id = ' . (
int)$data[
'uid'] .
' AND IP.phash NOT IN (' . implode(
',', $phashAcc) .
')');
281 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
283 <tr class="typo3-red"> 284 <td colspan="' . $this->
returnNumberOfColumns() .
'"><strong>Warning:</strong> phash-row "' . $row[
'phash'] .
'" didn\'t have a representation in the index_section table!</td> 286 $this->allPhashListed[] = $row[
'phash'];
304 $titleCellAttribs = $row[
'count_val'] != 1 ?
' bgcolor="red"' : ($row[
'item_type'] ===
'0' ?
' class="bgColor4"' :
'');
305 if ($row[
'item_type']) {
306 $arr = unserialize($row[
'cHashParams']);
307 $page = $arr[
'key'] ?
' [' . $arr[
'key'] .
']' :
'';
313 switch ($this->pObj->MOD_SETTINGS[
'type']) {
318 $lines[] =
'<td>' . $this->
makeItemTypeIcon($row[
'item_type'], ($row[
'data_filename'] ? $row[
'data_filename'] : $row[
'item_title'])) .
'</td>';
320 $lines[] =
'<td> </td>';
323 $lines[] =
'<td' . $titleCellAttribs .
'>' . $elTitle .
'</td>';
325 $lines[] =
'<td>' . $cmdLinks .
'</td>';
327 $lines[] =
'<td>' . $row[
'phash'] .
'</td>';
328 $lines[] =
'<td>' . $row[
'contentHash'] .
'</td>';
329 if ($row[
'item_type'] ===
'0') {
330 $lines[] =
'<td>' . ($row[
'data_page_id'] ? $row[
'data_page_id'] :
' ') .
'</td>';
331 $lines[] =
'<td>' . ($row[
'data_page_type'] ? $row[
'data_page_type'] :
' ') .
'</td>';
332 $lines[] =
'<td>' . ($row[
'sys_language_uid'] ? $row[
'sys_language_uid'] :
' ') .
'</td>';
333 $lines[] =
'<td>' . ($row[
'data_page_mp'] ? $row[
'data_page_mp'] :
' ') .
'</td>';
335 $lines[] =
'<td colspan="4">' . htmlspecialchars($row[
'data_filename']) .
'</td>';
339 $lines[] =
'<td>' . ($row[
'page_id'] ? $row[
'page_id'] :
' ') .
'</td>';
340 $lines[] =
'<td>' . ($row[
'phash_t3'] != $row[
'phash'] ? $row[
'phash_t3'] :
' ') .
'</td>';
341 $lines[] =
'<td>' . ($row[
'freeIndexUid'] ? $row[
'freeIndexUid'] . ($row[
'freeIndexSetId'] ?
'/' . $row[
'freeIndexSetId'] :
'') :
' ') .
'</td>';
342 $lines[] =
'<td>' . ($row[
'recordUid'] ? $row[
'recordUid'] :
' ') .
'</td>';
344 $arr = unserialize($row[
'cHashParams']);
345 if (!is_array($arr)) {
347 'cHash' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_general.xlf:LGL.error', TRUE)
350 $theCHash = $arr[
'cHash'];
351 unset($arr[
'cHash']);
352 if ($row[
'item_type']) {
354 $lines[] =
'<td>' . ($arr[
'key'] ?
'Page ' . $arr[
'key'] :
'') .
' </td>';
355 } elseif ($row[
'item_type'] == 0) {
358 $lines[] =
'<td class="bgColor"> </td>';
360 $lines[] =
'<td>' . $theCHash .
'</td>';
366 $lines[] =
'<td>' . $this->
makeItemTypeIcon($row[
'item_type'], ($row[
'data_filename'] ? $row[
'data_filename'] : $row[
'item_title'])) .
'</td>';
368 $lines[] =
'<td> </td>';
371 $lines[] =
'<td' . $titleCellAttribs .
'>' . $elTitle .
'</td>';
373 $lines[] =
'<td>' . $cmdLinks .
'</td>';
375 $ftrow =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'*',
'index_fulltext',
'phash = ' . (
int)$row[
'phash']);
376 $lines[] =
'<td style="white-space: normal;">' . htmlspecialchars(
GeneralUtility::fixed_lgd_cs($ftrow[
'fulltextdata'], 3000)) .
'<hr/><em>Size: ' . strlen($ftrow[
'fulltextdata']) .
'</em>' .
'</td>';
378 $ftrows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'index_words.baseword, index_rel.*',
'index_rel, index_words',
'index_rel.phash = ' . (
int)$row[
'phash'] .
' AND index_words.wid = index_rel.wid',
'',
'',
'',
'baseword');
380 if (is_array($ftrows)) {
381 $indexed_words = array_keys($ftrows);
382 sort($indexed_words);
383 $wordList = htmlspecialchars(implode(
' ', $indexed_words));
384 $wordList .=
'<hr/><em>Count: ' . count($indexed_words) .
'</em>';
386 $lines[] =
'<td style="white-space: normal;">' . $wordList .
'</td>';
392 $lines[] =
'<td>' . $this->
makeItemTypeIcon($row[
'item_type'], ($row[
'data_filename'] ? $row[
'data_filename'] : $row[
'item_title'])) .
'</td>';
394 $lines[] =
'<td> </td>';
397 $lines[] =
'<td' . $titleCellAttribs .
'>' . $elTitle .
'</td>';
399 $lines[] =
'<td>' . $cmdLinks .
'</td>';
400 $lines[] =
'<td style="white-space: normal;">' . htmlspecialchars($row[
'item_description']) .
'...</td>';
415 switch ($this->pObj->MOD_SETTINGS[
'type']) {
417 $lines[] =
'<td> </td>';
418 $lines[] =
'<td> </td>';
419 $lines[] =
'<td>Title</td>';
420 $lines[] =
'<td bgcolor="red">' . $this->
printRemoveIndexed(
'ALL',
'Clear ALL phash-rows below!') .
'</td>';
421 $lines[] =
'<td>pHash</td>';
422 $lines[] =
'<td>contentHash</td>';
423 $lines[] =
'<td>&id</td>';
424 $lines[] =
'<td>&type</td>';
425 $lines[] =
'<td>&L</td>';
426 $lines[] =
'<td>&MP</td>';
427 $lines[] =
'<td>grlist</td>';
428 $lines[] =
'<td>Rootline</td>';
429 $lines[] =
'<td>page_id</td>';
430 $lines[] =
'<td>phash_t3</td>';
431 $lines[] =
'<td>CfgUid</td>';
432 $lines[] =
'<td>RecUid</td>';
433 $lines[] =
'<td>GET-parameters</td>';
434 $lines[] =
'<td>&cHash</td>';
437 $lines[] =
'<td> </td>';
438 $lines[] =
'<td> </td>';
439 $lines[] =
'<td>Title</td>';
440 $lines[] =
'<td bgcolor="red">' . $this->
printRemoveIndexed(
'ALL',
'Clear ALL phash-rows below!') .
'</td>';
441 $lines[] =
'<td>Content<br /> 442 <img src="clear.gif" width="300" height="1" alt="" /></td>';
443 $lines[] =
'<td>Words<br /> 444 <img src="clear.gif" width="300" height="1" alt="" /></td>';
447 $lines[] =
'<td> </td>';
448 $lines[] =
'<td> </td>';
449 $lines[] =
'<td>Title</td>';
450 $lines[] =
'<td bgcolor="red">' . $this->
printRemoveIndexed(
'ALL',
'Clear ALL phash-rows below!') .
'</td>';
451 $lines[] =
'<td>Description</td>';
452 $lines[] =
'<td>Size</td>';
453 $lines[] =
'<td>Indexed:</td>';
455 $out =
'<tr class="tableheader bgColor5">' . implode(
'', $lines) .
'</tr>';
466 switch ($this->pObj->MOD_SETTINGS[
'type']) {
492 $phash = (int)$phash;
494 $phashRecord =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'*',
'index_phash',
'phash = ' . $phash);
496 if (is_array($phashRecord)) {
499 $ftrows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'*',
'index_debug',
'phash = ' . $phash);
500 if (is_array($ftrows)) {
501 $debugInfo = unserialize($ftrows[0][
'debuginfo']);
502 $lexer = $debugInfo[
'lexer'];
503 unset($debugInfo[
'lexer']);
505 $content .=
'<h4>Debug information / lexer splitting:</h4>' .
'<hr/><strong>' . $lexer .
'</strong><hr/>';
507 $content .=
'<h3>Word statistics</h3>';
509 $ftrows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'index_words.*, index_rel.*',
'index_rel, index_words',
'index_rel.phash = ' . $phash .
' AND index_words.wid = index_rel.wid',
'',
'index_words.baseword',
'');
510 $pageRec = BackendUtility::getRecord(
'pages', $phashRecord[
'data_page_id']);
511 $showStopWordCheckBox =
$GLOBALS[
'BE_USER']->isAdmin();
512 $content .= $this->
listWords($ftrows,
'All words found on page (' . count($ftrows) .
'):', $showStopWordCheckBox, $pageRec);
513 if ($this->enableMetaphoneSearch) {
515 $metaphone = array();
516 foreach ($ftrows as $row) {
517 $metaphone[$row[
'metaphone']][] = $row[
'baseword'];
522 $ftrows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'index_words.baseword, index_words.metaphone, index_rel.*',
'index_rel, index_words',
'index_rel.phash = ' . $phash .
' AND index_words.wid = index_rel.wid 523 AND index_words.is_stopword=0',
'',
'index_rel.freq DESC',
'20');
524 $content .= $this->
listWords($ftrows,
'Top-20 words by frequency:', 2);
526 $ftrows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'index_words.baseword, index_words.metaphone, index_rel.*',
'index_rel, index_words',
'index_rel.phash = ' . $phash .
' AND index_words.wid = index_rel.wid 527 AND index_words.is_stopword=0',
'',
'index_rel.count DESC',
'20');
528 $content .= $this->
listWords($ftrows,
'Top-20 words by count:', 2);
529 $content .=
'<h3>Section records for this phash</h3>';
531 $ftrows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'*',
'index_section',
'index_section.phash = ' . $phash,
'',
'',
'');
536 $content .=
'Error: No phash row found';
551 public function listWords($ftrows, $header, $stopWordBoxes = FALSE, $page =
'') {
557 <tr class="tableheader bgColor5"> 558 ' . ($stopWordBoxes ?
'<td>' . htmlspecialchars(
'Stopword:') .
'</td>' :
'') .
' 559 <td>' . htmlspecialchars(
'Word:') .
'</td> 560 <td>' . htmlspecialchars(
'Count:') .
'</td> 561 <td>' . htmlspecialchars(
'First:') .
'</td> 562 <td>' . htmlspecialchars(
'Frequency:') .
'</td> 563 <td>' . htmlspecialchars(
'Flags:') .
'</td> 564 ' . (is_array($keywords) ?
'<td>' . htmlspecialchars(
'Page keyword:') .
'</td>' :
'') .
' 567 foreach ($ftrows as $row) {
568 $hiddenField = $stopWordBoxes != 2 ?
'<input type="hidden" name="stopWord[' . $row[
'wid'] .
']" value="0" />' :
'';
570 <tr class="' . ($row[
'is_stopword'] ?
'bgColor' :
'bgColor4') .
'"> 571 ' . ($stopWordBoxes ?
'<td align="center"' . ($row[
'is_stopword'] ?
' style="background-color:red;"' :
'') .
'>' . $hiddenField .
'<input type="checkbox" name="stopWord[' . $row[
'wid'] .
']" value="1"' . ($row[
'is_stopword'] ?
'checked="checked"' :
'') .
' /></td>' :
'') .
' 572 <td>' . $this->
linkWordDetails(htmlspecialchars($row[
'baseword']), $row[
'wid']) .
'</td> 573 <td>' . htmlspecialchars($row[
'count']) .
'</td> 574 <td>' . htmlspecialchars($row[
'first']) .
'</td> 575 <td>' . htmlspecialchars($row[
'freq']) .
'</td> 576 <td>' . htmlspecialchars($this->
flagsMsg($row[
'flags'])) .
'</td> 577 ' . (is_array($keywords) ?
'<td align="center"' . (isset($keywords[$row[
'baseword']]) ?
' class="bgColor2"' :
'') .
'><input type="hidden" name="pageKeyword[' . $row[
'baseword'] .
']" value="0" /><input type="checkbox" name="pageKeyword[' . $row[
'baseword'] .
']" value="1"' . (isset($keywords[$row[
'baseword']]) ?
'checked="checked"' :
'') .
' /></td>' :
'') .
' 581 return '<h4>' . htmlspecialchars($header) .
'</h4>' .
' 582 <table border="0" cellspacing="1" cellpadding="2" class="c-list"> 584 </table>' . ($stopWordBoxes ?
'<input type="submit" value="Change stop-word settings" name="_stopwords" onclick="document.webinfoForm.action=\'' . htmlspecialchars(
GeneralUtility::getIndpEnv(
'REQUEST_URI')) .
'\';
" />' : '') . (is_array($keywords) ? '<input type="submit
" value="Set page keywords
" name="_pageKeywords
" onclick="document.webinfoForm.action=\
'' . htmlspecialchars(
GeneralUtility::getIndpEnv(
'REQUEST_URI')) .
'\';
" /><input type="hidden
" name="pageKeyword_pageUid
" value="' . $page['uid
'] . '" />' . '<br />Current keywords are: <em>' . htmlspecialchars(implode(', ', array_keys($keywords))) . '</em>' : ''); 595 public function listMetaphoneStat($ftrows, $header) { 598 <tr class="tableheader bgColor5
"> 599 <td>' . htmlspecialchars('Metaphone:') . '</td> 600 <td>' . htmlspecialchars('Hash:') . '</td> 601 <td>' . htmlspecialchars('Count:') . '</td> 602 <td>' . htmlspecialchars('Words:') . '</td> 605 foreach ($ftrows as $metaphone => $words) { 606 if (count($words) > 1) { 608 <tr class="bgColor4
"> 609 <td>' . $this->linkMetaPhoneDetails($this->indexerObj->metaphone($words[0], 1), $metaphone) . '</td> 610 <td>' . htmlspecialchars($metaphone) . '</td> 611 <td>' . htmlspecialchars(count($words)) . '</td> 612 <td style="white-space: normal;
">' . htmlspecialchars(implode(', ', $words)) . '</td> 617 return '<h4>' . htmlspecialchars($header) . '</h4>' . '<table border="0
" cellspacing="1
" cellpadding="2
" class="c-list
"> 630 public function linkWordDetails($string, $wid) { 631 return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('wid
' => $wid, 'phash
' => ''))) . '">' . $string . '</a>'; 642 public function linkMetaPhoneDetails($string, $metaphone) { 643 return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('metaphone
' => $metaphone, 'wid
' => '', 'phash
' => ''))) . '">' . $string . '</a>'; 653 public function flagsMsg($flags) { 655 return ($flags & 128 ? '<title>' : '') . ($flags & 64 ? '<meta/keywords>' : '') . ($flags & 32 ? '<meta/description>' : '') . ' (' . $flags . ')'; 659 /******************************* 661 * Details display, words / metaphone 663 *******************************/ 671 public function showDetailsForWord($wid) { 672 // Select references to this word 673 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_phash.*, index_section.*, index_rel.*', 'index_rel, index_section, index_phash', 'index_rel.wid = ' . (int)$wid . ' AND index_rel.phash = index_section.phash' . ' AND index_section.phash = index_phash.phash', '', 'index_rel.freq DESC', ''); 676 <tr class="tableheader bgColor5
"> 679 <td>data_filename</td> 685 if (is_array($ftrows)) { 686 foreach ($ftrows as $wDat) { 688 <tr class="bgColor4
"> 689 <td>' . $this->linkDetails(htmlspecialchars($wDat['phash']), $wDat['phash']) . '</td> 690 <td>' . htmlspecialchars($wDat['page_id']) . '</td> 691 <td>' . htmlspecialchars($wDat['data_filename']) . '</td> 692 <td>' . htmlspecialchars($wDat['count']) . '</td> 693 <td>' . htmlspecialchars($wDat['first']) . '</td> 694 <td>' . htmlspecialchars($wDat['freq']) . '</td> 695 <td>' . htmlspecialchars($wDat['flags']) . '</td> 701 <table border="0
" cellspacing="1
" cellpadding="2
" class="c-list
">' . $content . ' 704 $content = $content . $this->linkList(); 715 public function showDetailsForMetaphone($metaphone) { 716 // Finding top-20 on frequency for this phash: 717 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_words.*', 'index_words', 'index_words.metaphone = ' . (int)$metaphone, '', 'index_words.baseword', ''); 718 if (count($ftrows)) { 719 $content .= '<h4>Metaphone: ' . $this->indexerObj->metaphone($ftrows[0]['baseword'], 1) . '</h4>'; 721 <tr class="tableheader bgColor5
"> 723 <td>Is stopword?</td> 725 if (is_array($ftrows)) { 726 foreach ($ftrows as $wDat) { 728 <tr class="bgColor4
"> 729 <td>' . $this->linkWordDetails(htmlspecialchars($wDat['baseword']), $wDat['wid']) . '</td> 730 <td>' . htmlspecialchars(($wDat['is_stopword'] ? 'YES' : 'No')) . '</td> 735 <table border="0
" cellspacing="1
" cellpadding="2
" class="c-list
">' . $content . ' 737 if ($this->indexerObj->metaphone($ftrows[0]['baseword']) != $metaphone) { 738 $content .= 'ERROR: Metaphone string and hash did not match for some reason!?'; 741 $content = $content . $this->linkList(); 746 /******************************* 750 *******************************/ 759 public function printRemoveIndexed($phash, $alt) { 760 return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('deletePhash
' => $phash))) . '" title="' . htmlspecialchars($alt) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete') . '</a>'; 771 public function printReindex($resultRow, $alt) { 772 if ($resultRow['item_type'] && $resultRow['item_type'] !== '0') { 773 return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('reindex
' => $resultRow['phash
'], 'reindex_id
' => $resultRow['page_id
']))) . '">' . '<img ' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/refresh_n.gif', 'width="14
" height="14
"') . ' hspace="1
" vspace="2
" border="0
" title="' . htmlspecialchars($alt) . '" alt="" />' . '</a>'; 785 public function linkDetails($string, $phash) { 786 return '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('phash
' => $phash))) . '">' . $string . '</a>'; 795 public function linkList() { 796 return '<br /><a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_info
', array('id' => $this->pObj->id))) . '">Back to list.</a><br />'; 807 public function showPageDetails($string, $id) { 808 return '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_info
', array('id' => $id, 'SET
' => array('depth
' => 0, 'type
' => 1)))) . '">' . $string . '</a>'; 818 public function printExtraGrListRows($extraGrListRows) { 819 if (count($extraGrListRows)) { 821 foreach ($extraGrListRows as $r) { 822 $lines[] = $r['gr_list']; 824 return '<br />' . $GLOBALS['TBE_TEMPLATE']->dfw(implode('<br />', $lines)); 835 public function printRootlineInfo($row) { 836 $uidCollection = array(); 838 $uidCollection[0] = $row['rl0']; 840 $uidCollection[1] = $row['rl1']; 842 $uidCollection[2] = $row['rl2']; 843 // Additional levels: 844 if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) { 845 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) { 846 if ($row[$fieldName]) { 847 $uidCollection[$rootLineLevel] = $row[$fieldName]; 855 ksort($uidCollection); 856 return implode('/', $uidCollection); 867 public function makeItemTypeIcon($it, $alt = '') { 868 if (!isset($this->iconFileNameCache[$it])) { 870 $icon = 'EXT:indexed_search/pi/res/pages.gif'; 871 } elseif ($this->external_parsers[$it]) { 872 $icon = $this->external_parsers[$it]->getIcon($it); 874 $fullPath = GeneralUtility::getFileAbsFileName($icon); 876 $info = @getimagesize($fullPath); 877 $iconPath = $GLOBALS['BACK_PATH'] . '../' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($fullPath); 878 $this->iconFileNameCache[$it] = is_array($info) ? '<img src="' . $iconPath . '" ' . $info[3] . ' title="###TITLE_ATTRIBUTE###
" alt="" />' : ''; 881 return str_replace('###TITLE_ATTRIBUTE###', htmlspecialchars($it . ': ' . $alt), $this->iconFileNameCache[$it]); 884 /******************************** 888 *******************************/ 897 public function reindexPhash($phash, $pageId) { 899 $resultRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('ISEC.*, IP.*', 'index_phash IP, index_section ISEC', 'IP.phash = ISEC.phash 900 AND IP.phash = ' . (int)$phash . ' 901 AND ISEC.page_id = ' . (int)$pageId); 903 if (is_array($resultRow)) { 904 if ($resultRow['item_type'] && $resultRow['item_type'] !== '0') { 905 // (Re)-Indexing file on page. 906 $indexerObj = GeneralUtility::makeInstance('TYPO3\\CMS\\IndexedSearch\\Indexer'); 907 $indexerObj->backend_initIndexer($pageId, 0, 0, '', $this->getUidRootLineForClosestTemplate($pageId)); 908 // URL or local file: 909 if ($resultRow['externalUrl']) { 910 $indexerObj->indexExternalUrl($resultRow['data_filename']); 912 $indexerObj->indexRegularDocument($resultRow['data_filename'], TRUE); 914 if ($indexerObj->file_phash_arr['phash'] != $resultRow['phash']) { 915 $content .= 'ERROR: phash (' . $indexerObj->file_phash_arr['phash'] . ') did NOT match ' . $resultRow['phash'] . ' for strange reasons!'; 917 $content .= '<h4>Log for re-indexing of "' . htmlspecialchars($resultRow['data_filename
']) . '":</h4>'; 918 $content .= \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($indexerObj->internal_log); 919 $content .= '<h4>Hash-array, page:</h4>'; 920 $content .= \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($indexerObj->hash); 921 $content .= '<h4>Hash-array, file:</h4>'; 922 $content .= \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($indexerObj->file_phash_arr); 925 // Link back to list. 926 $content .= $this->linkList(); 938 public function getUidRootLineForClosestTemplate($id) { 939 $tmpl = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService'); 940 // Defined global here! 942 // Do not log time-performance information 945 $sys_page = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository'); 946 $rootLine = $sys_page->getRootLine($id); 947 $tmpl->runThroughTemplates($rootLine, 0); 948 // This generates the constants/config + hierarchy info for the template. 950 $rootline_uids = array(); 951 foreach ($tmpl->rootLine as $rlkey => $rldat) { 952 $rootline_uids[$rlkey] = $rldat['uid']; 954 return $rootline_uids; 957 /******************************** 961 *******************************/ 970 public function removeIndexedPhashRow($phashList, $clearPageCache = 1) { 971 // FIXME: This is only a workaround 972 if ($phashList == 'ALL') { 973 $this->drawTableOfIndexedPages(); 974 $phashRows = $this->allPhashListed; 975 $this->allPhashListed = array(); 977 $phashRows = GeneralUtility::trimExplode(',', $phashList, TRUE); 979 foreach ($phashRows as $phash) { 980 $phash = (int)$phash; 982 if ($clearPageCache) { 983 // Clearing page cache: 984 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('page_id', 'index_section', 'phash=' . (int)$phash); 985 if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) { 987 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 988 $idList[] = (int)$row['page_id']; 990 $pageCache = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('cache_pages'); 991 foreach ($idList as $pageId) { 992 $pageCache->flushByTag('pageId_' . $pageId); 996 // Removing old registrations for all tables. 997 $tableArr = explode(',', 'index_phash,index_rel,index_section,index_grlist,index_fulltext,index_debug'); 998 foreach ($tableArr as $table) { 999 $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'phash=' . (int)$phash); 1013 public function getGrListEntriesForPhash($phash, $gr_list) { 1014 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'index_grlist', 'phash=' . (int)$phash); 1017 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 1018 if (!$isRemoved && (string)$row['gr_list'] === (string)$gr_list) { 1034 public function processStopWords($stopWords) { 1035 if ($GLOBALS['BE_USER']->isAdmin()) { 1037 foreach ($stopWords as $wid => $state) { 1038 $fieldArray = array( 1039 'is_stopword' => $state 1041 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('index_words', 'wid=' . $wid, $fieldArray); 1054 public function processPageKeywords($pageKeywords, $pageUid) { 1055 // Get pages current keywords 1056 $pageRec = BackendUtility::getRecord('pages', $pageUid); 1057 $keywords = array_flip(GeneralUtility::trimExplode(',', $pageRec['keywords'], TRUE)); 1059 foreach ($pageKeywords as $key => $v) { 1061 $keywords[$key] = 1; 1063 unset($keywords[$key]); 1066 // Compile new list: 1068 $data['pages'][$pageUid]['keywords'] = implode(', ', array_keys($keywords)); 1069 $tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler'); 1070 $tce->stripslashes_values = 0; 1071 $tce->start($data, array()); 1072 $tce->process_datamap(); processPageKeywords($pageKeywords, $pageUid)
printExtraGrListRows($extraGrListRows)
$TYPO3_CONF_VARS['SYS']['contentTable']
removeIndexedPhashRow($phashList, $clearPageCache=1)
indexed_info($data, $firstColContent)
printRemoveIndexed($phash, $alt)
makeItemTypeIcon($it, $alt='')
listMetaphoneStat($ftrows, $header)
processStopWords($stopWords)
static getIndpEnv($getEnvName)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
showPageDetails($string, $id)
static makeInstance($className)
printReindex($resultRow, $alt)
linkWordDetails($string, $wid)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
drawTableOfIndexedPages()
getGrListEntriesForPhash($phash, $gr_list)
reindexPhash($phash, $pageId)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
static getIcon($table, $row=array(), $shaded=FALSE)
showDetailsForMetaphone($metaphone)
linkDetails($string, $phash)
static viewArray($array_in)
static getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script='', $addparams='')
listWords($ftrows, $header, $stopWordBoxes=FALSE, $page='')
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
static formatSize($sizeInBytes, $labels='')
printPhashRow($row, $grouping=0, $extraGrListRows)
showDetailsForPhash($phash)
static fixed_lgd_cs($string, $chars, $appendString='...')
static getRecordTitlePrep($title, $titleLength=0)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static dateTimeAge($tstamp, $prefix=1, $date='')