From 1f3c2a08618b162c444c1248d20910c60cf10e1d Mon Sep 17 00:00:00 2001 From: christianbltr Date: Thu, 13 Oct 2016 17:17:25 +0200 Subject: [PATCH] code cleanup --- .../class.tx_kesearch_classes_flexform.php | 3 -- Classes/Backend/class.user_filterlist.php | 5 +-- .../Controller/BackendModuleController.php | 3 +- .../class.tx_kesearch_indexertask.php | 3 +- Classes/hooks/class.user_kesearchhooks.php | 2 +- Classes/indexer/class.tx_kesearch_indexer.php | 13 +++---- .../class.tx_kesearch_indexer_types.php | 24 ++++++------- ...lass.tx_kesearch_indexer_filetypes_doc.php | 1 - ...lass.tx_kesearch_indexer_filetypes_pdf.php | 9 +++-- ...lass.tx_kesearch_indexer_filetypes_ppt.php | 1 - ...lass.tx_kesearch_indexer_filetypes_xls.php | 1 - ....tx_kesearch_indexer_types_a21glossary.php | 5 +-- .../class.tx_kesearch_indexer_types_cal.php | 5 +-- ...ass.tx_kesearch_indexer_types_comments.php | 3 +- ...class.tx_kesearch_indexer_types_ke_yac.php | 7 ++-- ...lass.tx_kesearch_indexer_types_mmforum.php | 3 +- .../class.tx_kesearch_indexer_types_news.php | 3 +- .../class.tx_kesearch_indexer_types_page.php | 9 ++--- ...s.tx_kesearch_indexer_types_tt_address.php | 1 - ...s.tx_kesearch_indexer_types_tt_content.php | 3 +- ...class.tx_kesearch_indexer_types_ttnews.php | 3 +- Classes/lib/class.tx_kesearch_db.php | 7 ++-- Classes/lib/class.tx_kesearch_filters.php | 5 --- Classes/lib/class.tx_kesearch_lib.php | 8 ++--- Classes/lib/class.tx_kesearch_lib_helper.php | 1 - Classes/lib/class.tx_kesearch_lib_items.php | 3 +- .../class.tx_kesearch_lib_searchphrase.php | 1 - ...lass.tx_kesearch_lib_filters_textlinks.php | 3 +- .../TCA/tx_kesearch_filteroptions.php | 6 ++-- Configuration/TCA/tx_kesearch_filters.php | 21 +++++++---- Configuration/TCA/tx_kesearch_index.php | 9 ++--- .../TCA/tx_kesearch_indexerconfig.php | 35 +++++++++++++------ cli/class.cli_kesearch.php | 9 +++-- ext_tables.php | 4 ++- pi1/class.tx_kesearch_pi1_wizicon.php | 1 - 35 files changed, 118 insertions(+), 102 deletions(-) diff --git a/Classes/Backend/class.tx_kesearch_classes_flexform.php b/Classes/Backend/class.tx_kesearch_classes_flexform.php index cf16f6e7..cafbb1ed 100644 --- a/Classes/Backend/class.tx_kesearch_classes_flexform.php +++ b/Classes/Backend/class.tx_kesearch_classes_flexform.php @@ -2,9 +2,6 @@ class tx_kesearch_classes_flexform { - /** - * @var language - */ public $lang; public $notAllowedFields; diff --git a/Classes/Backend/class.user_filterlist.php b/Classes/Backend/class.user_filterlist.php index 51621a1a..8eb4d796 100644 --- a/Classes/Backend/class.user_filterlist.php +++ b/Classes/Backend/class.user_filterlist.php @@ -172,7 +172,8 @@ public function getListOfAvailableFilteroptionsForFlexforms(&$config) } if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilteroptionsForFlexforms'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilteroptionsForFlexforms'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilteroptionsForFlexforms'] as + $_classRef) { $_procObj = &TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyFilteroptionsForFlexforms($config, $rowFilter, $this); } @@ -180,4 +181,4 @@ public function getListOfAvailableFilteroptionsForFlexforms(&$config) } } } -} \ No newline at end of file +} diff --git a/Classes/Controller/BackendModuleController.php b/Classes/Controller/BackendModuleController.php index 92eef049..08e97b95 100644 --- a/Classes/Controller/BackendModuleController.php +++ b/Classes/Controller/BackendModuleController.php @@ -755,5 +755,4 @@ protected function getBackendUser() { return $GLOBALS['BE_USER']; } - -} \ No newline at end of file +} diff --git a/Classes/Scheduler/class.tx_kesearch_indexertask.php b/Classes/Scheduler/class.tx_kesearch_indexertask.php index c861536c..426be381 100644 --- a/Classes/Scheduler/class.tx_kesearch_indexertask.php +++ b/Classes/Scheduler/class.tx_kesearch_indexertask.php @@ -20,7 +20,8 @@ // include indexer class -require_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'Classes/indexer/class.tx_kesearch_indexer.php'); +require_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') + . 'Classes/indexer/class.tx_kesearch_indexer.php'); class tx_kesearch_indexertask extends \TYPO3\CMS\Scheduler\Task\AbstractTask { diff --git a/Classes/hooks/class.user_kesearchhooks.php b/Classes/hooks/class.user_kesearchhooks.php index 7fdfe6c0..4c644e7f 100644 --- a/Classes/hooks/class.user_kesearchhooks.php +++ b/Classes/hooks/class.user_kesearchhooks.php @@ -142,4 +142,4 @@ public function modifyTemplaVoilaIndexEntry($uid, &$pageContent, &$tags, $cached $additionalFields['orig_pid'] = $cachedPageRecords[0][$uid]['pid']; } } -} \ No newline at end of file +} diff --git a/Classes/indexer/class.tx_kesearch_indexer.php b/Classes/indexer/class.tx_kesearch_indexer.php index bc29be7a..ff31546a 100644 --- a/Classes/indexer/class.tx_kesearch_indexer.php +++ b/Classes/indexer/class.tx_kesearch_indexer.php @@ -39,10 +39,6 @@ class tx_kesearch_indexer public $indexingErrors = array(); public $startTime; public $currentRow = array(); // current row which have to be inserted/updated to database - - /** - * @var t3lib_Registry - */ public $registry; /** @@ -278,7 +274,8 @@ public function prepareStatements() // Statement to insert a new records to index table $GLOBALS['TYPO3_DB']->sql_query('PREPARE insertStmt FROM " INSERT INTO tx_kesearch_index - (pid, title, type, targetpid, content, tags, params, abstract, language, starttime, endtime, fe_group, tstamp, crdate' . $addInsertQueryFields . ') + (pid, title, type, targetpid, content, tags, params, abstract, language,' + . ' starttime, endtime, fe_group, tstamp, crdate' . $addInsertQueryFields . ') VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?' . $addInsertQueryValues . ', ?) "'); @@ -414,7 +411,6 @@ public function rotateSphinxIndex() $content .= '
SPHINX ' . $retRow . '
' . "\n"; } } - } else { $content .= '
SPHINX ERROR: "exec" call is not allowed. ' . 'Check your disable_functions setting in php.ini.
'; @@ -853,8 +849,9 @@ public function getTag($tagUid, $clearText = false) /** * Strips control characters - * @param string the content to sanitize - * @return string the sanitized content + * + * @param string $content content to sanitize + * @return string * @see http://forge.typo3.org/issues/34808 */ public function stripControlCharacters($content) diff --git a/Classes/indexer/class.tx_kesearch_indexer_types.php b/Classes/indexer/class.tx_kesearch_indexer_types.php index 6b6dd151..be8f0fd0 100644 --- a/Classes/indexer/class.tx_kesearch_indexer_types.php +++ b/Classes/indexer/class.tx_kesearch_indexer_types.php @@ -18,7 +18,7 @@ ***************************************************************/ use \TYPO3\CMS\Core\Utility\GeneralUtility; - +use \TYPO3\CMS\Backend\Utility\BackendUtility; /** * Plugin 'Faceted search' for the 'ke_search' extension. @@ -40,7 +40,6 @@ class tx_kesearch_indexer_types /** * needed to get all recursive pids - * @var t3lib_queryGenerator */ public $queryGen; @@ -139,8 +138,8 @@ public function getPidList($startingPointsRecursive = '', $singlePages = '', $ta // add complete page record to list of pids in $indexPids $where = ' AND ' . $table . '.pid = pages.uid '; - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); + $where .= BackendUtility::BEenableFields($table); + $where .= BackendUtility::deleteClause($table); $this->pageRecords = $this->getPageRecords($indexPids, $where, 'pages,' . $table, 'pages.*'); if (count($this->pageRecords)) { // create a new list of allowed pids @@ -153,8 +152,9 @@ public function getPidList($startingPointsRecursive = '', $singlePages = '', $ta /** * Add Tags to records array - * @param array Simple array with uids of pages - * @param string additional where-clause + * + * @param array $uids Simple array with uids of pages + * @param string $pageWhere additional where-clause * @return array extended array with uids and tags for records */ public function addTagsToRecords($uids, $pageWhere = '1=1') @@ -171,8 +171,8 @@ public function addTagsToRecords($uids, $pageWhere = '1=1') $where = 'pages.uid IN (' . implode(',', $uids) . ')'; $where .= ' AND pages.tx_kesearch_tags <> "" '; $where .= ' AND FIND_IN_SET(tx_kesearch_filteroptions.uid, pages.tx_kesearch_tags)'; - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_kesearch_filteroptions'); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_kesearch_filteroptions'); + $where .= BackendUtility::BEenableFields('tx_kesearch_filteroptions'); + $where .= BackendUtility::deleteClause('tx_kesearch_filteroptions'); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where, 'pages.uid', '', ''); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { @@ -188,8 +188,8 @@ public function addTagsToRecords($uids, $pageWhere = '1=1') $fields = 'automated_tagging, automated_tagging_exclude, tag'; $table = 'tx_kesearch_filteroptions'; $where = 'automated_tagging <> "" '; - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_kesearch_filteroptions'); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_kesearch_filteroptions'); + $where .= BackendUtility::BEenableFields('tx_kesearch_filteroptions'); + $where .= BackendUtility::deleteClause('tx_kesearch_filteroptions'); $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $table, $where); @@ -327,8 +327,8 @@ public function getTag($tagUid, $clearText = false) $fields = 'title,tag'; $table = 'tx_kesearch_filteroptions'; $where = 'uid="' . intval($tagUid) . '" '; - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); + $where .= BackendUtility::BEenableFields($table); + $where .= BackendUtility::deleteClause($table); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where, '', '', '1'); $anz = $GLOBALS['TYPO3_DB']->sql_num_rows($res); diff --git a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_doc.php b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_doc.php index 9ea5de15..a4bd6940 100644 --- a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_doc.php +++ b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_doc.php @@ -104,5 +104,4 @@ public function getContent($file) return false; } } - } diff --git a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_pdf.php b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_pdf.php index f804a371..5e0a8341 100644 --- a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_pdf.php +++ b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_pdf.php @@ -35,9 +35,9 @@ class tx_kesearch_indexer_filetypes_pdf extends tx_kesearch_indexer_types_file implements tx_kesearch_indexer_filetypes { - var $extConf = array(); // saves the configuration of extension ke_search_hooks - var $app = array(); // saves the path to the executables - var $isAppArraySet = false; + public $extConf = array(); // saves the configuration of extension ke_search_hooks + public $app = array(); // saves the path to the executables + public $isAppArraySet = false; /** * class constructor @@ -142,7 +142,7 @@ public function getPdfInfo($file) /** * Analysing PDF info into a useable format. - * @param array Array of PDF content, coming from the pdfinfo tool + * @param array $pdfInfoArray Data of PDF content, coming from the pdfinfo tool * @return array The pdf informations as array in a useable format */ public function splitPdfInfo($pdfInfoArray) @@ -169,5 +169,4 @@ public function removeEndJunk($string) { return trim(preg_replace('/[' . LF . chr(12) . ']*$/', '', $string)); } - } diff --git a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_ppt.php b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_ppt.php index 8ebe3bf8..7643e10e 100644 --- a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_ppt.php +++ b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_ppt.php @@ -101,5 +101,4 @@ public function getContent($file) return false; } } - } diff --git a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_xls.php b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_xls.php index 8148503b..03ce7a13 100644 --- a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_xls.php +++ b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_xls.php @@ -102,5 +102,4 @@ public function getContent($file) return false; } } - } diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_a21glossary.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_a21glossary.php index 7636394e..5efd292f 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_a21glossary.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_a21glossary.php @@ -105,7 +105,8 @@ public function startIndexing() // hook for custom modifications of the indexed data, e.g. the tags if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifya21glossaryIndexEntry'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifya21glossaryIndexEntry'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifya21glossaryIndexEntry'] as + $_classRef) { $_procObj = &TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifya21glossaryIndexEntry( $title, @@ -149,4 +150,4 @@ public function startIndexing() } return $content; } -} \ No newline at end of file +} diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_cal.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_cal.php index 2ff54fdf..1db9a9ed 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_cal.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_cal.php @@ -66,7 +66,8 @@ public function startIndexing() // index expired events? if (!$this->indexerConfig['cal_expired_events']) { - $where .= ' AND ((UNIX_TIMESTAMP(start_date) > UNIX_TIMESTAMP()) OR (UNIX_TIMESTAMP(end_date) > UNIX_TIMESTAMP())) '; + $where .= ' AND ((UNIX_TIMESTAMP(start_date) > UNIX_TIMESTAMP())' + . ' OR (UNIX_TIMESTAMP(end_date) > UNIX_TIMESTAMP())) '; } // add enablefields @@ -187,4 +188,4 @@ private function buildCategoryTags($eventUid, &$tags) } } } -} \ No newline at end of file +} diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_comments.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_comments.php index bb53170b..35a59fa4 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_comments.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_comments.php @@ -109,7 +109,8 @@ public function startIndexing() // hook for custom modifications of the indexed data, e. g. the tags if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyCommentsIndexEntry'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyCommentsIndexEntry'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyCommentsIndexEntry'] as + $_classRef) { $_procObj = &TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyCommentsIndexEntry( $title, diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_ke_yac.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_ke_yac.php index f558b6bd..a6d787ac 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_ke_yac.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_ke_yac.php @@ -84,8 +84,11 @@ public function startIndexing() $targetPID = $this->indexerConfig['targetpid']; // get tags - $yacRecordTags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', - $yacRecord['tx_keyacsearchtags_tags'], true); + $yacRecordTags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode( + ',', + $yacRecord['tx_keyacsearchtags_tags'], + true + ); $tags = ''; $clearTextTags = ''; diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_mmforum.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_mmforum.php index 84c6e8c1..61fccb31 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_mmforum.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_mmforum.php @@ -201,7 +201,8 @@ public function startIndexing() // hook for custom modifications of the indexed data, e. g. the tags if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyMMForumIndexEntry'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyMMForumIndexEntry'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyMMForumIndexEntry'] as + $_classRef) { $_procObj = &TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyMMForumIndexEntry( $title, diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_news.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_news.php index cfff07f0..6ba19f3b 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_news.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_news.php @@ -208,7 +208,8 @@ public function startIndexing() // hook for custom modifications of the indexed data, e.g. the tags if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyExtNewsIndexEntry'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyExtNewsIndexEntry'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyExtNewsIndexEntry'] as + $_classRef) { $_procObj = &\TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyExtNewsIndexEntry( $title, diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_page.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_page.php index bd767e4f..47c852dc 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_page.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_page.php @@ -33,6 +33,7 @@ use \TYPO3\CMS\Core\Resource\ResourceFactory; use \TYPO3\CMS\Core\Resource\FileInterface; use \TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException; + define('DONOTINDEX', -3); @@ -455,7 +456,6 @@ public function getPageContent($uid) ) { $pageContent[$ttContentRow['sys_language_uid']] .= $content; } - } } else { $this->counterWithoutContent++; @@ -816,7 +816,8 @@ public function storeFileContentToIndex($fileObject, $content, $fileIndexerObjec //hook for custom modifications of the indexed data, e. g. the tags if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFileIndexEntryFromContentIndexer'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFileIndexEntryFromContentIndexer'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFileIndexEntryFromContentIndexer'] as + $_classRef) { $_procObj = &\TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyFileIndexEntryFromContentIndexer( $fileObject, @@ -882,7 +883,8 @@ public function getContentFromContentElement($ttContentRow) // hook for modifiying a content elements content if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentFromContentElement'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentFromContentElement'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentFromContentElement'] as + $_classRef) { $_procObj = &\TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyContentFromContentElement( $bodytext, @@ -895,4 +897,3 @@ public function getContentFromContentElement($ttContentRow) return $bodytext; } } - diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_tt_address.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_tt_address.php index 2b5e5ba2..8c418a5a 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_tt_address.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_tt_address.php @@ -232,4 +232,3 @@ public function startIndexing() return $content; } } - diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_tt_content.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_tt_content.php index f3749740..2a327b07 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_tt_content.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_tt_content.php @@ -149,7 +149,8 @@ public function getPageContent($uid) // hook for custom modifications of the indexed data, e. g. the tags if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentIndexEntry'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentIndexEntry'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentIndexEntry'] as + $_classRef) { $_procObj = &TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyContentIndexEntry( $row['header'], diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_ttnews.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_ttnews.php index 9ae4d488..df788a05 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_ttnews.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_ttnews.php @@ -216,7 +216,8 @@ public function startIndexing() // hook for custom modifications of the indexed data, e. g. the tags if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyNewsIndexEntry'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyNewsIndexEntry'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyNewsIndexEntry'] as + $_classRef) { $_procObj = &TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyNewsIndexEntry( $title, diff --git a/Classes/lib/class.tx_kesearch_db.php b/Classes/lib/class.tx_kesearch_db.php index 7a7e8478..f71d7f5e 100644 --- a/Classes/lib/class.tx_kesearch_db.php +++ b/Classes/lib/class.tx_kesearch_db.php @@ -38,10 +38,6 @@ class tx_kesearch_db implements \TYPO3\CMS\Core\SingletonInterface * @var tx_kesearch_pi1 */ public $pObj; - - /** - * @var tslib_cObj - */ public $cObj; public function __construct($pObj) @@ -134,7 +130,8 @@ public function escapeString($string) */ public function getSearchResultBySphinx() { - require_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search_premium') . 'class.user_kesearchpremium.php'); + require_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search_premium') + . 'class.user_kesearchpremium.php'); $this->user_kesearchpremium = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('user_kesearchpremium'); // set ordering diff --git a/Classes/lib/class.tx_kesearch_filters.php b/Classes/lib/class.tx_kesearch_filters.php index b3a050f7..8efcfc7e 100644 --- a/Classes/lib/class.tx_kesearch_filters.php +++ b/Classes/lib/class.tx_kesearch_filters.php @@ -31,10 +31,6 @@ class tx_kesearch_filters * @var tx_kesearch_lib */ protected $pObj; - - /** - * @var tslib_cObj - */ protected $cObj; /** @@ -310,4 +306,3 @@ public function getTagChar() return $this->tagChar; } } - diff --git a/Classes/lib/class.tx_kesearch_lib.php b/Classes/lib/class.tx_kesearch_lib.php index e97dcfea..6fb217ac 100644 --- a/Classes/lib/class.tx_kesearch_lib.php +++ b/Classes/lib/class.tx_kesearch_lib.php @@ -408,7 +408,8 @@ public function renderFilters() // hook for modifying filter options if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptionsArray'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptionsArray'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptionsArray'] as + $_classRef) { $_procObj = &GeneralUtility::getUserObj($_classRef); $options = $_procObj->modifyFilterOptionsArray($filter['uid'], $options, $this); } @@ -450,7 +451,8 @@ public function renderFilters() default: // hook for custom filter renderer if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customFilterRenderer'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customFilterRenderer'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customFilterRenderer'] as + $_classRef) { $_procObj = &GeneralUtility::getUserObj($_classRef); $_procObj->customFilterRenderer($filter['uid'], $options, $this, $filterData); } @@ -513,7 +515,6 @@ public function compileCheckboxOptions($filter, $options) ) { $data['selected'] = 1; } - } else { // if an option was not found in the search results $data['disabled'] = 1; } @@ -1556,4 +1557,3 @@ public function sortArrayByColumn(&$arr, $col) $arr = $newArray; } } - diff --git a/Classes/lib/class.tx_kesearch_lib_helper.php b/Classes/lib/class.tx_kesearch_lib_helper.php index d30b51e6..d6b697b3 100644 --- a/Classes/lib/class.tx_kesearch_lib_helper.php +++ b/Classes/lib/class.tx_kesearch_lib_helper.php @@ -256,4 +256,3 @@ public static function getFile($uid) return $fileObject; } } - diff --git a/Classes/lib/class.tx_kesearch_lib_items.php b/Classes/lib/class.tx_kesearch_lib_items.php index 55a75575..9f4066c7 100644 --- a/Classes/lib/class.tx_kesearch_lib_items.php +++ b/Classes/lib/class.tx_kesearch_lib_items.php @@ -30,7 +30,8 @@ public function fillIndexerConfig(&$params, $pObj) { // hook for custom registration of further indexerConfigurations if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerIndexerConfiguration'])) { - foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerIndexerConfiguration'] as $_classRef) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerIndexerConfiguration'] as + $_classRef) { $_procObj = &TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->registerIndexerConfiguration($params, $pObj); } diff --git a/Classes/lib/class.tx_kesearch_lib_searchphrase.php b/Classes/lib/class.tx_kesearch_lib_searchphrase.php index 7c2854ea..48e6f574 100644 --- a/Classes/lib/class.tx_kesearch_lib_searchphrase.php +++ b/Classes/lib/class.tx_kesearch_lib_searchphrase.php @@ -19,7 +19,6 @@ use \TYPO3\CMS\Core\Utility\GeneralUtility; - /** * Plugin 'Faceted search - searchbox and filters' for the 'ke_search' extension. * @author Stefan Froemken diff --git a/Classes/lib/filters/class.tx_kesearch_lib_filters_textlinks.php b/Classes/lib/filters/class.tx_kesearch_lib_filters_textlinks.php index 9771c9a9..2c63db4d 100644 --- a/Classes/lib/filters/class.tx_kesearch_lib_filters_textlinks.php +++ b/Classes/lib/filters/class.tx_kesearch_lib_filters_textlinks.php @@ -206,7 +206,8 @@ public function renderTextlinks($filterUid, $optionsOfSearchresult, $lib) * get options of given filter and regarding current search result * Only options which are also found in result will be returned * @param array $filter The current looped filter - * @param array $additionalOptionValues This is an array with some additional informations for each filteroption (title, tag, amount of records, selected) + * @param array $additionalOptionValues This is an array with some additional + * informations for each filteroption (title, tag, amount of records, selected) * @return array A merged, sorted and complete Array with all option values we need */ public function getOptionsOfFilter($filter, $additionalOptionValues) diff --git a/Configuration/TCA/tx_kesearch_filteroptions.php b/Configuration/TCA/tx_kesearch_filteroptions.php index 7a66fe3f..1137520b 100644 --- a/Configuration/TCA/tx_kesearch_filteroptions.php +++ b/Configuration/TCA/tx_kesearch_filteroptions.php @@ -47,7 +47,8 @@ array('', 0), ), 'foreign_table' => 'tx_kesearch_filteroptions', - 'foreign_table_where' => 'AND tx_kesearch_filteroptions.pid=###CURRENT_PID### AND tx_kesearch_filteroptions.sys_language_uid IN (-1,0)', + 'foreign_table_where' => 'AND tx_kesearch_filteroptions.pid=###CURRENT_PID###' + . ' AND tx_kesearch_filteroptions.sys_language_uid IN (-1,0)', ) ), 'l10n_diffsource' => array( @@ -119,7 +120,8 @@ ), ), 'types' => array( - '0' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1;;1-1-1, title;;;;2-2-2, tag;;;;3-3-3, automated_tagging;;;;4-4-4,automated_tagging_exclude;;;;5-5-5') + '0' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1;;1-1-1,' + . ' title;;;;2-2-2, tag;;;;3-3-3, automated_tagging;;;;4-4-4,automated_tagging_exclude;;;;5-5-5') ), 'palettes' => array( '1' => array('showitem' => '') diff --git a/Configuration/TCA/tx_kesearch_filters.php b/Configuration/TCA/tx_kesearch_filters.php index a16984aa..5f6c9707 100644 --- a/Configuration/TCA/tx_kesearch_filters.php +++ b/Configuration/TCA/tx_kesearch_filters.php @@ -48,7 +48,8 @@ array('', 0), ), 'foreign_table' => 'tx_kesearch_filters', - 'foreign_table_where' => 'AND tx_kesearch_filters.pid=###CURRENT_PID### AND tx_kesearch_filters.sys_language_uid IN (-1,0)', + 'foreign_table_where' => 'AND tx_kesearch_filters.pid=###CURRENT_PID###' + . ' AND tx_kesearch_filters.sys_language_uid IN (-1,0)', ) ), 'l10n_diffsource' => array( @@ -107,7 +108,7 @@ 'type' => 'inline', 'foreign_table' => 'tx_kesearch_filteroptions', 'maxitems' => 500, - 'appearance' => Array( + 'appearance' => array( 'collapseAll' => true, 'expandSingle' => true, 'useSortable' => true, @@ -178,12 +179,18 @@ ), ), 'types' => array( - 'select' => array('showitem' => 'sys_language_uid;;;;1-1-1,l10n_parent, l10n_diffsource, hidden;;1;;1-1-1, title;;;;2-2-2,rendertype;;;;3-3-3, options, shownumberofresults, alphabeticalsorting;;;;4-4-4'), - 'list' => array('showitem' => 'sys_language_uid;;;;1-1-1,l10n_parent, l10n_diffsource, hidden;;1;;1-1-1, title;;;;2-2-2,rendertype;;;;3-3-3, options, shownumberofresults, alphabeticalsorting;;;;4-4-4'), - 'checkbox' => array('showitem' => 'sys_language_uid;;;;1-1-1,l10n_parent, l10n_diffsource, hidden;;1;;1-1-1, title;;;;2-2-2,rendertype;;;;3-3-3, markAllCheckboxes, options, shownumberofresults, alphabeticalsorting;;;;4-4-4'), - 'textlinks' => array('showitem' => 'sys_language_uid;;;;1-1-1,l10n_parent, l10n_diffsource, hidden;;1;;1-1-1, title;;;;2-2-2,rendertype;;;;3-3-3, target_pid, amount, shownumberofresults, alphabeticalsorting;;;;4-4-4, options') + 'select' => array('showitem' => 'sys_language_uid;;;;1-1-1,l10n_parent, l10n_diffsource, hidden;;1;;1-1-1,' + . ' title;;;;2-2-2,rendertype;;;;3-3-3, options, shownumberofresults, alphabeticalsorting;;;;4-4-4'), + 'list' => array('showitem' => 'sys_language_uid;;;;1-1-1,l10n_parent, l10n_diffsource, hidden;;1;;1-1-1,' + . ' title;;;;2-2-2,rendertype;;;;3-3-3, options, shownumberofresults, alphabeticalsorting;;;;4-4-4'), + 'checkbox' => array('showitem' => 'sys_language_uid;;;;1-1-1,l10n_parent, l10n_diffsource, hidden;;1;;1-1-1,' + . ' title;;;;2-2-2,rendertype;;;;3-3-3, markAllCheckboxes, options, shownumberofresults,' + . ' alphabeticalsorting;;;;4-4-4'), + 'textlinks' => array('showitem' => 'sys_language_uid;;;;1-1-1,l10n_parent, l10n_diffsource, hidden;;1;;1-1-1,' + . ' title;;;;2-2-2,rendertype;;;;3-3-3, target_pid, amount, shownumberofresults,' + . ' alphabeticalsorting;;;;4-4-4, options') ), 'palettes' => array( '1' => array('showitem' => '') ) -); \ No newline at end of file +); diff --git a/Configuration/TCA/tx_kesearch_index.php b/Configuration/TCA/tx_kesearch_index.php index 4d2d9b2a..57dc3758 100644 --- a/Configuration/TCA/tx_kesearch_index.php +++ b/Configuration/TCA/tx_kesearch_index.php @@ -148,10 +148,10 @@ 'maxitems' => 1, ) ), - 'sortdate' => Array( + 'sortdate' => array( 'exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_index.sortdate', - 'config' => Array( + 'config' => array( 'type' => 'input', 'size' => '10', 'max' => '20', @@ -185,9 +185,10 @@ ), ), 'types' => array( - '0' => array('showitem' => 'starttime;;;;1-1-1, endtime, fe_group, targetpid, content, params, type, tags, abstract, title;;;;2-2-2, language;;;;3-3-3') + '0' => array('showitem' => 'starttime;;;;1-1-1, endtime, fe_group, targetpid, content,' + . ' params, type, tags, abstract, title;;;;2-2-2, language;;;;3-3-3') ), 'palettes' => array( '1' => array('showitem' => '') ) -); \ No newline at end of file +); diff --git a/Configuration/TCA/tx_kesearch_indexerconfig.php b/Configuration/TCA/tx_kesearch_indexerconfig.php index 845bd75b..434867eb 100644 --- a/Configuration/TCA/tx_kesearch_indexerconfig.php +++ b/Configuration/TCA/tx_kesearch_indexerconfig.php @@ -17,7 +17,9 @@ 'requestUpdate' => 'type' ), 'interface' => array( - 'showRecordFieldList' => 'hidden,title,storagepid,startingpoints_recursive,single_pages,sysfolder,type,index_content_with_restrictions,index_passed_events,index_news_category_mode,index_news_category_selection,directories,fileext,filteroption,index_page_doctypes' + 'showRecordFieldList' => 'hidden,title,storagepid,startingpoints_recursive,single_pages,sysfolder,' + . 'type,index_content_with_restrictions,index_passed_events,index_news_category_mode,' + . 'index_news_category_selection,directories,fileext,filteroption,index_page_doctypes' ), 'columns' => array( 'hidden' => array( @@ -153,7 +155,8 @@ 'startingpoints_recursive' => array( 'exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.startingpoints_recursive', - 'displayCond' => 'FIELD:type:IN:page,tt_content,ttnews,tt_address,templavoila,comments,news,a21glossary,cal', + 'displayCond' => 'FIELD:type:IN:page,tt_content,ttnews,tt_address,templavoila,' + . 'comments,news,a21glossary,cal', 'config' => array( 'type' => 'group', 'internal_type' => 'db', @@ -213,11 +216,13 @@ 'renderType' => 'selectSingle', 'items' => array( array( - 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_content_with_restrictions.I.0', + 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.' + . 'index_content_with_restrictions.I.0', 'yes' ), array( - 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_content_with_restrictions.I.1', + 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.' + . 'index_content_with_restrictions.I.1', 'no' ), ), @@ -290,11 +295,11 @@ 'maxitems' => 1, ) ), - 'index_news_category_selection' => Array( + 'index_news_category_selection' => array( 'exclude' => 1, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_category_selection', 'displayCond' => 'FIELD:type:=:ttnews', - 'config' => Array( + 'config' => array( 'type' => 'none', ) ), @@ -318,7 +323,8 @@ ), 'index_news_useHRDatesSingleWithoutDay' => array( 'exclude' => 0, - 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_useHRDatesSingleWithoutDay', + 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.' + . 'index_news_useHRDatesSingleWithoutDay', 'displayCond' => 'FIELD:type:=:ttnews', 'config' => array( 'type' => 'check', @@ -371,7 +377,7 @@ 'config' => array( 'type' => 'input', 'size' => '30', - 'default' => '1,2,5' + 'default' => '1,2,5' ) ), 'commenttypes' => array( @@ -449,7 +455,12 @@ ) ), 'types' => array( - '0' => array('showitem' => 'hidden;;1;;1-1-1, title;;;;2-2-2, storagepid,targetpid;;;;3-3-3,type,startingpoints_recursive,single_pages,sysfolder,index_content_with_restrictions,index_passed_events,index_news_archived,index_news_category_mode,index_news_category_selection,index_extnews_category_selection,index_news_useHRDatesSingle,index_news_useHRDatesSingleWithoutDay,index_use_page_tags,fal_storage,directories,fileext,index_page_doctypes,contenttypes,commenttypes,filteroption,tvpath,index_use_page_tags_for_files,cal_expired_events') + '0' => array('showitem' => 'hidden;;1;;1-1-1, title;;;;2-2-2, storagepid,targetpid;;;;3-3-3,type,' + . 'startingpoints_recursive,single_pages,sysfolder,index_content_with_restrictions,index_passed_events,' + . 'index_news_archived,index_news_category_mode,index_news_category_selection,' + . 'index_extnews_category_selection,index_news_useHRDatesSingle,index_news_useHRDatesSingleWithoutDay,' + . 'index_use_page_tags,fal_storage,directories,fileext,index_page_doctypes,contenttypes,commenttypes,' + . 'filteroption,tvpath,index_use_page_tags_for_files,cal_expired_events') ), 'palettes' => array( '1' => array('showitem' => '') @@ -480,7 +491,8 @@ 'parentField' => 'parentcategory', ), 'foreign_table' => 'tx_news_domain_model_category', - 'foreign_table_where' => ' AND (tx_news_domain_model_category.sys_language_uid = 0 OR tx_news_domain_model_category.l10n_parent = 0) ORDER BY tx_news_domain_model_category.sorting', + 'foreign_table_where' => ' AND (tx_news_domain_model_category.sys_language_uid = 0' + . ' OR tx_news_domain_model_category.l10n_parent = 0) ORDER BY tx_news_domain_model_category.sorting', 'size' => 10, 'autoSizeMax' => 20, 'minitems' => 0, @@ -490,7 +502,8 @@ // news version 3 features system categories instead of it's own // category system which was used in previous versions if (version_compare(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('news'), '3.0.0') >= 0) { - $configurationArray['columns']['index_extnews_category_selection']['config']['treeConfig']['parentField'] = 'parent'; + $configurationArray['columns']['index_extnews_category_selection']['config']['treeConfig']['parentField'] = + 'parent'; $configurationArray['columns']['index_extnews_category_selection']['config']['foreign_table'] = 'sys_category'; $configurationArray['columns']['index_extnews_category_selection']['config']['foreign_table_where'] = ''; } diff --git a/cli/class.cli_kesearch.php b/cli/class.cli_kesearch.php index d717e830..b31b8342 100644 --- a/cli/class.cli_kesearch.php +++ b/cli/class.cli_kesearch.php @@ -28,7 +28,7 @@ class tx_kesearch_cli extends \TYPO3\CMS\Core\Controller\CommandLineController /** * Constructor */ - function tx_kesearch_cli() + public function tx_kesearch_cli() { // Running parent class constructor parent::__construct(); @@ -43,10 +43,10 @@ function tx_kesearch_cli() /** * CLI engine - * @param array Command line arguments - * @return string + * @param array + * @return string */ - function cli_main($argv) + public function cli_main($argv) { // make instance of indexer @@ -77,7 +77,6 @@ function cli_main($argv) break; } } - } // Call the functionality diff --git a/ext_tables.php b/ext_tables.php index b42b5f64..0142720a 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -71,7 +71,9 @@ 'backend_module', // Name of the module '', // Position of the module array( // Allowed controller action combinations - 'BackendModule' => 'startIndexing,indexedContent,indexTableInformation,searchwordStatistics,clearSearchIndex,lastIndexingReport,alert', + 'BackendModule' => + 'startIndexing,indexedContent,indexTableInformation,' + . 'searchwordStatistics,clearSearchIndex,lastIndexingReport,alert', ), array( // Additional configuration 'access' => 'user,group', diff --git a/pi1/class.tx_kesearch_pi1_wizicon.php b/pi1/class.tx_kesearch_pi1_wizicon.php index a311740e..d2710f9d 100644 --- a/pi1/class.tx_kesearch_pi1_wizicon.php +++ b/pi1/class.tx_kesearch_pi1_wizicon.php @@ -70,5 +70,4 @@ public function includeLocalLang() $LOCAL_LANG = $xmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); return $LOCAL_LANG; } - }