diff --git a/ChangeLog b/ChangeLog index f6573df3..373e2ecd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ Version 2.0.0 IMPORTANT: This version has breaking changes: Marker based templatating has been removed completely, support for TYPO 4.5 has been dropped! - feature: add fluid based templating. - task: remove "wrap" option for filter rendering, this can be done in the fluid template. +- task: raise minimun requirement to TYPO3 version 6.2 +- task: remove all checks for TYPO3 version. Version 1.10.2 - bugfix: add langDisable in flexform, https://forge.typo3.org/issues/64579 diff --git a/Classes/Backend/class.tx_kesearch_classes_flexform.php b/Classes/Backend/class.tx_kesearch_classes_flexform.php index 70641bc6..267ff042 100644 --- a/Classes/Backend/class.tx_kesearch_classes_flexform.php +++ b/Classes/Backend/class.tx_kesearch_classes_flexform.php @@ -6,17 +6,7 @@ class tx_kesearch_classes_flexform { var $lang; public function init() { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->lang = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Lang\\LanguageService'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->lang = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('language'); - } else { - $this->lang = t3lib_div::makeInstance('language'); - } - - if (TYPO3_VERSION_INTEGER < 6001000) { - t3lib_div::loadTCA('tx_kesearch_index'); - } + $this->lang = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Lang\\LanguageService'); } function listAvailableOrderingsForFrontend(&$config) { @@ -30,12 +20,7 @@ function listAvailableOrderingsForFrontend(&$config) { $res = $GLOBALS['TYPO3_DB']->sql_query('SHOW COLUMNS FROM tx_kesearch_index'); while($col = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($notAllowedFields, $col['Field']); - } else { - $isInList = t3lib_div::inList($notAllowedFields, $col['Field']); - } - + $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($notAllowedFields, $col['Field']); if(!$isInList) { $file = $GLOBALS['TCA']['tx_kesearch_index']['columns'][$col['Field']]['label']; $fieldLabel = $this->lang->sL($file); @@ -58,12 +43,7 @@ function listAvailableOrderingsForAdmin(&$config) { $res = $GLOBALS['TYPO3_DB']->sql_query('SHOW COLUMNS FROM tx_kesearch_index'); while($col = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($notAllowedFields, $col['Field']); - } else { - $isInList = t3lib_div::inList($notAllowedFields, $col['Field']); - } - + $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($notAllowedFields, $col['Field']); if(!$isInList) { $file = $GLOBALS['TCA']['tx_kesearch_index']['columns'][$col['Field']]['label']; $fieldLabel = $this->lang->sL($file); diff --git a/Classes/Backend/class.user_filterlist.php b/Classes/Backend/class.user_filterlist.php index 0ab2a4ca..0c1067de 100644 --- a/Classes/Backend/class.user_filterlist.php +++ b/Classes/Backend/class.user_filterlist.php @@ -51,13 +51,8 @@ function getListOfAvailableFiltersForFlexforms(&$config) { $fields = '*'; $table = 'tx_kesearch_filters'; $where = 'pid IN('.$intString.') '; - if (TYPO3_VERSION_INTEGER > 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table,$inv=0); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table,$inv=0); - } else { - $where .= t3lib_befunc::BEenableFields($table,$inv=0); - $where .= t3lib_befunc::deleteClause($table,$inv=0); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table,$inv=0); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table,$inv=0); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where,$groupBy='',$orderBy='',$limit=''); $anz = $GLOBALS['TYPO3_DB']->sql_num_rows($res); while ($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { @@ -76,11 +71,7 @@ function getListOfAvailableFiltersForTCA(&$config) { } // get the page TSconfig - if (TYPO3_VERSION_INTEGER > 7000000) { - $this->pageTSconfig=\TYPO3\CMS\Backend\Utility\BackendUtility::GetPagesTSconfig($currentPid); - } else { - $this->pageTSconfig=t3lib_BEfunc::GetPagesTSconfig($currentPid); - } + $this->pageTSconfig = \TYPO3\CMS\Backend\Utility\BackendUtility::GetPagesTSconfig($currentPid); $this->modTSconfig=$this->pageTSconfig['ke_search.']; // get filters @@ -96,13 +87,8 @@ function getListOfAvailableFiltersForTCA(&$config) { $where = '1=1 '; } - if (TYPO3_VERSION_INTEGER > 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table,$inv=0); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table,$inv=0); - } else { - $where .= t3lib_befunc::BEenableFields($table,$inv=0); - $where .= t3lib_befunc::deleteClause($table,$inv=0); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table,$inv=0); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table,$inv=0); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where,$groupBy='',$orderBy='',$limit=''); $anz = $GLOBALS['TYPO3_DB']->sql_num_rows($res); @@ -112,13 +98,8 @@ function getListOfAvailableFiltersForTCA(&$config) { $fields2 = '*'; $table2 = 'tx_kesearch_filteroptions'; $where2 = 'uid in ('.$row['options'].')'; - if (TYPO3_VERSION_INTEGER > 7000000) { - $where2 .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table2); - $where2 .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table2); - } else { - $where2 .= t3lib_befunc::BEenableFields($table2); - $where2 .= t3lib_befunc::deleteClause($table2); - } + $where2 .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table2); + $where2 .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table2); $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields2,$table2,$where2); while($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) { @@ -148,14 +129,8 @@ function getListOfAvailableFilteroptionsForFlexforms(&$config) { $fields = '*'; $table = 'tx_kesearch_filters'; $where = 'pid IN('.$intString.') '; - - if (TYPO3_VERSION_INTEGER > 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table,$inv=0); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table,$inv=0); - } else { - $where .= t3lib_befunc::BEenableFields($table,$inv=0); - $where .= t3lib_befunc::deleteClause($table,$inv=0); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table,$inv=0); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table,$inv=0); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where,$groupBy='',$orderBy='',$limit=''); while ($rowFilter=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { @@ -165,14 +140,8 @@ function getListOfAvailableFilteroptionsForFlexforms(&$config) { $fieldsOpts = '*'; $tableOpts = 'tx_kesearch_filteroptions'; $whereOpts = 'uid in ('.$rowFilter['options'].')'; - - if (TYPO3_VERSION_INTEGER > 7000000) { - $whereOpts .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($tableOpts,$inv=0); - $whereOpts .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($tableOpts,$inv=0); - } else { - $whereOpts .= t3lib_befunc::BEenableFields($tableOpts,$inv=0); - $whereOpts .= t3lib_befunc::deleteClause($tableOpts,$inv=0); - } + $whereOpts .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($tableOpts,$inv=0); + $whereOpts .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($tableOpts,$inv=0); $resOpts = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fieldsOpts,$tableOpts,$whereOpts,$groupBy='',$orderBy='',$limit=''); while ($rowOpts=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($resOpts)) { diff --git a/Classes/Scheduler/class.tx_kesearch_indexertask.php b/Classes/Scheduler/class.tx_kesearch_indexertask.php index ab7bd68b..e2e5d962 100644 --- a/Classes/Scheduler/class.tx_kesearch_indexertask.php +++ b/Classes/Scheduler/class.tx_kesearch_indexertask.php @@ -25,16 +25,10 @@ -// include indexer class and create a "baseclass" (only for backwards compatibility) -if (TYPO3_VERSION_INTEGER >= 6002000) { - require_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'Classes/indexer/class.tx_kesearch_indexer.php'); - abstract class tx_kesearch_indexertask_baseclass extends \TYPO3\CMS\Scheduler\Task\AbstractTask { } -} else { - require_once(t3lib_extMgm::extPath('ke_search') . 'Classes/indexer/class.tx_kesearch_indexer.php'); - abstract class tx_kesearch_indexertask_baseclass extends tx_scheduler_Task { } -} +// include indexer class +require_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'Classes/indexer/class.tx_kesearch_indexer.php'); -class tx_kesearch_indexertask extends tx_kesearch_indexertask_baseclass { +class tx_kesearch_indexertask extends \TYPO3\CMS\Scheduler\Task\AbstractTask { public function execute() { @@ -42,22 +36,15 @@ public function execute() { $this->extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ke_search']); // make indexer instance - if (TYPO3_VERSION_INTEGER >= 6002000) { - $indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); - } else { - $indexer = t3lib_div::makeInstance('tx_kesearch_indexer'); - } + $indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); // process - $response = $indexer->startIndexing(true, $this->extConf, 'CLI'); + $indexer->startIndexing(true, $this->extConf, 'CLI'); return true; - } - } if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/ke_search/Classes/Scheduler/class.tx_kesearch_indexertask.php']) { include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/ke_search/Classes/Scheduler/class.tx_kesearch_indexertask.php']); -} -?> \ No newline at end of file +} \ 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 1adbf63f..3c762dcc 100644 --- a/Classes/indexer/class.tx_kesearch_indexer.php +++ b/Classes/indexer/class.tx_kesearch_indexer.php @@ -69,20 +69,9 @@ public function __construct() { // get extension configuration array $this->extConf = tx_kesearch_helper::getExtConf(); $this->extConfPremium = tx_kesearch_helper::getExtConfPremium(); - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Registry'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_Registry'); - } else { - $this->registry = t3lib_div::makeInstance('t3lib_Registry'); - } + $this->registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Registry'); // fetch the list of the default indexers which come with ke_search - // load TCA definition first (only necessary in TYPO3 below 6.1) - if (TYPO3_VERSION_INTEGER < 6001000) { - t3lib_div::loadTCA('tx_kesearch_indexerconfig'); - } foreach ($GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['type']['config']['items'] as $indexerType) { $this->defaultIndexerTypes[] = $indexerType[1]; } @@ -127,11 +116,7 @@ function startIndexing($verbose=true, $extConf, $mode='') { // register additional fields which should be written to DB if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerAdditionalFields'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerAdditionalFields'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->registerAdditionalFields($this->additionalFields); } } @@ -144,18 +129,10 @@ function startIndexing($verbose=true, $extConf, $mode='') { // run default indexers shipped with ke_search if (in_array($this->indexerConfig['type'], $this->defaultIndexerTypes)) { - if (TYPO3_VERSION_INTEGER < 6002000) { - $path = t3lib_extMgm::extPath('ke_search') . 'Classes/indexer/types/class.tx_kesearch_indexer_types_' . $this->indexerConfig['type'] . '.php'; - } else { - $path = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'Classes/indexer/types/class.tx_kesearch_indexer_types_' . $this->indexerConfig['type'] . '.php'; - } + $path = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'Classes/indexer/types/class.tx_kesearch_indexer_types_' . $this->indexerConfig['type'] . '.php'; if(is_file($path)) { require_once($path); - if (TYPO3_VERSION_INTEGER >= 6002000) { - $searchObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer_types_' . $this->indexerConfig['type'], $this); - } else { - $searchObj = t3lib_div::makeInstance('tx_kesearch_indexer_types_' . $this->indexerConfig['type'], $this); - } + $searchObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer_types_' . $this->indexerConfig['type'], $this); $content .= $searchObj->startIndexing(); } else { $content = '
Could not find file ' . $path . '
' . "\n"; @@ -165,11 +142,7 @@ function startIndexing($verbose=true, $extConf, $mode='') { // hook for custom indexer if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customIndexer'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customIndexer'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $content .= $_procObj->customIndexer($indexerConfig, $this); } } @@ -202,31 +175,16 @@ function startIndexing($verbose=true, $extConf, $mode='') { // send notification in CLI mode if ($mode == 'CLI') { // send finishNotification - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isValidEmail = TYPO3\CMS\Core\Utility\GeneralUtility::validEmail($extConf['notificationRecipient']); - } else { - $isValidEmail = t3lib_div::validEmail($extConf['notificationRecipient']); - } + $isValidEmail = TYPO3\CMS\Core\Utility\GeneralUtility::validEmail($extConf['notificationRecipient']); if ($extConf['finishNotification'] && $isValidEmail) { // send the notification message - // use swiftmailer in 4.5 and above - if (TYPO3_VERSION_INTEGER >= 4005000) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\MailMessage'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_mail_Message'); - } else { - $mail = t3lib_div::makeInstance('t3lib_mail_Message'); - } - $mail->setFrom(array($extConf['notificationSender'])); - $mail->setTo(array($extConf['notificationRecipient'])); - $mail->setSubject($extConf['notificationSubject']); - $mail->setBody($plaintextReport); - $mail->send(); - } else { - mail($extConf['notificationRecipient'], $subject, $plaintextReport); - } + $mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\MailMessage'); + $mail->setFrom(array($extConf['notificationSender'])); + $mail->setTo(array($extConf['notificationRecipient'])); + $mail->setSubject($extConf['notificationSubject']); + $mail->setBody($plaintextReport); + $mail->send(); } } @@ -361,11 +319,7 @@ function cleanUpIndex() { // hook for cleanup if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['cleanup'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['cleanup'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $content .= $_procObj->cleanup($where, $this); } } @@ -455,11 +409,7 @@ function storeInIndex($storagePid, $title, $type, $targetPid, $content, $tags='' } else { $tags = $tagChar . $indexerTag . $tagChar; } - if (TYPO3_VERSION_INTEGER >= 7000000) { - $tags = TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList($tags); - } else { - $tags = t3lib_div::uniqueList($tags); - } + $tags = TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList($tags); } $table = 'tx_kesearch_index'; @@ -786,13 +736,8 @@ public function getTag($tagUid, $clearText=false) { $fields = 'title, tag'; $table = 'tx_kesearch_filteroptions'; $where = 'uid = "' . intval($tagUid) . '" '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table, 0); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table, 0); - } else { - $where .= t3lib_befunc::BEenableFields($table, 0); - $where .= t3lib_befunc::deleteClause($table, 0); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table, 0); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table, 0); $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( $fields, @@ -829,13 +774,8 @@ public function getConfigurations() { $fields = '*'; $table = 'tx_kesearch_indexerconfig'; $where = '1=1 '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $table, $where); } } diff --git a/Classes/indexer/class.tx_kesearch_indexer_types.php b/Classes/indexer/class.tx_kesearch_indexer_types.php index b373b833..dd698251 100644 --- a/Classes/indexer/class.tx_kesearch_indexer_types.php +++ b/Classes/indexer/class.tx_kesearch_indexer_types.php @@ -62,13 +62,7 @@ public function __construct($pObj) { $this->startMicrotime = microtime(true); $this->pObj = $pObj; $this->indexerConfig = $this->pObj->indexerConfig; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->queryGen = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryGenerator'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->queryGen = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_queryGenerator'); - } else { - $this->queryGen = t3lib_div::makeInstance('t3lib_queryGenerator'); - } + $this->queryGen = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryGenerator'); } @@ -82,14 +76,8 @@ public function __construct($pObj) { */ public function getPagelist($startingPointsRecursive = '', $singlePages = '') { // make array from list - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $pidsRecursive = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $startingPointsRecursive, true); - $pidsNonRecursive = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $singlePages, true); - } else { - $pidsRecursive = t3lib_div::trimExplode(',', $startingPointsRecursive, true); - $pidsNonRecursive = t3lib_div::trimExplode(',', $singlePages, true); - } + $pidsRecursive = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $startingPointsRecursive, true); + $pidsNonRecursive = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $singlePages, true); // add recursive pids foreach($pidsRecursive as $pid) { @@ -102,11 +90,7 @@ public function getPagelist($startingPointsRecursive = '', $singlePages = '') { } // convert to array - if (TYPO3_VERSION_INTEGER >= 7000000) { - $pageUidArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $pageList, true); - } else { - $pageUidArray = t3lib_div::trimExplode(',', $pageList, true); - } + $pageUidArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $pageList, true); return $pageUidArray; } @@ -156,13 +140,8 @@ public function getPidList($startingPointsRecursive = '', $singlePages = '', $ta // add complete page record to list of pids in $indexPids $where = ' AND ' . $table . '.pid = pages.uid '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); $this->pageRecords = $this->getPageRecords($indexPids, $where, 'pages,' . $table, 'pages.*' ); if(count($this->pageRecords)) { // create a new list of allowed pids @@ -187,13 +166,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)'; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_kesearch_filteroptions'); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_kesearch_filteroptions'); - } else { - $where .= t3lib_befunc::BEenableFields('tx_kesearch_filteroptions'); - $where .= t3lib_befunc::deleteClause('tx_kesearch_filteroptions'); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_kesearch_filteroptions'); + $where .= \TYPO3\CMS\Backend\Utility\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)) { @@ -204,13 +178,8 @@ public function addTagsToRecords($uids, $pageWhere = '1=1') { $fields = 'automated_tagging, automated_tagging_exclude, tag'; $table = 'tx_kesearch_filteroptions'; $where = 'automated_tagging <> "" '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_kesearch_filteroptions'); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_kesearch_filteroptions'); - } else { - $where .= t3lib_befunc::BEenableFields('tx_kesearch_filteroptions'); - $where .= t3lib_befunc::deleteClause('tx_kesearch_filteroptions'); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_kesearch_filteroptions'); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_kesearch_filteroptions'); $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $table, $where); @@ -225,11 +194,7 @@ public function addTagsToRecords($uids, $pageWhere = '1=1') { $whereRow = $where; } - if (TYPO3_VERSION_INTEGER >= 7000000) { - $pageList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->queryGen->getTreeList($row['automated_tagging'], 99, 0, $whereRow)); - } else { - $pageList = t3lib_div::trimExplode(',', $this->queryGen->getTreeList($row['automated_tagging'], 99, 0, $whereRow)); - } + $pageList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->queryGen->getTreeList($row['automated_tagging'], 99, 0, $whereRow)); foreach($pageList as $uid) { if($this->pageRecords[$uid]['tags']) { @@ -315,13 +280,9 @@ public function getTag($tagUid, $clearText=false) { $fields = 'title,tag'; $table = 'tx_kesearch_filteroptions'; $where = 'uid="'.intval($tagUid).'" '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); + $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where,$groupBy='',$orderBy='',$limit='1'); $anz = $GLOBALS['TYPO3_DB']->sql_num_rows($res); $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($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 54c5fda2..887eedb8 100644 --- a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_doc.php +++ b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_doc.php @@ -74,30 +74,18 @@ public function __construct() { */ public function getContent($file) { // create the tempfile which will contain the content - if (TYPO3_VERSION_INTEGER >= 7000000) { - $tempFileName = TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('doc_files-Indexer'); - } else { - $tempFileName = t3lib_div::tempnam('doc_files-Indexer'); - } + $tempFileName = TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('doc_files-Indexer'); // Delete if exists, just to be safe. @unlink($tempFileName); // generate and execute the pdftotext commandline tool $cmd = $this->app['catdoc'] . ' -s8859-1 -dutf-8 ' . escapeshellarg($file) . ' > ' . escapeshellarg($tempFileName); - if (TYPO3_VERSION_INTEGER >= 7000000) { - TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd); - } else { - t3lib_utility_Command::exec($cmd); - } + TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd); // check if the tempFile was successfully created if (@is_file($tempFileName)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $content = TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($tempFileName); - } else { - $content = t3lib_div::getUrl($tempFileName); - } + $content = TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($tempFileName); unlink($tempFileName); } else 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 68b0b11a..e57beaa6 100644 --- a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_pdf.php +++ b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_pdf.php @@ -72,11 +72,7 @@ public function __construct() { * @return string The extracted content of the file */ public function getContent($file) { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->fileInfo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_fileinfo'); - } else { - $this->fileInfo = t3lib_div::makeInstance('tx_kesearch_lib_fileinfo'); - } + $this->fileInfo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_fileinfo'); $this->fileInfo->setFile($file); // get PDF informations @@ -87,11 +83,7 @@ public function getContent($file) { if (intval($pdfInfo['pages']) && $this->isAppArraySet) { // create the tempfile which will contain the content - if (TYPO3_VERSION_INTEGER >= 7000000) { - $tempFileName = TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('pdf_files-Indexer'); - } else { - $tempFileName = t3lib_div::tempnam('pdf_files-Indexer'); - } + $tempFileName = TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('pdf_files-Indexer'); // Delete if exists, just to be safe. @unlink($tempFileName); @@ -99,19 +91,11 @@ public function getContent($file) { // generate and execute the pdftotext commandline tool $cmd = $this->app['pdftotext'] . ' -enc UTF-8 -q ' . escapeshellarg($file) . ' ' . escapeshellarg($tempFileName); - if (TYPO3_VERSION_INTEGER >= 7000000) { - TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd); - } else { - t3lib_utility_Command::exec($cmd); - } + TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd); // check if the tempFile was successfully created if (@is_file($tempFileName)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $content = TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($tempFileName); - } else { - $content = t3lib_div::getUrl($tempFileName); - } + $content = TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($tempFileName); unlink($tempFileName); } else { @@ -137,11 +121,7 @@ public function getPdfInfo($file) { if ($this->fileInfo->getIsFile()) { if ($this->fileInfo->getExtension() == 'pdf' && $this->isAppArraySet) { $cmd = $this->app['pdfinfo'] . ' ' . escapeshellarg($file); - if (TYPO3_VERSION_INTEGER >= 7000000) { - \TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd, $pdfInfoArray); - } else { - t3lib_utility_Command::exec($cmd, $pdfInfoArray); - } + \TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd, $pdfInfoArray); $pdfInfo = $this->splitPdfInfo($pdfInfoArray); unset($pdfInfoArray); return $pdfInfo; 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 2f281ef3..d36bc2b7 100644 --- a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_ppt.php +++ b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_ppt.php @@ -71,31 +71,18 @@ public function __construct() { */ public function getContent($file) { // create the tempfile which will contain the content - if (TYPO3_VERSION_INTEGER >= 7000000) { - $tempFileName = TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('ppt_files-Indexer'); - } else { - $tempFileName = t3lib_div::tempnam('ppt_files-Indexer'); - } + $tempFileName = TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('ppt_files-Indexer'); // Delete if exists, just to be safe. @unlink($tempFileName); // generate and execute the pdftotext commandline tool $cmd = $this->app['catppt'] . ' -s8859-1 -dutf-8 ' . escapeshellarg($file) . ' > ' . escapeshellarg($tempFileName); - - if (TYPO3_VERSION_INTEGER >= 7000000) { - TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd); - } else { - t3lib_utility_Command::exec($cmd); - } + TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd); // check if the tempFile was successfully created if (@is_file($tempFileName)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $content = TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($tempFileName); - } else { - $content = t3lib_div::getUrl($tempFileName); - } + $content = TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($tempFileName); unlink($tempFileName); } else 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 d59b2225..c2b174a8 100644 --- a/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_xls.php +++ b/Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_xls.php @@ -72,31 +72,18 @@ public function __construct() { */ public function getContent($file) { // create the tempfile which will contain the content - if (TYPO3_VERSION_INTEGER >= 7000000) { - $tempFileName = TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('xls_files-Indexer'); - } else { - $tempFileName = t3lib_div::tempnam('xls_files-Indexer'); - } + $tempFileName = TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('xls_files-Indexer'); // Delete if exists, just to be safe. @unlink($tempFileName); // generate and execute the pdftotext commandline tool $cmd = $this->app['xls2csv'] . ' -c \' \' -q 0 -s8859-1 -dutf-8 ' . escapeshellarg($file) . ' > ' . escapeshellarg($tempFileName); - - if (TYPO3_VERSION_INTEGER >= 7000000) { - TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd); - } else { - t3lib_utility_Command::exec($cmd); - } + TYPO3\CMS\Core\Utility\CommandUtility::exec($cmd); // check if the tempFile was successfully created if (@is_file($tempFileName)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $content = TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($tempFileName); - } else { - $content = t3lib_div::getUrl($tempFileName); - } + $content = TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($tempFileName); unlink($tempFileName); } else 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 efc50d2d..53ef51df 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_a21glossary.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_a21glossary.php @@ -64,13 +64,8 @@ public function startIndexing() { // Copy those restrictions to the index. $fields = '*'; $where = 'pid IN (' . implode(',', $indexPids) . ') '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where); $indexedRecordsCounter = 0; @@ -113,11 +108,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifya21glossaryIndexEntry( $title, $abstract, 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 988506d0..8e735975 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_comments.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_comments.php @@ -59,16 +59,9 @@ public function startIndexing() { } $where = 'pid IN (' . implode(',', $indexPids) . ') '; $where .= ' AND approved=1'; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= ' AND external_prefix IN ("' . implode('","', TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->indexerConfig['commenttypes'])) . '")'; - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= ' AND external_prefix IN ("' . implode('","',t3lib_div::trimExplode(',', $this->indexerConfig['commenttypes'])) . '")'; - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= ' AND external_prefix IN ("' . implode('","', TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->indexerConfig['commenttypes'])) . '")'; + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where); if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) { @@ -110,11 +103,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyCommentsIndexEntry( $title, $abstract, diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_dam.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_dam.php index ec973002..e4005ede 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_dam.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_dam.php @@ -70,13 +70,8 @@ public function startIndexing() { } } - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_dam'); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_dam'); - } else { - $where .= t3lib_befunc::BEenableFields('tx_dam'); - $where .= t3lib_befunc::deleteClause('tx_dam'); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_dam'); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_dam'); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where); $resCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res); @@ -98,17 +93,9 @@ public function startIndexing() { // get tags for this record // needs extension ke_search_dam_tags - if (TYPO3_VERSION_INTEGER < 6002000) { - $keSearchDamTagsIsLoaded = t3lib_extMgm::isLoaded('ke_search_dam_tags'); - } else { - $keSearchDamTagsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search_dam_tags'); - } + $keSearchDamTagsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search_dam_tags'); if ($keSearchDamTagsIsLoaded) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $damRecordTags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',',$damRecord['tx_kesearchdamtags_tags'], true); - } else { - $damRecordTags = t3lib_div::trimExplode(',',$damRecord['tx_kesearchdamtags_tags'], true); - } + $damRecordTags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',',$damRecord['tx_kesearchdamtags_tags'], true); $tags = ''; $clearTextTags = ''; if (count($damRecordTags)) { @@ -130,11 +117,7 @@ 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']['modifyDAMIndexEntry'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyDAMIndexEntry'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyDAMIndexEntry( $title, $abstract, @@ -191,11 +174,7 @@ public function startIndexing() { */ public function getCategories() { // remove empty values from category list - if (TYPO3_VERSION_INTEGER >= 7000000) { - $indexerCategories = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->indexerConfig['index_dam_categories'], true); - } else { - $indexerCategories = t3lib_div::trimExplode(',', $this->indexerConfig['index_dam_categories'], true); - } + $indexerCategories = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->indexerConfig['index_dam_categories'], true); // if valid array then make array unique if(is_array($indexerCategories) && count($indexerCategories)) { @@ -208,11 +187,7 @@ public function getCategories() { $categories[] = $this->getRecursiveDAMCategories($value); } // remove empty values from list and make array unique - if (TYPO3_VERSION_INTEGER >= 7000000) { - $categories = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', implode(',', $categories), true); - } else { - $categories = t3lib_div::trimExplode(',', implode(',', $categories), true); - } + $categories = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', implode(',', $categories), true); $indexerCategories = array_unique($categories); } @@ -233,11 +208,7 @@ public function getCategories() { */ public function getRecursiveDAMCategories($catUid, $depth = 0) { if($catUid) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_dam_cat') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_dam_cat'); - } else { - $enableFields = t3lib_befunc::BEenableFields('tx_dam_cat') . t3lib_befunc::deleteClause('tx_dam_cat'); - } + $enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_dam_cat') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_dam_cat'); $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( 'GROUP_CONCAT(uid) AS categoryUids', @@ -248,24 +219,14 @@ public function getRecursiveDAMCategories($catUid, $depth = 0) { // add categories to list $listOfCategories = $row['categoryUids']; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $categories = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $row['categoryUids']); - } else { - $categories = t3lib_div::trimExplode(',', $row['categoryUids']); - } + $categories = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $row['categoryUids']); if(is_array($categories) && count($categories)) { foreach($categories as $category) { // only if further categories are found, add them to list $tempCatList = $this->getRecursiveDAMCategories($category, $depth + 1); - if (TYPO3_VERSION_INTEGER >= 7000000) { - $addCategory = count(TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $tempCatList, true)); - } else { - $addCategory = count(t3lib_div::trimExplode(',', $tempCatList, true)); - } - + $addCategory = count(TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $tempCatList, true)); if ($addCategory) { $listOfCategories .= ',' . $tempCatList; } diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_file.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_file.php index 4bea63f2..7398b4fe 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_file.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_file.php @@ -54,12 +54,7 @@ public function __construct($pObj) { // get extension configuration of ke_search $this->extConf = tx_kesearch_helper::getExtConf(); - - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->fileInfo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_fileinfo'); - } else { - $this->fileInfo = t3lib_div::makeInstance('tx_kesearch_lib_fileinfo'); - } + $this->fileInfo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_fileinfo'); } /** @@ -69,11 +64,7 @@ public function __construct($pObj) { */ public function startIndexing() { $directories = $this->indexerConfig['directories']; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $directoryArray = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $directories, true); - } else { - $directoryArray = t3lib_div::trimExplode(',', $directories, true); - } + $directoryArray = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $directories, true); if ($this->pObj->indexerConfig['fal_storage'] > 0) { /* @var $storageRepository TYPO3\CMS\Core\Resource\StorageRepository */ @@ -144,11 +135,7 @@ public function getFilesFromDirectories(array $directoryArray) { $directoryArray = $this->getAbsoluteDirectoryPath($directoryArray); if (is_array($directoryArray) && count($directoryArray)) { foreach ($directoryArray as $directory) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $foundFiles = TYPO3\CMS\Core\Utility\GeneralUtility::getAllFilesAndFoldersInPath(array(), $directory, $this->indexerConfig['fileext']); - } else { - $foundFiles = t3lib_div::getAllFilesAndFoldersInPath(array(), $directory, $this->indexerConfig['fileext']); - } + $foundFiles = TYPO3\CMS\Core\Utility\GeneralUtility::getAllFilesAndFoldersInPath(array(), $directory, $this->indexerConfig['fileext']); if (is_array($foundFiles) && count($foundFiles)) { foreach ($foundFiles as $file) { $files[] = $file; @@ -226,11 +213,7 @@ public function getFileContent($file) { // check if class exists if (class_exists($className)) { // make instance - if (TYPO3_VERSION_INTEGER >= 6002000) { - $fileObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($className); - } else { - $fileObj = t3lib_div::makeInstance($className); - } + $fileObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($className); // check if new object has interface implemented if ($fileObj instanceof tx_kesearch_indexer_filetypes) { @@ -339,11 +322,7 @@ public function storeToIndex($file, $content) { // hook for custom modifications of the indexed data, e. g. the tags if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFileIndexEntry'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFileIndexEntry'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyFileIndexEntry($file, $content, $additionalFields, $indexRecordValues, $this); } } 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 21d234ed..d6c2f5fa 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 @@ -56,11 +56,7 @@ public function startIndexing() { $where .= ' AND hidden=0 AND deleted=0 '; // do not index passed events? if ($this->indexerConfig['index_passed_events'] == 'no') { - if (TYPO3_VERSION_INTEGER < 6002000) { - $keYacProductsIsLoaded = t3lib_extMgm::isLoaded('ke_yac_products'); - } else { - $keYacProductsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_yac_products'); - } + $keYacProductsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_yac_products'); if ($keYacProductsIsLoaded) { // special query if ke_yac_products loaded (VNR) $where .= ' @@ -92,11 +88,7 @@ public function startIndexing() { $targetPID = $this->indexerConfig['targetpid']; // get tags - if (TYPO3_VERSION_INTEGER >= 7000000) { - $yacRecordTags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',',$yacRecord['tx_keyacsearchtags_tags'], true); - } else { - $yacRecordTags = t3lib_div::trimExplode(',',$yacRecord['tx_keyacsearchtags_tags'], true); - } + $yacRecordTags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',',$yacRecord['tx_keyacsearchtags_tags'], true); $tags = ''; $clearTextTags = ''; @@ -118,11 +110,7 @@ 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']['modifyYACIndexEntry'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyYACIndexEntry'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyYACIndexEntry( $title, $abstract, 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 7a33eb8a..e479a973 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_mmforum.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_mmforum.php @@ -65,14 +65,8 @@ public function startIndexing() { $table = 'tx_mmforum_forums'; $where = 'tx_mmforum_forums.pid IN (' . implode(',', $indexPids) . ') '; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_mmforum_forums'); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_mmforum_forums'); - } else { - $where .= t3lib_BEfunc::BEenableFields('tx_mmforum_forums'); - $where .= t3lib_BEfunc::deleteClause('tx_mmforum_forums'); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_mmforum_forums'); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_mmforum_forums'); // Select forums $forumRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( @@ -113,13 +107,8 @@ public function startIndexing() { $table = 'tx_mmforum_topics'; $where = 'tx_mmforum_topics.forum_id = ' . $forumRecord['uid'] . ' '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_mmforum_topics'); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_mmforum_topics'); - } else { - $where .= t3lib_BEfunc::BEenableFields('tx_mmforum_topics'); - $where .= t3lib_BEfunc::deleteClause('tx_mmforum_topics'); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_mmforum_topics'); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_mmforum_topics'); // Select topics $resTopic = $GLOBALS['TYPO3_DB']->exec_SELECTquery( @@ -142,14 +131,8 @@ public function startIndexing() { $where = 'tx_mmforum_posts_text.post_id = tx_mmforum_posts.uid '; $where .= 'AND tx_mmforum_posts.topic_id = ' . $topicRecord[ 'uid' ] . ' '; $where .= 'AND tx_mmforum_posts.forum_id = ' . $forumRecord[ 'uid' ] . ' '; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_mmforum_posts_text'); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_mmforum_posts'); - } else { - $where .= t3lib_BEfunc::deleteClause('tx_mmforum_posts_text'); - $where .= t3lib_BEfunc::deleteClause('tx_mmforum_posts'); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_mmforum_posts_text'); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_mmforum_posts'); $groupBy = ''; $orderBy = ''; @@ -210,11 +193,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyMMForumIndexEntry( $title, $abstract, 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 25ab6dce..a096a080 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_news.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_news.php @@ -64,13 +64,8 @@ public function startIndexing() { // Copy those restrictions to the index. $fields = '*'; $where = 'pid IN (' . implode(',', $indexPids) . ') '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where); $indexedNewsCounter = 0; $resCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res); @@ -92,11 +87,7 @@ public function startIndexing() { foreach ($categoryData['uid_list'] as $catUid) { // if category was found in list, set isInList // to true and break further processing. - if (TYPO3_VERSION_INTEGER >= 7000000) { - if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->indexerConfig['index_extnews_category_selection'], $catUid)) { $isInList = true; break; } - } else { - if (t3lib_div::inList($this->indexerConfig['index_extnews_category_selection'], $catUid)) { $isInList = true; break; } - } + if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->indexerConfig['index_extnews_category_selection'], $catUid)) { $isInList = true; break; } } // if category was not fount stop further processing @@ -193,11 +184,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyExtNewsIndexEntry( $title, $abstract, @@ -265,21 +252,12 @@ private function getCategoryData($newsRecord) { // news version 3 features system categories instead of it's own // category system used in previous versions - if (TYPO3_VERSION_INTEGER < 6002000) { - $ttnewsVersion = t3lib_extMgm::getExtensionVersion('news'); - } else { - $ttnewsVersion = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('news'); - } + $ttnewsVersion = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('news'); if (version_compare($ttnewsVersion, '3.0.0') >= 0) { $where = ' AND tx_news_domain_model_news.uid = ' . $newsRecord['uid'] . ' AND sys_category_record_mm.tablenames = "tx_news_domain_model_news"'; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_category') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_category'); - } else { - $where .= t3lib_befunc::BEenableFields('sys_category') . t3lib_befunc::deleteClause('sys_category'); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_category') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_category'); $resCat = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( 'sys_category.uid, sys_category.single_pid, sys_category.title', @@ -293,12 +271,7 @@ private function getCategoryData($newsRecord) { } else { $where = ' AND tx_news_domain_model_news.uid = ' . $newsRecord['uid']; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_news_domain_model_category') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_news_domain_model_category'); - } else { - $where .= t3lib_befunc::BEenableFields('tx_news_domain_model_category') . t3lib_befunc::deleteClause('tx_news_domain_model_category'); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_news_domain_model_category') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_news_domain_model_category'); $resCat = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( 'tx_news_domain_model_category.uid, tx_news_domain_model_category.single_pid, tx_news_domain_model_category.title', @@ -333,11 +306,7 @@ private function getCategoryData($newsRecord) { */ private function addTagsFromNewsKeywords($tags, $newsRecord) { if (!empty($newsRecord['keywords'])) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $keywordsList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $newsRecord['keywords']); - } else { - $keywordsList = t3lib_div::trimExplode(',', $newsRecord['keywords']); - } + $keywordsList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $newsRecord['keywords']); foreach ($keywordsList as $keyword) { tx_kesearch_helper::makeTags($tags, array($keyword)); } @@ -356,13 +325,7 @@ private function addTagsFromNewsKeywords($tags, $newsRecord) { * @return string comma-separated list of tags */ private function addTagsFromNewsTags($tags, $newsRecord) { - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $addWhere = \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_news_domain_model_tag') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_news_domain_model_tag'); - } else { - $addWhere = t3lib_befunc::BEenableFields('tx_news_domain_model_tag') . t3lib_befunc::deleteClause('tx_news_domain_model_tag'); - } - + $addWhere = \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_news_domain_model_tag') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_news_domain_model_tag'); $resTag = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( 'tx_news_domain_model_tag.title', 'tx_news_domain_model_news', 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 f6950fdc..02263268 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_page.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_page.php @@ -150,23 +150,11 @@ public function __construct($pObj) { $this->whereClauseForCType = implode(' OR ', $cTypes); // get all available sys_language_uid records + $this->sysLanguages = \TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->sysLanguages = \TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); - } else { - $this->sysLanguages = t3lib_BEfunc::getSystemLanguages(); - } - - // make file repository instance only if TYPO3 version is >= 6.0 - if (TYPO3_VERSION_INTEGER >= 6000000) { - if (TYPO3_VERSION_INTEGER >= 6002000) { - /* @var $this->fileRepository \TYPO3\CMS\Core\Resource\FileRepository */ - $this->fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); - } else { - /* @var $this->fileRepository \TYPO3\CMS\Core\Resource\FileRepository */ - $this->fileRepository = t3lib_div::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); - } - } + // make file repository + /* @var $this->fileRepository \TYPO3\CMS\Core\Resource\FileRepository */ + $this->fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); } /** @@ -211,10 +199,6 @@ public function startIndexing() { . $this->fileCounter . ' files have been indexed.
' . "\n" . '

' . "\n"; - if (TYPO3_VERSION_INTEGER < 6000000) { - $content .= '

For file indexing from content elements you need at least TYPO3 6.0.0!

'; - } - $content .= $this->showErrors(); $content .= $this->showTime(); @@ -252,18 +236,9 @@ public function addLocalizedPagesToCache($pageRow) { // create entry in cachedPageRecods for additional languages, skip default language 0 foreach ($this->sysLanguages as $sysLang) { if ($sysLang[1] > 0) { - - if (TYPO3_VERSION_INTEGER >= 7000000) { - list($pageOverlay) = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $pageRow['uid'], 'AND sys_language_uid=' . intval($sysLang[1])); - } else { - list($pageOverlay) = t3lib_BEfunc::getRecordsByField('pages_language_overlay', 'pid', $pageRow['uid'], 'AND sys_language_uid=' . intval($sysLang[1])); - } + list($pageOverlay) = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $pageRow['uid'], 'AND sys_language_uid=' . intval($sysLang[1])); if ($pageOverlay) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->cachedPageRecords[$sysLang[1]][$pageRow['uid']] = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge($pageRow, $pageOverlay); - } else { - $this->cachedPageRecords[$sysLang[1]][$pageRow['uid']] = t3lib_div::array_merge($pageRow, $pageOverlay); - } + $this->cachedPageRecords[$sysLang[1]][$pageRow['uid']] = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge($pageRow, $pageOverlay); } } } @@ -349,13 +324,8 @@ public function getPageContent($uid) { $table = 'tt_content'; $where = 'pid = ' . intval($uid); $where .= ' AND (' . $this->whereClauseForCType . ')'; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_BEfunc::BEenableFields($table); - $where .= t3lib_BEfunc::deleteClause($table); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); // Get access restrictions for this page, this access restrictians apply to all // content elements of this pages. Individuel access restrictions @@ -428,11 +398,7 @@ 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']['modifyPagesIndexEntry'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyPagesIndexEntry'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyPagesIndexEntry( $uid, $pageContent, $tags, $this->cachedPageRecords, $additionalFields, $indexerConfig, $indexEntryDefaultValues ); @@ -548,13 +514,8 @@ public function getCombinedFeGroupsForContentElement($feGroupsPages, $feGroupsCo } if ($feGroupsPages && $feGroupsContentElement && $feGroupsPages != '-1' && $feGroupsContentElement != '-1') { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $feGroupsContentElementArray = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $feGroupsContentElement); - $feGroupsPagesArray = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $feGroupsPages); - } else { - $feGroupsContentElementArray = t3lib_div::intExplode(',', $feGroupsContentElement); - $feGroupsPagesArray = t3lib_div::intExplode(',', $feGroupsPages); - } + $feGroupsContentElementArray = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $feGroupsContentElement); + $feGroupsPagesArray = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $feGroupsPages); $feGroups = implode(',', array_intersect($feGroupsContentElementArray,$feGroupsContentElementArray)); } @@ -588,12 +549,7 @@ public function indexFiles($fileObjects, $ttContentRow, $feGroupsPages, $tags) { if (count($fileObjects) && $feGroups != DONOTINDEX) { // loop through files foreach ($fileObjects as $fileObject) { - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isInList = \TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->indexerConfig['fileext'], $fileObject->getExtension()); - } else { - $isInList = t3lib_div::inList($this->indexerConfig['fileext'], $fileObject->getExtension()); - } + $isInList = \TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->indexerConfig['fileext'], $fileObject->getExtension()); // check if the file extension fits in the list of extensions // to index defined in the indexer configuration @@ -603,13 +559,8 @@ public function indexFiles($fileObjects, $ttContentRow, $feGroupsPages, $tags) { $fileUri = $fileObject->getStorage()->getPublicUrl($fileObject); $filePath = $fileObject->getForLocalProcessing(FALSE); - if (TYPO3_VERSION_INTEGER >= 6002000) { - /* @var $fileIndexerObject tx_kesearch_indexer_types_file */ - $fileIndexerObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer_types_file', $this->pObj); - } else { - /* @var $fileIndexerObject tx_kesearch_indexer_types_file */ - $fileIndexerObject = t3lib_div::makeInstance('tx_kesearch_indexer_types_file', $this->pObj); - } + /* @var $fileIndexerObject tx_kesearch_indexer_types_file */ + $fileIndexerObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer_types_file', $this->pObj); // add tags from linking page to this index record? if (!$this->indexerConfig['index_use_page_tags_for_files']) { @@ -648,12 +599,8 @@ public function indexFiles($fileObjects, $ttContentRow, $feGroupsPages, $tags) { * @return array */ public function findAttachedFiles($ttContentRow) { - if (TYPO3_VERSION_INTEGER >= 6000000) { - // get files attached to the content element - $fileReferenceObjects = $this->fileRepository->findByRelation('tt_content', 'media', $ttContentRow['uid']); - } else { - $fileReferenceObjects = array(); - } + // get files attached to the content element + $fileReferenceObjects = $this->fileRepository->findByRelation('tt_content', 'media', $ttContentRow['uid']); return $fileReferenceObjects; } @@ -670,27 +617,25 @@ public function findAttachedFiles($ttContentRow) { public function findLinkedFilesInRte($ttContentRow) { $fileObjects = array(); // check if there are links to files in the rte text - if (TYPO3_VERSION_INTEGER >= 6002000) { - /* @var $rteHtmlParser \TYPO3\CMS\Core\Html\RteHtmlParser */ - $rteHtmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\RteHtmlParser'); - - $blockSplit = $rteHtmlParser->splitIntoBlock('link', $ttContentRow['bodytext'], 1); - foreach ($blockSplit as $k => $v) { - if ($k % 2) { - $tagCode = \TYPO3\CMS\Core\Utility\GeneralUtility::unQuoteFilenames(trim(substr($rteHtmlParser->getFirstTag($v), 0, -1)), TRUE); - $link_param = $tagCode[1]; - - // Check for FAL link-handler keyword - list($linkHandlerKeyword, $linkHandlerValue) = explode(':', trim($link_param), 2); - if ($linkHandlerKeyword === 'file') { - try { - $fileOrFolderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject(rawurldecode($linkHandlerValue)); - if ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\FileInterface) { - $fileObjects[] = $fileOrFolderObject; - } - } catch (\TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException $resourceDoesNotExistException) { - $this->addError('Could not index file with FAL uid #' . $linkHandlerValue . ' (the indentifier inserted in the RTE is already gone).'); + /* @var $rteHtmlParser \TYPO3\CMS\Core\Html\RteHtmlParser */ + $rteHtmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\RteHtmlParser'); + + $blockSplit = $rteHtmlParser->splitIntoBlock('link', $ttContentRow['bodytext'], 1); + foreach ($blockSplit as $k => $v) { + if ($k % 2) { + $tagCode = \TYPO3\CMS\Core\Utility\GeneralUtility::unQuoteFilenames(trim(substr($rteHtmlParser->getFirstTag($v), 0, -1)), TRUE); + $link_param = $tagCode[1]; + + // Check for FAL link-handler keyword + list($linkHandlerKeyword, $linkHandlerValue) = explode(':', trim($link_param), 2); + if ($linkHandlerKeyword === 'file') { + try { + $fileOrFolderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject(rawurldecode($linkHandlerValue)); + if ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\FileInterface) { + $fileObjects[] = $fileOrFolderObject; } + } catch (\TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException $resourceDoesNotExistException) { + $this->addError('Could not index file with FAL uid #' . $linkHandlerValue . ' (the indentifier inserted in the RTE is already gone).'); } } } @@ -716,18 +661,10 @@ public function storeFileContentToIndex($fileObject, $content, $fileIndexerObjec // get metadata if ($fileObject instanceof TYPO3\CMS\Core\Resource\FileReference) { $orig_uid = $fileObject->getOriginalFile()->getUid(); - if (TYPO3_VERSION_INTEGER >= 6002000) { - $metadata = $fileObject->getOriginalFile()->_getMetaData(); - } else { - $metadata = array(); - } + $metadata = $fileObject->getOriginalFile()->_getMetaData(); } else { $orig_uid = $fileObject->getUid(); - if (TYPO3_VERSION_INTEGER >= 6002000) { - $metadata = $fileObject->_getMetaData(); - } else { - $metadata = array(); - } + $metadata = $fileObject->_getMetaData(); } // assign categories as tags @@ -762,11 +699,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyFileIndexEntryFromContentIndexer($fileObject, $content, $fileIndexerObject, $feGroups, $ttContentRow, $storagePid, $title, $tags, $abstract, $additionalFields); } } diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_t3s_content.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_t3s_content.php index 87e78511..fea15b69 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_t3s_content.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_t3s_content.php @@ -81,20 +81,12 @@ public function getTtContentRecordsWithT3sPlugin() { ); if($rows) { foreach($rows as $key => $row) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $xml = TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($row['pi_flexform']); - } else { - $xml = t3lib_div::xml2array($row['pi_flexform']); - } + $xml = TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($row['pi_flexform']); $config = $xml['data']['general']['lDEF']; $ttContentUids[] = $config['contentElements']['vDEF']; } $ttContentUids = implode(',', $ttContentUids); - if (TYPO3_VERSION_INTEGER >= 7000000) { - $ttContentUids = TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList($ttContentUids); - } else { - $ttContentUids = t3lib_div::uniqueList($ttContentUids); - } + $ttContentUids = TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList($ttContentUids); $ttContentRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( '*', 'tt_content', diff --git a/Classes/indexer/types/class.tx_kesearch_indexer_types_templavoila.php b/Classes/indexer/types/class.tx_kesearch_indexer_types_templavoila.php index c5689a44..e778c30c 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_templavoila.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_templavoila.php @@ -65,28 +65,15 @@ class tx_kesearch_indexer_types_templavoila extends tx_kesearch_indexer_types { public function __construct($pObj) { parent::__construct($pObj); - if (TYPO3_VERSION_INTEGER < 6002000) { - $this->templavoilaIsLoaded = t3lib_extMgm::isLoaded('templavoila'); - } else { - $this->templavoilaIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('templavoila'); - } + $this->templavoilaIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('templavoila'); if ($this->templavoilaIsLoaded) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('pages') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages'); - } else { - $enableFields = t3lib_BEfunc::BEenableFields('pages') . t3lib_BEfunc::deleteClause('pages'); - } + $enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('pages') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages'); $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid,title', 'pages', 'pid = 0' . $enableFields); $GLOBALS['TT'] = new t3lib_timeTrackNull; - if (TYPO3_VERSION_INTEGER >= 6002000) { - $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], $row['uid'], 0); - $GLOBALS['TSFE']->sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_pageSelect'); - } else { - $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], $row['uid'], 0); - $GLOBALS['TSFE']->sys_page = t3lib_div::makeInstance('t3lib_pageSelect'); - } + $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], $row['uid'], 0); + $GLOBALS['TSFE']->sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_pageSelect'); $GLOBALS['TSFE']->sys_page->init(TRUE); $GLOBALS['TSFE']->initTemplate(); @@ -97,11 +84,7 @@ public function __construct($pObj) { // override it with the page/type-specific "config." if (is_array($GLOBALS['TSFE']->pSetup['config.'])) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $GLOBALS['TSFE']->config['config'] = TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($GLOBALS['TSFE']->config['config'], $GLOBALS['TSFE']->pSetup['config.']); - } else { - $GLOBALS['TSFE']->config['config'] = t3lib_div::array_merge_recursive_overrule($GLOBALS['TSFE']->config['config'], $GLOBALS['TSFE']->pSetup['config.']); - } + $GLOBALS['TSFE']->config['config'] = TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($GLOBALS['TSFE']->config['config'], $GLOBALS['TSFE']->pSetup['config.']); } // generate basic rootline @@ -109,11 +92,7 @@ public function __construct($pObj) { 0 => array('uid' => $row['uid'], 'title' => $row['title']) ); - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->tv = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_templavoila_pi1'); - } else { - $this->tv = t3lib_div::makeInstance('tx_templavoila_pi1'); - } + $this->tv = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_templavoila_pi1'); } $this->counter = 0; @@ -123,11 +102,7 @@ public function __construct($pObj) { $this->whereClauseForCType = implode(' OR ', $cTypes); // get all available sys_language_uid records - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->sysLanguages = TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); - } else { - $this->sysLanguages = t3lib_BEfunc::getSystemLanguages(); - } + $this->sysLanguages = TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); } @@ -216,27 +191,14 @@ public function getPageRecords($uids) { public function addLocalizedPagesToCache($row) { $this->cachedPageRecords[0][$row['uid']] = $row; foreach($this->sysLanguages as $sysLang) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - list($pageOverlay) = TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField( - 'pages_language_overlay', - 'pid', - $row['uid'], - 'AND sys_language_uid=' . intval($sysLang[1]) - ); - } else { - list($pageOverlay) = t3lib_BEfunc::getRecordsByField( - 'pages_language_overlay', - 'pid', - $row['uid'], - 'AND sys_language_uid=' . intval($sysLang[1]) - ); - } + list($pageOverlay) = TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField( + 'pages_language_overlay', + 'pid', + $row['uid'], + 'AND sys_language_uid=' . intval($sysLang[1]) + ); if($pageOverlay) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->cachedPageRecords[$sysLang[1]][$row['uid']] = TYPO3\CMS\Core\Utility\GeneralUtility::array_merge($row, $pageOverlay); - } else { - $this->cachedPageRecords[$sysLang[1]][$row['uid']] = t3lib_div::array_merge($row, $pageOverlay); - } + $this->cachedPageRecords[$sysLang[1]][$row['uid']] = TYPO3\CMS\Core\Utility\GeneralUtility::array_merge($row, $pageOverlay); } } } @@ -250,12 +212,7 @@ public function getPageContent($uid) { $flex = $this->pageRecords[$uid]['tx_templavoila_flex']; if(empty($flex)) return ''; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $flex = TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($flex); - } else { - $flex = t3lib_div::xml2array($flex); - } + $flex = TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($flex); // TODO: Maybe I need a more detailed collection of retrieving CE UIDS $contentElementUids = array(); @@ -263,21 +220,13 @@ public function getPageContent($uid) { $tvPaths = 'field_content'; } else $tvPaths = $this->indexerConfig['tvpath']; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $tvPaths = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $tvPaths); - } else { - $tvPaths = t3lib_div::trimExplode(',', $tvPaths); - } + $tvPaths = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $tvPaths); foreach ($tvPaths as $tvPath) { $contentElementUids[] = $flex['data']['sDEF']['lDEF'][$tvPath]['vDEF']; } - if (TYPO3_VERSION_INTEGER >= 7000000) { - $contentElementUids = TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList(implode(',', $contentElementUids)); - } else { - $contentElementUids = t3lib_div::uniqueList(implode(',', $contentElementUids)); - } + $contentElementUids = TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList(implode(',', $contentElementUids)); if(empty($contentElementUids)) return ''; @@ -288,13 +237,8 @@ public function getPageContent($uid) { $table = 'tt_content'; $where = 'uid IN (' . $contentElementUids . ')'; $where .= ' AND (' . $this->whereClauseForCType. ')'; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_BEfunc::BEenableFields($table); - $where .= t3lib_BEfunc::deleteClause($table); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); // if indexing of content elements with restrictions is not allowed // get only content elements that have empty group restrictions @@ -344,11 +288,7 @@ 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']['modifyTemplaVoilaIndexEntry'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyTemplaVoilaIndexEntry'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyPagesIndexEntry( $uid, $pageContent, 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 64452a74..2785f06c 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 @@ -58,13 +58,8 @@ public function startIndexing() { } $where = 'pid IN (' . implode(',', $indexPids) . ') '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where); $resCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res); @@ -148,11 +143,7 @@ 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']['modifyAddressIndexEntry'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyAddressIndexEntry'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyAddressIndexEntry( $title, $abstract, 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 0127d1ef..934917fc 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 @@ -49,12 +49,7 @@ function getPageContent($uid) { // copied to the index //$where .= t3lib_BEfunc::BEenableFields($table); $where .= ' AND hidden=0'; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_BEfunc::deleteClause($table); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); // get tags from page $tags = $this->pageRecords[$uid]['tags']; @@ -138,11 +133,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyContentIndexEntry( $row['header'], $row, 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 4d76abe9..ba4ea0a3 100644 --- a/Classes/indexer/types/class.tx_kesearch_indexer_types_ttnews.php +++ b/Classes/indexer/types/class.tx_kesearch_indexer_types_ttnews.php @@ -89,14 +89,8 @@ public function startIndexing() { } $where = 'pid IN (' . implode(',', $indexPids) . ') '; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where); $counter = 0; @@ -107,12 +101,7 @@ public function startIndexing() { // if mode equals 'choose categories for indexing' (2). 1 = All if ($this->indexerConfig['index_news_category_mode'] == '2') { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tt_news_cat') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tt_news_cat'); - } else { - $enableFields = t3lib_befunc::BEenableFields('tt_news_cat') . t3lib_befunc::deleteClause('tt_news_cat'); - } - + $enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tt_news_cat') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tt_news_cat'); $resCat = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( 'tt_news_cat.uid', 'tt_news', 'tt_news_cat_mm', 'tt_news_cat', ' AND tt_news.uid = ' . $newsRecord['uid'] . $enableFields, @@ -124,18 +113,10 @@ public function startIndexing() { while ($newsCat = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resCat)) { // if category was found in list, set isInList to true and break further processing. - if (TYPO3_VERSION_INTEGER >= 7000000) { - if (TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->indexerConfig['index_news_category_selection'], $newsCat['uid'])) { - $isInList = true; - break; - } - } else { - if (t3lib_div::inList($this->indexerConfig['index_news_category_selection'], $newsCat['uid'])) { - $isInList = true; - break; - } + if (TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->indexerConfig['index_news_category_selection'], $newsCat['uid'])) { + $isInList = true; + break; } - } // if category was not found stop further processing and loop with next news record @@ -172,11 +153,7 @@ public function startIndexing() { $params = $newsRecord['ext_url'];; } else { // get target page from category if set (first assigned category) - if (TYPO3_VERSION_INTEGER < 6002000) { - $ttnewsIsLoaded = t3lib_extMgm::isLoaded('tt_news'); - } else { - $ttnewsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news'); - } + $ttnewsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news'); if ($ttnewsIsLoaded) { $singleViewPage = $this->getSingleViewPageFromCategories($newsRecord['uid']); } @@ -220,11 +197,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyNewsIndexEntry( $title, $abstract, $fullContent, $params, $tags, $newsRecord, $additionalFields, $indexerConfig ); @@ -280,12 +253,7 @@ function getSingleViewPageFromCategories($uid, $getAll = false) { // TODO: take Storage PID into account (in tx_ttnws class the // where clause is stored in $this->SPaddWhere) $addWhere = ' AND tt_news_cat.deleted=0'; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $addWhere .= $getAll ? '' : TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tt_news_cat'); - } else { - $addWhere .= $getAll ? '' : t3lib_befunc::BEenableFields('tt_news_cat'); - } + $addWhere .= $getAll ? '' : TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tt_news_cat'); // TODO: take tt_news configuration options useSPidFromCategory and // and useSPidFromCategoryRecusive into account (would need an instance @@ -324,12 +292,7 @@ function getSingleViewPageFromCategories($uid, $getAll = false) { * @return int first found single view pid */ function getRecursiveCategorySinglePid($currentCategory) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $addWhere = ' AND tt_news_cat.deleted=0' . TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tt_news_cat'); - } else { - $addWhere = ' AND tt_news_cat.deleted=0' . t3lib_befunc::BEenableFields('tt_news_cat'); - } - + $addWhere = ' AND tt_news_cat.deleted=0' . TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tt_news_cat'); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,parent_category,single_pid', 'tt_news_cat', 'tt_news_cat.uid=' . $currentCategory . $addWhere); $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); $GLOBALS['TYPO3_DB']->sql_free_result($res); diff --git a/Classes/lib/class.tx_kesearch_db.php b/Classes/lib/class.tx_kesearch_db.php index beacd45a..87d7bfc9 100644 --- a/Classes/lib/class.tx_kesearch_db.php +++ b/Classes/lib/class.tx_kesearch_db.php @@ -22,12 +22,6 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -if (TYPO3_VERSION_INTEGER >= 7000000) { - class tx_kesearch_db_baseclass implements \TYPO3\CMS\Core\SingletonInterface { } -} else { - class tx_kesearch_db_baseclass implements t3lib_Singleton { } -} - /** * DB Class for ke_search, generates search queries. * @@ -35,7 +29,7 @@ class tx_kesearch_db_baseclass implements t3lib_Singleton { } * @package TYPO3 * @subpackage tx_kesearch */ -class tx_kesearch_db extends tx_kesearch_db_baseclass { +class tx_kesearch_db implements \TYPO3\CMS\Core\SingletonInterface { var $conf = array(); var $bestIndex = ''; var $countResultsOfTags = 0; @@ -99,11 +93,7 @@ public function getSearchResultByMySQL() { $queryParts['ORDERBY'], $queryParts['LIMIT'] ); - if (TYPO3_VERSION_INTEGER >= 7000000) { - TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Search result query', $this->pObj->extKey, 0, array($query)); - } else { - t3lib_div::devLog('Search result query', $this->pObj->extKey, 0, array($query)); - } + TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Search result query', $this->pObj->extKey, 0, array($query)); } $this->searchResults = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( @@ -143,13 +133,8 @@ function escapeString ( $string ) { * @return array Array containing a limitted (one page) amount of search results */ public function getSearchResultBySphinx() { - if (TYPO3_VERSION_INTEGER >= 6002000) { - 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'); - } else { - require_once(t3lib_extMgm::extPath('ke_search_premium') . 'class.user_kesearchpremium.php'); - $this->user_kesearchpremium = t3lib_div::makeInstance('user_kesearchpremium'); - } + 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 $this->user_kesearchpremium->setSorting($this->getOrdering()); @@ -173,17 +158,9 @@ public function getSearchResultBySphinx() { // add fe_groups to query $queryForSphinx .= ' @fe_group _group_NULL | _group_0'; if(!empty($GLOBALS['TSFE']->gr_list)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $feGroups = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TSFE']->gr_list, 1); - } else { - $feGroups = t3lib_div::trimExplode(',', $GLOBALS['TSFE']->gr_list, 1); - } + $feGroups = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TSFE']->gr_list, 1); foreach($feGroups as $key => $group) { - if (TYPO3_VERSION_INTEGER >= 6000000) { - $intval_positive_group = TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger($group); - } else { - $intval_positive_group = t3lib_div::intval_positive($group); - } + $intval_positive_group = TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger($group); if($intval_positive_group) { $feGroups[$key] = '_group_' . $group; } else unset($feGroups[$key]); @@ -192,11 +169,7 @@ public function getSearchResultBySphinx() { } // restrict to storage page (in MySQL: $where .= ' AND pid in (' . . ') ';) - if (TYPO3_VERSION_INTEGER >= 7000000) { - $startingPoints = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->pObj->startingPoints); - } else { - $startingPoints = t3lib_div::trimExplode(',', $this->pObj->startingPoints); - } + $startingPoints = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->pObj->startingPoints); $queryForSphinx .= ' @pid '; $first = true; foreach ($startingPoints as $startingPoint) { @@ -212,11 +185,7 @@ public function getSearchResultBySphinx() { // hook for appending additional where clause to sphinx query if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['appendWhereToSphinx'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['appendWhereToSphinx'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $queryForSphinx = $_procObj->appendWhereToSphinx($queryForSphinx, $this->user_kesearchpremium, $this); } } @@ -271,11 +240,7 @@ public function getQueryParts() { // hook for third party applications to manipulate last part of query building if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['getQueryParts'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['getQueryParts'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $queryParts = $_procObj->getQueryParts($queryParts, $this); } } @@ -478,11 +443,7 @@ public function getOrdering() { $piVarsDir = $this->pObj->piVars['sortByDir']; $piVarsDir = ($piVarsDir == '') ? 'asc' : $piVarsDir; if(!empty($piVarsField)) { // if an ordering field is defined by GET/POST - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->conf['sortByVisitor'], $piVarsField); - } else { - $isInList = t3lib_div::inList($this->conf['sortByVisitor'], $piVarsField); - } + $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->conf['sortByVisitor'], $piVarsField); if($this->conf['sortByVisitor'] != '' && $isInList) { $orderBy = $piVarsField . ' ' . $piVarsDir; } // if sortByVisitor is not set OR not in the list of allowed fields then use fallback ordering in "sortWithoutSearchword" @@ -513,11 +474,7 @@ public function getLimit() { // hook for third party pagebrowsers or for modification $this->pObj->piVars['page'] parameter if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['getLimit'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['getLimit'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->getLimit($startLimit, $this); } } diff --git a/Classes/lib/class.tx_kesearch_filters.php b/Classes/lib/class.tx_kesearch_filters.php index a5e704fa..9e984a27 100644 --- a/Classes/lib/class.tx_kesearch_filters.php +++ b/Classes/lib/class.tx_kesearch_filters.php @@ -64,11 +64,7 @@ class tx_kesearch_filters { public function initialize(tx_kesearch_lib $pObj) { $this->pObj = $pObj; $this->cObj = $pObj->cObj; - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->db = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_db'); - } else { - $this->db = t3lib_div::makeInstance('tx_kesearch_db'); - } + $this->db = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_db'); $this->conf = $this->pObj->conf; $this->piVars = $this->pObj->piVars; @@ -81,11 +77,7 @@ public function initialize(tx_kesearch_lib $pObj) { // hook to modify filters if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilters'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilters'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyFilters($this->filters, $this); } } @@ -124,11 +116,7 @@ public function getSelectedFilterOptions($filter) { if ($this->pObj->piVars['filter'][$filter['uid']] == $option['tag']) { $selected = true; } else if (is_array($this->pObj->piVars['filter'][$filter['uid']])) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isInArray = TYPO3\CMS\Core\Utility\GeneralUtility::inArray($this->pObj->piVars['filter'][$filter['uid']], $option['tag']); - } else { - $isInArray = t3lib_div::inArray($this->pObj->piVars['filter'][$filter['uid']], $option['tag']); - } + $isInArray = TYPO3\CMS\Core\Utility\GeneralUtility::inArray($this->pObj->piVars['filter'][$filter['uid']], $option['tag']); if($isInArray) { $selected = true; } @@ -163,11 +151,7 @@ public function combineLists($list1 = '', $list2 = '') { $list1 .= ','; } $list1 .= $list2; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $returnValue = TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList($list1); - } else { - $returnValue = t3lib_div::uniqueList($list1); - } + $returnValue = TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList($list1); return $returnValue; } diff --git a/Classes/lib/class.tx_kesearch_lib.php b/Classes/lib/class.tx_kesearch_lib.php index bff54e39..cf6cc5ea 100644 --- a/Classes/lib/class.tx_kesearch_lib.php +++ b/Classes/lib/class.tx_kesearch_lib.php @@ -22,16 +22,6 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -if (TYPO3_VERSION_INTEGER < 6002000) { - require_once(PATH_tslib . 'class.tslib_pibase.php'); -} - -if (TYPO3_VERSION_INTEGER >= 7000000) { - class tx_kesearch_pluginBase extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin { } -} else { - class tx_kesearch_pluginBase extends tslib_pibase { } -} - /** * Parent class for plugins pi1 and pi2 * @@ -41,7 +31,7 @@ class tx_kesearch_pluginBase extends tslib_pibase { } * @package TYPO3 * @subpackage tx_kesearch */ -class tx_kesearch_lib extends tx_kesearch_pluginBase { +class tx_kesearch_lib extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin { var $prefixId = 'tx_kesearch_pi1'; // Same as class name var $extKey = 'ke_search'; // The extension key. @@ -106,18 +96,10 @@ class tx_kesearch_lib extends tx_kesearch_pluginBase { */ public function init() { // get some helper functions - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->div = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_div', $this); - } else { - $this->div = t3lib_div::makeInstance('tx_kesearch_lib_div', $this); - } + $this->div = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_div', $this); // set start of query timer - if (TYPO3_VERSION_INTEGER >= 7000000) { - if(!$GLOBALS['TSFE']->register['ke_search_queryStartTime']) $GLOBALS['TSFE']->register['ke_search_queryStartTime'] = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); - } else { - if(!$GLOBALS['TSFE']->register['ke_search_queryStartTime']) $GLOBALS['TSFE']->register['ke_search_queryStartTime'] = t3lib_div::milliseconds(); - } + if(!$GLOBALS['TSFE']->register['ke_search_queryStartTime']) $GLOBALS['TSFE']->register['ke_search_queryStartTime'] = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); // make settings from flexform available in general configuration ($this->conf) $this->moveFlexFormDataToConf(); @@ -151,31 +133,19 @@ public function init() { // hook: modifyFlexFormData if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFlexFormData'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFlexFormData'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyFlexFormData($this->conf, $this->cObj, $this->piVars); } } // prepare database object - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->db = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_db', $this); - } else { - $this->db = t3lib_div::makeInstance('tx_kesearch_db', $this); - } + $this->db = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_db', $this); // set startingPoints $this->startingPoints = $this->div->getStartingPoint(); // get filter class - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->filters = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_filters'); - } else { - $this->filters = t3lib_div::makeInstance('tx_kesearch_filters'); - } + $this->filters = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_filters'); // get extension configuration array $this->extConf = tx_kesearch_helper::getExtConf(); @@ -191,22 +161,14 @@ public function init() { $this->firstStartingPoint = $this->div->getFirstStartingPoint($this->startingPoints); // build words searchphrase - if (TYPO3_VERSION_INTEGER >= 6002000) { - $searchPhrase = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_searchphrase'); - } else { - $searchPhrase = t3lib_div::makeInstance('tx_kesearch_lib_searchphrase'); - } + $searchPhrase = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_searchphrase'); $searchPhrase->initialize($this); $searchWordInformation = $searchPhrase->buildSearchPhrase(); // Hook: modifySearchWords if(isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifySearchWords'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifySearchWords'] as $classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $hookObj = TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef); - } else { - $hookObj = t3lib_div::getUserObj($classRef); - } + $hookObj = TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef); if(method_exists($hookObj, 'modifySearchWords')) { $hookObj->modifySearchWords($searchWordInformation, $this); } @@ -230,11 +192,7 @@ public function init() { // * sorting for "relevance" is allowed (internal: "score") // * user did not select his own sorting yet // * a searchword is given - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->conf['sortByVisitor'], 'score'); - } else { - $isInList = t3lib_div::inList($this->conf['sortByVisitor'], 'score'); - } + $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->conf['sortByVisitor'], 'score'); if ($this->conf['showSortInFrontend'] && $isInList && !$this->piVars['sortByField'] && $this->sword) { $this->piVars['sortByField'] = 'score'; $this->piVars['sortByDir'] = 'desc'; @@ -263,11 +221,7 @@ public function init() { $cssFile = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['cssFile']); if(!empty($cssFile)) { $cssTag = $this->cObj->wrap($cssFile, ''); - if (TYPO3_VERSION_INTEGER >= 6000000) { - $GLOBALS['TSFE']->getPageRenderer()->addCssFile($cssFile); - } else { - $GLOBALS['TSFE']->additionalHeaderData[$this->prefixId . '_css'] = $cssTag; - } + $GLOBALS['TSFE']->getPageRenderer()->addCssFile($cssFile); } } @@ -278,21 +232,13 @@ public function init() { public function initTemplate() { // check for rendering method if ($this->conf['renderMethod'] == 'fluidtemplate') { - if (TYPO3_VERSION_INTEGER < 6000000) { - return ('ke_search error:Render method "Fluid template" needs at least TYPO3 version 6.'); - } else { - // set default template paths - $this->conf['templateRootPath'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['templateRootPath'] ? $this->conf['templateRootPath'] : 'EXT:ke_search/Resources/Private/Templates/'); - $this->conf['partialRootPath'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['partialRootPath'] ? $this->conf['partialRootPath'] : 'EXT:ke_search/Resources/Private/Partials/'); - $this->conf['layoutRootPath'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['layoutRootPath'] ? $this->conf['layoutRootPath'] : 'EXT:ke_search/Resources/Private/Layouts/'); - } + // set default template paths + $this->conf['templateRootPath'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['templateRootPath'] ? $this->conf['templateRootPath'] : 'EXT:ke_search/Resources/Private/Templates/'); + $this->conf['partialRootPath'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['partialRootPath'] ? $this->conf['partialRootPath'] : 'EXT:ke_search/Resources/Private/Partials/'); + $this->conf['layoutRootPath'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['layoutRootPath'] ? $this->conf['layoutRootPath'] : 'EXT:ke_search/Resources/Private/Layouts/'); } else { // get html template - if (TYPO3_VERSION_INTEGER < 6002000) { - $this->templateFile = $this->conf['templateFile'] ? $this->conf['templateFile'] : t3lib_extMgm::siteRelPath($this->extKey) . 'res/template_pi1.tpl'; - } else { - $this->templateFile = $this->conf['templateFile'] ? $this->conf['templateFile'] : TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/template_pi1.tpl'; - } + $this->templateFile = $this->conf['templateFile'] ? $this->conf['templateFile'] : TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/template_pi1.tpl'; $this->templateCode = $this->cObj->fileResource($this->templateFile); } } @@ -420,17 +366,10 @@ public function getSearchboxContent() { $this->fluidTemplateVariables['targetpage'] = $this->conf['resultPage']; // set form action - if (TYPO3_VERSION_INTEGER >= 7000000) { - $siteUrl = TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'); - $lParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GET('L'); - $mpParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GET('MP'); - $typeParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type'); - } else { - $siteUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL'); - $lParam = t3lib_div::_GET('L'); - $mpParam = t3lib_div::_GET('MP'); - $typeParam = t3lib_div::_GP('type'); - } + $siteUrl = TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'); + $lParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GET('L'); + $mpParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GET('MP'); + $typeParam = TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type'); $actionUrl = $siteUrl . 'index.php'; $content = $this->cObj->substituteMarker($content,'###FORM_ACTION###', $actionUrl); $this->fluidTemplateVariables['actionUrl'] = $actionUrl; @@ -496,11 +435,7 @@ public function renderFilters() { // rendering of this filter. The filter is only used // to add preselected filter options to the query and // must not be rendered. - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->conf['hiddenfilters'], $filter['uid']); - } else { - $isInList = t3lib_div::inList($this->conf['hiddenfilters'], $filter['uid']); - } + $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->conf['hiddenfilters'], $filter['uid']); if ($isInList) { continue; @@ -517,11 +452,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $options = $_procObj->modifyFilterOptionsArray($filter['uid'], $options, $this); } } @@ -552,11 +483,7 @@ public function renderFilters() { // special classes / custom code switch($filter['rendertype']) { case 'textlinks': - if (TYPO3_VERSION_INTEGER >= 6002000) { - $textLinkObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_filters_textlinks', $this); - } else { - $textLinkObj = t3lib_div::makeInstance('tx_kesearch_lib_filters_textlinks', $this); - } + $textLinkObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_filters_textlinks', $this); $textLinkObj->renderTextlinks($filter['uid'], $options, $this); break; @@ -565,11 +492,7 @@ public function renderFilters() { // 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->customFilterRenderer($filter['uid'], $options, $this); } } @@ -642,11 +565,7 @@ public function compileCheckboxOptions($filter, $options) { // modify filter options by hook if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptions'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptions'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $contentOptions .= $_procObj->modifyFilterOptions( $filter, $checkboxOptions, @@ -772,11 +691,7 @@ public function getFiltersFromFlexform() { */ public function getFilterOptions($optionList, $returnSortedByTitle = false) { // check/convert if list contains only integers - if (TYPO3_VERSION_INTEGER >= 7000000) { - $optionIdArray = TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $optionList, true); - } else { - $optionIdArray = t3lib_div::intExplode(',', $optionList, true); - } + $optionIdArray = TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $optionList, true); $optionList = implode(',', $optionIdArray); if($returnSortedByTitle) { $sortBy = 'title'; @@ -814,19 +729,11 @@ public function getFilterOptions($optionList, $returnSortedByTitle = false) { public function initXajax() { // Include xaJax if(!class_exists('xajax')) { - if (TYPO3_VERSION_INTEGER < 6002000) { - $path_to_xajax = t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php'; - } else { - $path_to_xajax = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('xajax') . 'class.tx_xajax.php'; - } + $path_to_xajax = t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php'; require_once($path_to_xajax); } // Make the instance - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->xajax = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_xajax'); - } else { - $this->xajax = t3lib_div::makeInstance('tx_xajax'); - } + $this->xajax = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_xajax'); // Decode form vars from utf8 $this->xajax->decodeUTF8InputOn(); // Encoding of the response to utf-8. @@ -850,16 +757,8 @@ public function initXajax() { $this->xajax->processRequests(); // Create javacript and add it to the normal output - if (TYPO3_VERSION_INTEGER < 6002000) { - $jsCode = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax')); - } else { - $jsCode = $this->xajax->getJavascript(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('xajax')); - } - if (TYPO3_VERSION_INTEGER >= 6000000) { - $GLOBALS['TSFE']->getPageRenderer()->addHeaderData($jsCode); - } else { - $GLOBALS['TSFE']->additionalHeaderData['xajax_search_filters'] = $jsCode; - } + $jsCode = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax')); + $GLOBALS['TSFE']->getPageRenderer()->addHeaderData($jsCode); } @@ -871,11 +770,7 @@ public function initXajax() { */ public function createHideSpinner() { // generate onload image - if (TYPO3_VERSION_INTEGER < 6002000) { - $path = t3lib_extMgm::siteRelPath($this->extKey) . 'res/img/blank.gif'; - } else { - $path = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/blank.gif'; - } + $path = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/blank.gif'; if ($GLOBALS['TSFE']->id != $this->conf['resultPage']) { $spinnerFunction = 'hideSpinnerFiltersOnly()'; } else $spinnerFunction = 'hideSpinner()'; @@ -975,11 +870,7 @@ public function refresh($data) { if ($this->conf['showQueryTime']) { // Calculate Querytime // we have two plugin. That's why we work with register here. - if (TYPO3_VERSION_INTEGER >= 7000000) { - $GLOBALS['TSFE']->register['ke_search_queryTime'] = (TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds() - $GLOBALS['TSFE']->register['ke_search_queryStartTime']); - } else { - $GLOBALS['TSFE']->register['ke_search_queryTime'] = (t3lib_div::milliseconds() - $GLOBALS['TSFE']->register['ke_search_queryStartTime']); - } + $GLOBALS['TSFE']->register['ke_search_queryTime'] = (TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds() - $GLOBALS['TSFE']->register['ke_search_queryStartTime']); $objResponse->addAssign('kesearch_query_time', 'innerHTML', sprintf($this->pi_getLL('query_time'), $GLOBALS['TSFE']->register['ke_search_queryTime'])); } } @@ -1050,11 +941,7 @@ public function renderNoResultsText() { // attention icon (only in marker based template) unset($imageConf); - if (TYPO3_VERSION_INTEGER < 6002000) { - $imageConf['file'] = t3lib_extMgm::siteRelPath($this->extKey).'res/img/attention.gif'; - } else { - $imageConf['file'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'res/img/attention.gif'; - } + $imageConf['file'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'res/img/attention.gif'; $imageConf['altText'] = $this->pi_getLL('no_results_found'); $attentionImage = $this->cObj->IMAGE($imageConf); } @@ -1062,11 +949,7 @@ public function renderNoResultsText() { // hook to implement your own idea of a no result message if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['noResultsHandler'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['noResultsHandler'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->noResultsHandler($noResultsText, $this); } } @@ -1098,11 +981,7 @@ public function renderTooShortWordsText() { // attention icon unset($imageConf); - if (TYPO3_VERSION_INTEGER < 6002000) { - $imageConf['file'] = t3lib_extMgm::siteRelPath($this->extKey) . 'res/img/attention.gif'; - } else { - $imageConf['file'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/attention.gif'; - } + $imageConf['file'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/attention.gif'; $imageConf['altText'] = $this->pi_getLL('no_results_found'); $attentionImage=$this->cObj->IMAGE($imageConf); @@ -1156,11 +1035,7 @@ public function getSearchResults() { // init counter and loop through the search results $resultCount = 1; - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->searchResult = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_searchresult', $this); - } else { - $this->searchResult = t3lib_div::makeInstance('tx_kesearch_lib_searchresult', $this); - } + $this->searchResult = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_searchresult', $this); $this->fluidTemplateVariables['resultrows'] = array(); @@ -1179,11 +1054,7 @@ public function getSearchResults() { // make curent row number available to hook $this->currentRowNumber = $resultCount; foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['additionalResultMarker'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->additionalResultMarker( $tempMarkerArray, $row, @@ -1301,11 +1172,7 @@ public function getSearchResults() { // hook for additional content AFTER the result list if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['additionalContentAfterResultList'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['additionalContentAfterResultList'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $content .= $_procObj->additionalContentAfterResultList($this); } } @@ -1385,25 +1252,13 @@ function renderPreviewImageOrTypeIcon($row) { public function countSearchWordWithKeStats($searchphrase='') { $searchphrase = trim($searchphrase); - if (TYPO3_VERSION_INTEGER < 6002000) { - $keStatsIsLoaded = t3lib_extMgm::isLoaded('ke_stats'); - } else { - $keStatsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_stats'); - } + $keStatsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_stats'); if ($keStatsIsLoaded && !empty($searchphrase)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $keStatsObj = TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj('EXT:ke_stats/pi1/class.tx_kestats_pi1.php:tx_kestats_pi1'); - } else { - $keStatsObj = t3lib_div::getUserObj('EXT:ke_stats/pi1/class.tx_kestats_pi1.php:tx_kestats_pi1'); - } + $keStatsObj = TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj('EXT:ke_stats/pi1/class.tx_kestats_pi1.php:tx_kestats_pi1'); $keStatsObj->initApi(); // count words - if (TYPO3_VERSION_INTEGER >= 7000000) { - $wordlist = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(' ', $searchphrase, true); - } else { - $wordlist = t3lib_div::trimExplode(' ', $searchphrase, true); - } + $wordlist = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(' ', $searchphrase, true); foreach ($wordlist as $singleword) { $keStatsObj->increaseCounter( 'ke_search Words', @@ -1489,11 +1344,7 @@ public function renderPagebrowser() { $content = ''; if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['renderPagebrowserInit'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['renderPagebrowserInit'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $content = $_procObj->renderPagebrowserInit($this); } } @@ -1648,11 +1499,7 @@ public function renderPagebrowser() { // use only if you use marker based templating, not for fluid based templating! if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['pagebrowseAdditionalMarker'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['pagebrowseAdditionalMarker'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->pagebrowseAdditionalMarker( $markerArray, $this @@ -1667,11 +1514,7 @@ public function renderPagebrowser() { public function renderOrdering() { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $sortObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_sorting', $this); - } else { - $sortObj = t3lib_div::makeInstance('tx_kesearch_lib_sorting', $this); - } + $sortObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_sorting', $this); return $sortObj->renderSorting($this->fluidTemplateVariables); } @@ -1718,23 +1561,21 @@ public function renderFilePreview($row) { public function renderFALPreviewImage($uid, $table='pages', $fieldname='media') { $imageHtml = ''; - if (TYPO3_VERSION_INTEGER >= 6000000) { - $imageConf = $this->conf['previewImage.']; - $fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); - $fileObjects = $fileRepository->findByRelation($table, $fieldname, $uid); - if (count($fileObjects)) { - $fileObject = $fileObjects[0]; - } + $imageConf = $this->conf['previewImage.']; + $fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); + $fileObjects = $fileRepository->findByRelation($table, $fieldname, $uid); + if (count($fileObjects)) { + $fileObject = $fileObjects[0]; + } - if ($fileObject) { - $referenceProperties = $fileObject->getReferenceProperties(); - $originalFileProperties = $fileObject->getOriginalFile()->getProperties(); - $alternative = $referenceProperties['alternative'] ? $referenceProperties['alternative'] : $originalFileProperties['alternative']; + if ($fileObject) { + $referenceProperties = $fileObject->getReferenceProperties(); + $originalFileProperties = $fileObject->getOriginalFile()->getProperties(); + $alternative = $referenceProperties['alternative'] ? $referenceProperties['alternative'] : $originalFileProperties['alternative']; - $imageConf['file'] = $fileObject->getPublicUrl(); - $imageConf['altText'] = $alternative; - $imageHtml = $this->renderPreviewImage($imageConf); - } + $imageConf['file'] = $fileObject->getPublicUrl(); + $imageConf['altText'] = $alternative; + $imageHtml = $this->renderPreviewImage($imageConf); } return $imageHtml; @@ -1750,11 +1591,7 @@ public function renderFALPreviewImage($uid, $table='pages', $fieldname='media') public function renderPreviewImage($imageConf) { if (empty($imageConf['file.']['maxW'])) $imageConf['file.']['maxW'] = 150; if (empty($imageConf['file.']['maxH'])) $imageConf['file.']['maxH'] = 150; - if (TYPO3_VERSION_INTEGER < 7000000) { - $rendered = $this->cObj->IMAGE($imageConf); - } else { - $rendered = $this->cObj->cObjGetSingle('IMAGE', $imageConf); - } + $rendered = $this->cObj->cObjGetSingle('IMAGE', $imageConf); return $rendered; } @@ -1772,37 +1609,21 @@ public function renderTypeIcon($typeComplete) { } else { // custom image (old configuration option, only for gif images) if ($this->conf['additionalPathForTypeIcons']) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $imageConf['file'] = str_replace(PATH_site, '', TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['additionalPathForTypeIcons'] . $name . '.gif')); - } else { - $imageConf['file'] = str_replace(PATH_site, '', t3lib_div::getFileAbsFileName($this->conf['additionalPathForTypeIcons'] . $name . '.gif')); - } + $imageConf['file'] = str_replace(PATH_site, '', TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['additionalPathForTypeIcons'] . $name . '.gif')); } } // fallback: default image if(!is_file(PATH_site . $imageConf['file'])) { - if (TYPO3_VERSION_INTEGER < 6002000) { - $imageConf['file'] = t3lib_extMgm::siteRelPath($this->extKey) . 'res/img/types/' . $name . '.gif'; - } else { - $imageConf['file'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/types/' . $name . '.gif'; - } + $imageConf['file'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/types/' . $name . '.gif'; // fallback for file results: use default if no image for this file extension is available if($type == 'file' && !is_file(PATH_site . $imageConf['file'])) { - if (TYPO3_VERSION_INTEGER < 6002000) { - $imageConf['file'] = t3lib_extMgm::siteRelPath($this->extKey) . 'res/img/types/file.gif'; - } else { - $imageConf['file'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/types/file.gif'; - } + $imageConf['file'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'res/img/types/file.gif'; } } - if (TYPO3_VERSION_INTEGER < 7000000) { - $rendered = $this->cObj->IMAGE($imageConf); - } else { - $rendered = $this->cObj->cObjGetSingle('IMAGE', $imageConf); - } + $rendered = $this->cObj->cObjGetSingle('IMAGE', $imageConf); return $rendered; } @@ -1910,11 +1731,7 @@ public function getFilterPreselect() { // and proceed only when preselectedFilter was not set // this reduces the amount of sql queries, too if($this->conf['preselected_filters'] && count($this->preselectedFilter) == 0) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $preselectedArray = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['preselected_filters'], true); - } else { - $preselectedArray = t3lib_div::trimExplode(',', $this->conf['preselected_filters'], true); - } + $preselectedArray = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['preselected_filters'], true); foreach ($preselectedArray as $option) { $option = intval($option); $fields = ' @@ -1970,11 +1787,7 @@ public function addHeaderParts() { $linkconf['parameter'] = $this->conf['resultPage']; $linkconf['additionalParams'] = ''; $linkconf['useCacheHash'] = false; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $targetUrl = TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkconf)); - } else { - $targetUrl = t3lib_div::locationHeaderUrl($this->cObj->typoLink_URL($linkconf)); - } + $targetUrl = TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkconf)); $content = $this->cObj->getSubpart($this->templateCode, '###JS_SEARCH_ALL###'); if($this->conf['renderMethod'] != 'static' ) { @@ -1993,11 +1806,7 @@ public function addHeaderParts() { } // define some additional markers - if (TYPO3_VERSION_INTEGER < 6002000) { - $markerArray['###SITE_REL_PATH###'] = t3lib_extMgm::siteRelPath($this->extKey); - } else { - $markerArray['###SITE_REL_PATH###'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey); - } + $markerArray['###SITE_REL_PATH###'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey); $markerArray['###TARGET_URL###'] = $targetUrl; $markerArray['###PREFIX_ID###'] = $this->prefixId; $markerArray['###SEARCHBOX_DEFAULT_VALUE###'] = $this->pi_getLL('searchbox_default_value'); @@ -2006,11 +1815,7 @@ public function addHeaderParts() { $content = $this->cObj->substituteMarkerArray($content, $markerArray); // add JS to page header - if (TYPO3_VERSION_INTEGER >= 6000000) { - $GLOBALS['TSFE']->getPageRenderer()->addHeaderData($content); - } else { - $GLOBALS['TSFE']->additionalHeaderData['jsContent'] = $content; - } + $GLOBALS['TSFE']->getPageRenderer()->addHeaderData($content); } diff --git a/Classes/lib/class.tx_kesearch_lib_div.php b/Classes/lib/class.tx_kesearch_lib_div.php index 8d336daf..ad17bf0b 100644 --- a/Classes/lib/class.tx_kesearch_lib_div.php +++ b/Classes/lib/class.tx_kesearch_lib_div.php @@ -98,11 +98,7 @@ public function getFirstStartingPoint($pages = 0) { * @return string XSS safe value */ public function removeXSS($value) { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $returnValue = TYPO3\CMS\Core\Utility\GeneralUtility::removeXSS($value); - } else { - $returnValue = t3lib_div::removeXSS($value); - } + $returnValue = TYPO3\CMS\Core\Utility\GeneralUtility::removeXSS($value); return $returnValue; } diff --git a/Classes/lib/class.tx_kesearch_lib_fileinfo.php b/Classes/lib/class.tx_kesearch_lib_fileinfo.php index f821e60b..616c357f 100644 --- a/Classes/lib/class.tx_kesearch_lib_fileinfo.php +++ b/Classes/lib/class.tx_kesearch_lib_fileinfo.php @@ -67,11 +67,7 @@ protected function setFileInformations($file) { $this->file = $file instanceof \TYPO3\CMS\Core\Resource\File ? $file : NULL; if(is_string($file) && !empty($file)) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->fileInfo = TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($file); - } else { - $this->fileInfo = t3lib_div::split_fileref($file); - } + $this->fileInfo = TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($file); $this->fileInfo['mtime'] = filemtime($file); $this->fileInfo['atime'] = fileatime($file); $this->fileInfo['owner'] = fileowner($file); diff --git a/Classes/lib/class.tx_kesearch_lib_helper.php b/Classes/lib/class.tx_kesearch_lib_helper.php index e585c762..27af1ec5 100644 --- a/Classes/lib/class.tx_kesearch_lib_helper.php +++ b/Classes/lib/class.tx_kesearch_lib_helper.php @@ -46,11 +46,7 @@ public static function getExtConf() { // so you we need to change the default char # against something else. // MySQL has problems also with # // but we wrap # with " and it works. - if (TYPO3_VERSION_INTEGER < 6002000) { - $keSearchPremiumIsLoaded = t3lib_extMgm::isLoaded('ke_search_premium'); - } else { - $keSearchPremiumIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search_premium'); - } + $keSearchPremiumIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search_premium'); if ($keSearchPremiumIsLoaded) { $extConfPremium = tx_kesearch_helper::getExtConfPremium(); $extConf['prePostTagChar'] = $extConfPremium['prePostTagChar']; @@ -79,11 +75,7 @@ public static function getExtConf() { * @since 14.10.14 */ public static function getExtConfPremium() { - if (TYPO3_VERSION_INTEGER < 6002000) { - $keSearchPremiumIsLoaded = t3lib_extMgm::isLoaded('ke_search_premium'); - } else { - $keSearchPremiumIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search_premium'); - } + $keSearchPremiumIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search_premium'); if ($keSearchPremiumIsLoaded) { $extConfPremium = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ke_search_premium']); if (!$extConfPremium['prePostTagChar']) $extConfPremium['prePostTagChar'] = '_'; @@ -117,11 +109,7 @@ public static function getCategories($uid, $table) { ); if ($uid && $table) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $enableFields = \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_category') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_category'); - } else { - $enableFields = t3lib_befunc::BEenableFields('sys_category') . t3lib_befunc::deleteClause('sys_category'); - } + $enableFields = \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_category') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_category'); $resCat = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( 'sys_category.uid, sys_category.title', 'sys_category', diff --git a/Classes/lib/class.tx_kesearch_lib_items.php b/Classes/lib/class.tx_kesearch_lib_items.php index 1b9537ae..a6b6e143 100644 --- a/Classes/lib/class.tx_kesearch_lib_items.php +++ b/Classes/lib/class.tx_kesearch_lib_items.php @@ -35,11 +35,7 @@ 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) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_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 179f189a..47dff49d 100644 --- a/Classes/lib/class.tx_kesearch_lib_searchphrase.php +++ b/Classes/lib/class.tx_kesearch_lib_searchphrase.php @@ -120,11 +120,7 @@ public function explodeSearchPhrase($searchString) { $word = trim($word, '+-~<>'); // check for word length - if (TYPO3_VERSION_INTEGER >= 7000000) { - $csconv = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Charset\\CharsetConverter'); - } else { - $csconv = t3lib_div::makeInstance('t3lib_cs'); - } + $csconv = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Charset\\CharsetConverter'); $searchWordLength = $csconv->utf8_strlen($word); if($searchWordLength < $this->pObj->extConf['searchWordLength']) { $this->pObj->hasTooShortWords = true; @@ -228,11 +224,7 @@ public function buildPiVarsTagsAgainst(array &$tagsAgainst) { // hook for modifiying the tags to filter for if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyTagsAgainst'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyTagsAgainst'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyTagsAgainst($tagsAgainst, $this); } } diff --git a/Classes/lib/class.tx_kesearch_lib_searchresult.php b/Classes/lib/class.tx_kesearch_lib_searchresult.php index cd6fa491..120faa4b 100644 --- a/Classes/lib/class.tx_kesearch_lib_searchresult.php +++ b/Classes/lib/class.tx_kesearch_lib_searchresult.php @@ -102,11 +102,7 @@ public function getTitle() { if ($this->row['orig_uid']) { $fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); $fileObject = $fileRepository->findByUid($this->row['orig_uid']); - if (TYPO3_VERSION_INTEGER >= 6002000) { - $metadata = $fileObject->_getMetaData(); - } else { - $metadata = array(); - } + $metadata = $fileObject->_getMetaData(); $linktext = ($metadata['title'] ? $metadata['title'] : $this->row['title']); } else { $linktext = $this->row['title']; diff --git a/Classes/lib/class.tx_kesearch_lib_sorting.php b/Classes/lib/class.tx_kesearch_lib_sorting.php index 70928925..10c55eb1 100644 --- a/Classes/lib/class.tx_kesearch_lib_sorting.php +++ b/Classes/lib/class.tx_kesearch_lib_sorting.php @@ -88,11 +88,7 @@ public function init(tx_kesearch_lib $pObj) { $this->subpartArray['###SORT_LINK###'] = $this->cObj->getSubpart($this->subpartArray['###ORDERNAVIGATION###'], '###SORT_LINK###'); // get sorting values (sortdate, title, what ever...) - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->sortBy = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['sortByVisitor'], true); - } else { - $this->sortBy = t3lib_div::trimExplode(',', $this->conf['sortByVisitor'], true); - } + $this->sortBy = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['sortByVisitor'], true); } @@ -113,11 +109,7 @@ public function renderSorting(&$fluidTemplateVariables) { // we can't sort by score if there is no sword given if($this->pObj->sword != '' || $field != 'score') { $sortByDir = $this->getDefaultSortingDirection($field); - if (TYPO3_VERSION_INTEGER >= 7000000) { - $dbOrdering = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(' ', $this->db->getOrdering()); - } else { - $dbOrdering = t3lib_div::trimExplode(' ', $this->db->getOrdering()); - } + $dbOrdering = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(' ', $this->db->getOrdering()); /* if ordering direction is the same change it * @@ -191,11 +183,7 @@ public function getDefaultSortingDirection($field) { public function changeOrdering($direction) { $allowedDirections = array('asc', 'desc'); $direction = strtolower($direction); - if (TYPO3_VERSION_INTEGER >= 7000000) { - $isInArray = TYPO3\CMS\Core\Utility\GeneralUtility::inArray($allowedDirections, $direction); - } else { - $isInArray = t3lib_div::inArray($allowedDirections, $direction); - } + $isInArray = TYPO3\CMS\Core\Utility\GeneralUtility::inArray($allowedDirections, $direction); if(!empty($direction) && $isInArray) { if($direction == 'asc') { $direction = 'desc'; 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 8e5f3464..ffc1cda5 100644 --- a/Classes/lib/filters/class.tx_kesearch_lib_filters_textlinks.php +++ b/Classes/lib/filters/class.tx_kesearch_lib_filters_textlinks.php @@ -135,11 +135,7 @@ public function renderTextlinks($filterUid, $optionsOfSearchresult, $lib) { // modify filter options by hook if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptions'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptions'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $contentOptions .= $_procObj->modifyFilterOptions( $filterUid, $contentOptions, @@ -217,11 +213,7 @@ public function getOptionsOfFilter($filter, $additionalOptionValues) { // build intersection of both arrays $optionsOfCurrentFilter = array_intersect_key($allOptionsOfCurrentFilter, $additionalOptionValues); // merge additional values into option array - if (TYPO3_VERSION_INTEGER >= 7000000) { - \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($optionsOfCurrentFilter, (array)$additionalOptionValues); - } else { - $optionsOfCurrentFilter = t3lib_div::array_merge_recursive_overrule((array)$optionsOfCurrentFilter, (array)$additionalOptionValues); - } + \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($optionsOfCurrentFilter, (array)$additionalOptionValues); // return sorted option array return $this->sortMultiDimArray($optionsOfCurrentFilter); } else return array(); @@ -337,11 +329,7 @@ public function generateLink($filterUid, $option) { // This is useful if you want to define special sortings for each textlink if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyParamsForTextlinks'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyParamsForTextlinks'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyParamsForTextlinks($params, $excludes, $option, $this->conf, $this->pObj); } } diff --git a/Resources/Private/Partials/Filters.html b/Resources/Private/Partials/Filters.html index ef3f1b54..362b1880 100644 --- a/Resources/Private/Partials/Filters.html +++ b/Resources/Private/Partials/Filters.html @@ -4,7 +4,6 @@ --> - {filter.rendertype} diff --git a/Tests/indexer/class.tx_kesearch_indexerTest.php b/Tests/indexer/class.tx_kesearch_indexerTest.php index 130b6499..96678b5a 100644 --- a/Tests/indexer/class.tx_kesearch_indexerTest.php +++ b/Tests/indexer/class.tx_kesearch_indexerTest.php @@ -11,11 +11,7 @@ class IndexerTest extends Tx_Extbase_BaseTestCase { public function setUp() { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); - } else { - $this->indexer = t3lib_div::makeInstance('tx_kesearch_indexer'); - } + $this->indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); $this->indexer->additionalFields = array('orig_uid', 'orig_pid', 'enddate'); } diff --git a/Tests/indexer/class.tx_kesearch_indexerTypesTest.php b/Tests/indexer/class.tx_kesearch_indexerTypesTest.php index 67ea28f9..e7fd091a 100644 --- a/Tests/indexer/class.tx_kesearch_indexerTypesTest.php +++ b/Tests/indexer/class.tx_kesearch_indexerTypesTest.php @@ -16,17 +16,10 @@ class IndexerTypesTest extends Tx_Extbase_BaseTestCase { public function setUp() { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->indexerTypes = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer_types'); - $this->indexerTypes->queryGen = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_queryGenerator'); - $this->pageIndexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer_types_page'); - $this->pageIndexer->pObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); - } else { - $this->indexerTypes = t3lib_div::makeInstance('tx_kesearch_indexer_types'); - $this->indexerTypes->queryGen = t3lib_div::makeInstance('t3lib_queryGenerator'); - $this->pageIndexer = t3lib_div::makeInstance('tx_kesearch_indexer_types_page'); - $this->pageIndexer->pObj = t3lib_div::makeInstance('tx_kesearch_indexer'); - } + $this->indexerTypes = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer_types'); + $this->indexerTypes->queryGen = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_queryGenerator'); + $this->pageIndexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer_types_page'); + $this->pageIndexer->pObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); $this->pageIndexer->pObj->extConf['prePostTagChar'] = '#'; } diff --git a/Tests/lib/class.tx_kesearch_lib_searchphraseTest.php b/Tests/lib/class.tx_kesearch_lib_searchphraseTest.php index 85fe38cf..71c647d3 100644 --- a/Tests/lib/class.tx_kesearch_lib_searchphraseTest.php +++ b/Tests/lib/class.tx_kesearch_lib_searchphraseTest.php @@ -17,11 +17,7 @@ public function setUp() { ->method('pi_getLL') ->will($this->returnValue('Bitte geben Sie einen Suchbegriff ein')); - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->searchPhrase = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_searchphrase'); - } else { - $this->searchPhrase = t3lib_div::makeInstance('tx_kesearch_lib_searchphrase'); - } + $this->searchPhrase = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_searchphrase'); $this->searchPhrase->initialize($searchLib); } diff --git a/Tests/lib/class.tx_kesearch_lib_searchresultTest.php b/Tests/lib/class.tx_kesearch_lib_searchresultTest.php index 616d0de9..e735909d 100644 --- a/Tests/lib/class.tx_kesearch_lib_searchresultTest.php +++ b/Tests/lib/class.tx_kesearch_lib_searchresultTest.php @@ -7,11 +7,7 @@ class SearchResultTest extends Tx_Extbase_BaseTestCase { public function setUp() { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $GLOBALS['TSFE']->csConvObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_cs'); - } else { - $GLOBALS['TSFE']->csConvObj = t3lib_div::makeInstance('t3lib_cs'); - } + $GLOBALS['TSFE']->csConvObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_cs'); } public function tearDown() { @@ -28,11 +24,7 @@ public function tearDown() { * @test */ public function checkIsArrayOfWordsInString() { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $lib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib'); - } else { - $lib = t3lib_div::makeInstance('tx_kesearch_lib'); - } + $lib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib'); $sr = new tx_kesearch_lib_searchresult($lib); // check if one word can be found @@ -81,22 +73,14 @@ public function checkIsArrayOfWordsInString() { * @test */ public function checkHighlightArrayOfWordsInContent() { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $lib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib'); - } else { - $lib = t3lib_div::makeInstance('tx_kesearch_lib'); - } + $lib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib'); $lib->conf['resultChars'] = 300; $lib->swords = array( 'Abgangszeugnis' ); - if (TYPO3_VERSION_INTEGER >= 6002000) { - $lib->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj'); - } else { - $lib->cObj = t3lib_div::makeInstance('tslib_cObj'); - } + $lib->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj'); $sr = new tx_kesearch_lib_searchresult($lib); // highlight one word @@ -128,21 +112,13 @@ public function checkHighlightArrayOfWordsInContent() { * @test */ public function checkBuildTeaserContent() { - if (TYPO3_VERSION_INTEGER >= 6002000) { - $lib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib'); - } else { - $lib = t3lib_div::makeInstance('tx_kesearch_lib'); - } + $lib = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib'); $lib->conf['resultChars'] = 300; $lib->swords = array( 'Abgangszeugnis' ); - if (TYPO3_VERSION_INTEGER >= 6002000) { - $lib->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj'); - } else { - $lib->cObj = t3lib_div::makeInstance('tslib_cObj'); - } + $lib->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj'); $sr = new tx_kesearch_lib_searchresult($lib); // test without highlighting diff --git a/cli/class.cli_kesearch.php b/cli/class.cli_kesearch.php index cf383e65..aa4d4043 100644 --- a/cli/class.cli_kesearch.php +++ b/cli/class.cli_kesearch.php @@ -26,12 +26,7 @@ if (!defined('TYPO3_cliMode')) die('You cannot run this script directly!'); // Include basis cli class -if (TYPO3_VERSION_INTEGER < 6002000) { - require_once(PATH_t3lib . 'class.t3lib_cli.php'); - require_once(t3lib_extMgm::extPath('ke_search') . 'Classes/indexer/class.tx_kesearch_indexer.php'); -} else { - 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_cli extends t3lib_cli { @@ -41,11 +36,7 @@ class tx_kesearch_cli extends t3lib_cli { function tx_kesearch_cli () { // Running parent class constructor - if (TYPO3_VERSION_INTEGER >= 6002000) { parent::__construct(); - } else { - parent::t3lib_cli(); - } // Setting help texts: $this->cli_help['name'] = 'ke_search Command Line Interface'; @@ -81,11 +72,7 @@ function cli_main($argv) { case 'startIndexing': - if (TYPO3_VERSION_INTEGER >= 6002000) { - $indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); - } else { - $indexer = t3lib_div::makeInstance('tx_kesearch_indexer'); - } + $indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); $this->cli_echo(chr(10)); $verboseMode = true; $cleanup = $this->extConf['cleanupInterval']; @@ -102,11 +89,5 @@ function cli_main($argv) { } // Call the functionality -if (TYPO3_VERSION_INTEGER >= 6002000) { - $cleanerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_cli'); -} else { - $cleanerObj = t3lib_div::makeInstance('tx_kesearch_cli'); -} -$cleanerObj->cli_main($_SERVER['argv']); - -?> \ No newline at end of file +$cleanerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_cli'); +$cleanerObj->cli_main($_SERVER['argv']); \ No newline at end of file diff --git a/ext_autoload.php b/ext_autoload.php index 0313d2c1..4942e029 100644 --- a/ext_autoload.php +++ b/ext_autoload.php @@ -1,9 +1,5 @@ = 6002000) { - $extensionPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search'); -} else { - $extensionPath = t3lib_extMgm::extPath('ke_search'); -} +$extensionPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search'); return array( 'tx_kesearch_pi1' => $extensionPath . 'pi1/class.tx_kesearch_pi1.php', 'tx_kesearch_indexertask' => $extensionPath . 'Classes/Scheduler/class.tx_kesearch_indexertask.php', diff --git a/ext_emconf.php b/ext_emconf.php index 4446455b..daf8957e 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -1,33 +1,22 @@ 'Faceted Search', 'description' => 'Faceted fulltext search for TYPO3. Fast, flexible and easy to use. Very easy to install. Fast (tested with over 200.000 records) and flexible (you can write your own indexers). Indexes content directly from the databases. Visit kesearch.de for further information and documentation.', 'category' => 'plugin', 'shy' => 0, - 'version' => '2.0.0', + 'version' => '1.99.0', 'dependencies' => '', 'conflicts' => '', 'priority' => '', 'loadOrder' => '', 'module' => '', - 'state' => 'stable', + 'state' => 'beta', 'uploadfolder' => 0, 'createDirs' => '', 'modify_tables' => '', 'clearcacheonload' => 0, 'lockType' => '', - 'author' => 'Christian Buelter (kennziffer.com)', + 'author' => 'Christian Buelter (team.inmedias)', 'author_email' => 'christian.buelter@inmedias.de', 'author_company' => 'www.kennziffer.com GmbH', 'CGLcompliance' => '', @@ -35,7 +24,7 @@ 'constraints' => array( 'depends' => array( 'php' => '5.3.0-0.0.0', - 'typo3' => '4.5.0-7.99.99', + 'typo3' => '6.2.0-7.99.99', ), 'conflicts' => '', 'suggests' => array( diff --git a/ext_localconf.php b/ext_localconf.php index cdd9d6e0..a3815045 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -3,34 +3,17 @@ die ('Access denied.'); } -// get TYPO3 version number as an integer -if (class_exists('TYPO3\\CMS\\Core\\Utility\\VersionNumberUtility')) { - define('TYPO3_VERSION_INTEGER', \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version)); -} else if (class_exists('t3lib_utility_VersionNumber')) { - define('TYPO3_VERSION_INTEGER', t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)); -} else { - define('TYPO3_VERSION_INTEGER', t3lib_div::int_from_ver(TYPO3_version)); -} - // register cli-script if (TYPO3_MODE=='BE') { $TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys'][$_EXTKEY] = array('EXT:' . $_EXTKEY . '/cli/class.cli_kesearch.php','_CLI_kesearch'); } // include filterlist class and pageTSconfig.txt and add plugin -if (TYPO3_VERSION_INTEGER < 6002000) { - include_once(t3lib_extMgm::extPath($_EXTKEY).'/Classes/Backend/class.user_filterlist.php'); - t3lib_extMgm::addPageTSConfig(''); - t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.tx_kesearch_pi1.php', '_pi1', 'list_type', 0); - t3lib_extMgm::addPItoST43($_EXTKEY, 'pi2/class.tx_kesearch_pi2.php', '_pi2', 'list_type', 0); - t3lib_extMgm::addPItoST43($_EXTKEY, 'pi3/class.tx_kesearch_pi3.php', '_pi3', 'list_type', 0); -} else { - include_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . '/Classes/Backend/class.user_filterlist.php'); - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(''); - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi1/class.tx_kesearch_pi1.php', '_pi1', 'list_type', 0); - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi2/class.tx_kesearch_pi2.php', '_pi2', 'list_type', 0); - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi3/class.tx_kesearch_pi3.php', '_pi3', 'list_type', 0); -} +include_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . '/Classes/Backend/class.user_filterlist.php'); +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(''); +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi1/class.tx_kesearch_pi1.php', '_pi1', 'list_type', 0); +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi2/class.tx_kesearch_pi2.php', '_pi2', 'list_type', 0); +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi3/class.tx_kesearch_pi3.php', '_pi3', 'list_type', 0); // use hooks for generation of sortdate values $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerAdditionalFields'][] = 'EXT:ke_search/Classes/hooks/class.user_kesearchhooks.php:user_kesearch_sortdate'; diff --git a/ext_tables.php b/ext_tables.php index 791d9345..a93deaa2 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -4,13 +4,8 @@ die('Access denied.'); } -if (TYPO3_VERSION_INTEGER < 6002000) { - $extPath = t3lib_extMgm::extPath('ke_search'); - $extRelPath = t3lib_extMgm::extRelPath('ke_search'); -} else { - $extPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search'); - $extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search'); -} +$extPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search'); +$extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search'); if (TYPO3_MODE == 'BE') { require_once($extPath . 'Classes/lib/class.tx_kesearch_lib_items.php'); @@ -33,11 +28,7 @@ ); // help file -if (TYPO3_VERSION_INTEGER < 6002000) { - t3lib_extMgm::addLLrefForTCAdescr('tx_kesearch_filters', 'EXT:ke_search/locallang_csh.xml'); -} else { - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_kesearch_filters', 'EXT:ke_search/locallang_csh.xml'); -} +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_kesearch_filters', 'EXT:ke_search/locallang_csh.xml'); // Show FlexForm field in plugin configuration $TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi1'] = 'pi_flexform'; @@ -45,80 +36,39 @@ $TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi3'] = 'pi_flexform'; // Configure FlexForm field -if (TYPO3_VERSION_INTEGER < 6002000) { - t3lib_extMgm::addPiFlexFormValue($_EXTKEY . '_pi1', 'FILE:EXT:ke_search/pi1/flexform_pi1.xml'); - t3lib_extMgm::addPiFlexFormValue($_EXTKEY . '_pi2', 'FILE:EXT:ke_search/pi2/flexform_pi2.xml'); - t3lib_extMgm::addPiFlexFormValue($_EXTKEY . '_pi3', 'FILE:EXT:ke_search/pi3/flexform_pi3.xml'); -} else { - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($_EXTKEY . '_pi1', 'FILE:EXT:ke_search/pi1/flexform_pi1.xml'); - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($_EXTKEY . '_pi2', 'FILE:EXT:ke_search/pi2/flexform_pi2.xml'); - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($_EXTKEY . '_pi3', 'FILE:EXT:ke_search/pi3/flexform_pi3.xml'); -} +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($_EXTKEY . '_pi1', 'FILE:EXT:ke_search/pi1/flexform_pi1.xml'); +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($_EXTKEY . '_pi2', 'FILE:EXT:ke_search/pi2/flexform_pi2.xml'); +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($_EXTKEY . '_pi3', 'FILE:EXT:ke_search/pi3/flexform_pi3.xml'); -if (TYPO3_VERSION_INTEGER < 6001000) { - t3lib_div::loadTCA('pages'); - t3lib_div::loadTCA('tt_content'); -} - -if (TYPO3_VERSION_INTEGER < 6002000) { - t3lib_extMgm::addTCAcolumns('pages', $tempColumns); - t3lib_extMgm::addToAllTCAtypes('pages', 'tx_kesearch_tags;;;;1-1-1'); -} else { - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $tempColumns); - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'tx_kesearch_tags;;;;1-1-1'); -} +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $tempColumns); +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'tx_kesearch_tags;;;;1-1-1'); if (TYPO3_MODE == 'BE') { - if (TYPO3_VERSION_INTEGER < 6002000) { - t3lib_extMgm::addModulePath('web_txkesearchM1', $extPath . 'mod1/'); - t3lib_extMgm::addModule('web', 'txkesearchM1', '', $extPath . 'mod1/'); - } else { - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath('web_txkesearchM1', $extPath . 'mod1/'); - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule('web', 'txkesearchM1', '', $extPath . 'mod1/'); - } + TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath('web_txkesearchM1', $extPath . 'mod1/'); + TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule('web', 'txkesearchM1', '', $extPath . 'mod1/'); } $TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_pi1'] = 'layout,select_key'; $TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_pi2'] = 'layout,select_key'; $TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_pi3'] = 'layout,select_key'; -if (TYPO3_VERSION_INTEGER < 6002000) { - t3lib_extMgm::addPlugin(array( - 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi1', - $_EXTKEY . '_pi1', - $extRelPath . 'ext_icon.gif'), 'list_type' - ); - - t3lib_extMgm::addPlugin(array( - 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi2', - $_EXTKEY . '_pi2', - $extRelPath . 'ext_icon.gif'), 'list_type' - ); - - t3lib_extMgm::addPlugin(array( - 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi3', - $_EXTKEY . '_pi3', - $extRelPath . 'ext_icon.gif'), 'list_type' - ); -} else { - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array( - 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi1', - $_EXTKEY . '_pi1', - $extRelPath . 'ext_icon.gif'), 'list_type' - ); - - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array( - 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi2', - $_EXTKEY . '_pi2', - $extRelPath . 'ext_icon.gif'), 'list_type' - ); - - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array( - 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi3', - $_EXTKEY . '_pi3', - $extRelPath . 'ext_icon.gif'), 'list_type' - ); -} +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array( + 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi1', + $_EXTKEY . '_pi1', + $extRelPath . 'ext_icon.gif'), 'list_type' +); + +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array( + 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi2', + $_EXTKEY . '_pi2', + $extRelPath . 'ext_icon.gif'), 'list_type' +); + +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array( + 'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi3', + $_EXTKEY . '_pi3', + $extRelPath . 'ext_icon.gif'), 'list_type' +); $GLOBALS['TCA']['tx_kesearch_filters'] = array( 'ctrl' => array( @@ -182,14 +132,8 @@ ); // class for displaying the category tree for tt_news in BE forms. -if (TYPO3_VERSION_INTEGER < 6002000) { - if (t3lib_extMgm::isLoaded('tt_news')) { - include_once(t3lib_extMgm::extPath('tt_news') . 'lib/class.tx_ttnews_TCAform_selectTree.php'); - } -} else { - if (TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news')) { - include_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('tt_news') . 'lib/class.tx_ttnews_TCAform_selectTree.php'); - } +if (TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news')) { + include_once(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('tt_news') . 'lib/class.tx_ttnews_TCAform_selectTree.php'); } $GLOBALS['TCA']['tx_kesearch_indexerconfig'] = array( @@ -215,4 +159,4 @@ $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_kesearch_pi2_wizicon'] = $extPath . 'pi2/class.tx_kesearch_pi2_wizicon.php'; $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_kesearch_pi3_wizicon'] = $extPath . 'pi3/class.tx_kesearch_pi3_wizicon.php'; } -?> +?> \ No newline at end of file diff --git a/mod1/index.php b/mod1/index.php index 04048d25..77acb7b5 100644 --- a/mod1/index.php +++ b/mod1/index.php @@ -27,18 +27,8 @@ * Hint: use extdeveval to insert/update function index above. */ - $GLOBALS['LANG']->includeLLFile('EXT:ke_search/mod1/locallang.xml'); - -if (TYPO3_VERSION_INTEGER < 6002000) { - require_once(PATH_t3lib . 'class.t3lib_scbase.php'); -} - -if (TYPO3_VERSION_INTEGER < 7002000) { - $BE_USER->modAccess($MCONF,1); // This checks permissions and exits if the users has no permission for entry. -} else { - $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'],1); // This checks permissions and exits if the users has no permission for entry. -} +$GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'],1); // This checks permissions and exits if the users has no permission for entry. /** * Module 'Indexer' for the 'ke_search' extension. @@ -48,13 +38,7 @@ * @subpackage tx_kesearch */ -if (TYPO3_VERSION_INTEGER >= 7000000) { - class tx_kesearch_module_baseclass extends \TYPO3\CMS\Backend\Module\BaseScriptClass { } -} else { - class tx_kesearch_module_baseclass extends t3lib_SCbase { } -} - -class tx_kesearch_module1 extends tx_kesearch_module_baseclass { +class tx_kesearch_module1 extends \TYPO3\CMS\Backend\Module\BaseScriptClass { var $pageinfo; var $registry; @@ -67,13 +51,7 @@ function init() { parent::init(); // init registry class - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Registry'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_Registry'); - } else { - $this->registry = t3lib_div::makeInstance('t3lib_Registry'); - } + $this->registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Registry'); } /** @@ -106,22 +84,12 @@ function main() { // Access check! // The page will show only if there is a valid page and if this page may be viewed by the user - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id,$this->perms_clause); - } else { - $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause); - } + $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id,$this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; // create document template - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('mediumDoc'); - } else { - $this->doc = t3lib_div::makeInstance('mediumDoc'); - } + $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); if (($this->id && $access) || ($GLOBALS['BE_USER']->user['admin'] && !$this->id)) { @@ -146,19 +114,11 @@ function jumpToUrl(URL) { // add some css $cssFile = 'res/backendModule.css'; - if (TYPO3_VERSION_INTEGER >= 6002000) { - $this->doc->getPageRenderer()->addCssFile(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search') . $cssFile); - } else { - $this->doc->inDocStyles = file_get_contents(t3lib_extMgm::extPath('ke_search') . $cssFile); - } + $this->doc->getPageRenderer()->addCssFile(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search') . $cssFile); $this->content .= '
'; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->content .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']); - } else { - $this->content .= t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']); - } + $this->content .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']); $this->content .= '
'; $this->content .= '
'; @@ -202,23 +162,15 @@ function moduleContent() { $this->extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ke_search']); $content = ''; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $do = TYPO3\CMS\Core\Utility\GeneralUtility::_GET('do'); - } else { - $do = t3lib_div::_GET('do'); - } + $do = TYPO3\CMS\Core\Utility\GeneralUtility::_GET('do'); switch((string)$this->MOD_SETTINGS['function']) { // start indexing process case 1: // make indexer instance and init - if (TYPO3_VERSION_INTEGER >= 6002000) { - /* @var $indexer tx_kesearch_indexer */ - $indexer = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); - } else { - $indexer = t3lib_div::makeInstance('tx_kesearch_indexer'); - } + /* @var $indexer tx_kesearch_indexer */ + $indexer = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_indexer'); // get indexer configurations $indexerConfigurations = $indexer->getConfigurations(); @@ -265,22 +217,14 @@ function moduleContent() { $content .= '

The indexer is already running and can not be started twice.

'; $content .= '

The indexing process was started at '.strftime('%c', $lockTime).'.

'; $content .= '

You can remove the lock by clicking the following button.

'; - if (TYPO3_VERSION_INTEGER < 6002000) { - $content .= '
RemoveLock'; - } else{ - $moduleUrl = TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txkesearchM1', array('id' => $this->id, 'do' => 'rmLock')); - $content .= '
RemoveLock'; - } + $moduleUrl = TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txkesearchM1', array('id' => $this->id, 'do' => 'rmLock')); + $content .= '
RemoveLock'; } } else { // no lock set - show "start indexer" link if indexer configurations have been found if ($indexerConfigurations) { - if (TYPO3_VERSION_INTEGER < 6002000) { - $content .= '
' . $GLOBALS['LANG']->getLL('start_indexer') . ''; - } else { - $moduleUrl = TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txkesearchM1', array('id' => $this->id, 'do' => 'startindexer')); - $content .= '
' . $GLOBALS['LANG']->getLL('start_indexer') . ''; - } + $moduleUrl = TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txkesearchM1', array('id' => $this->id, 'do' => 'startindexer')); + $content .= '
' . $GLOBALS['LANG']->getLL('start_indexer') . ''; } else { $content .= '
' . $GLOBALS['LANG']->getLL('no_indexer_configurations') . '
'; } @@ -296,11 +240,7 @@ function moduleContent() { // page is selected: get indexed content $content = '

Index content for page '.$this->id.'

'; - if (TYPO3_VERSION_INTEGER > 7000000) { - $content .= $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path').': '. TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'],-50); - } else { - $content .= $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path').': '.t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-50); - } + $content .= $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path').': '. TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'],-50); $content .= $this->getIndexedContent($this->id); } else { // no page selected: show message @@ -344,12 +284,8 @@ function moduleContent() { $content .= '

' . $GLOBALS['LANG']->getLL('index_contains') . ' ' . $this->getNumberOfRecordsInIndex() . ' ' . $GLOBALS['LANG']->getLL('records') . '.

'; // show "clear index" link - if (TYPO3_VERSION_INTEGER < 6002000) { - $content .= '
Clear whole search index!'; - } else { - $moduleUrl = TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txkesearchM1', array('id' => $this->id, 'do' => 'clear')); - $content .= '
Clear whole search index!'; - } + $moduleUrl = TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txkesearchM1', array('id' => $this->id, 'do' => 'clear')); + $content .= '
Clear whole search index!'; } else { $content .= '

Clear search index: This function is available to admins only.

'; } @@ -552,14 +488,8 @@ function getIndexedContent($pageUid) { $table = 'tx_kesearch_index'; $where = '(type="page" AND targetpid="'.intval($pageUid).'") '; $where .= 'OR (type<>"page" AND pid="'.intval($pageUid).'") '; - - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table,$inv=0); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table,$inv=0); - } else { - $where .= t3lib_befunc::BEenableFields($table,$inv=0); - $where .= t3lib_befunc::deleteClause($table,$inv=0); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table,$inv=0); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table,$inv=0); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where,$groupBy='',$orderBy='',$limit=''); @@ -568,11 +498,7 @@ function getIndexedContent($pageUid) { // build tag table $tagTable = '
'; $cols = 3; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $tags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $row['tags'], true); - } else { - $tags = t3lib_div::trimExplode(',', $row['tags'], true); - } + $tags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $row['tags'], true); $i=1; foreach ($tags as $tag) { $tagTable .= '' . $tag . ''; @@ -727,13 +653,8 @@ function checkSysfolder() { $fields = 'doktype'; $table = 'pages'; $where = 'uid="'.$this->id.'" '; - if (TYPO3_VERSION_INTEGER >= 7000000) { - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); - $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); - } else { - $where .= t3lib_befunc::BEenableFields($table); - $where .= t3lib_befunc::deleteClause($table); - } + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($table); + $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where,$groupBy='',$orderBy='',$limit='1'); $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); if ($row['doktype'] == 254) { @@ -752,11 +673,7 @@ function checkSysfolder() { } // Make instance: -if (TYPO3_VERSION_INTEGER >= 6002000) { - $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_module1'); -} else { - $SOBE = t3lib_div::makeInstance('tx_kesearch_module1'); -} +$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_module1'); $SOBE->init(); $SOBE->main(); $SOBE->printContent(); diff --git a/pi1/class.tx_kesearch_pi1.php b/pi1/class.tx_kesearch_pi1.php index a141b927..3ab1a93c 100644 --- a/pi1/class.tx_kesearch_pi1.php +++ b/pi1/class.tx_kesearch_pi1.php @@ -42,11 +42,7 @@ class tx_kesearch_pi1 extends tx_kesearch_lib { */ function main($content, $conf) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); - } else { - $this->ms = t3lib_div::milliseconds(); - } + $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); $this->conf = $conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); @@ -74,11 +70,7 @@ function main($content, $conf) { // hook for initials if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->addInitials($this); } } @@ -124,11 +116,7 @@ public function renderAdditionalSearchboxContent($content) { // hook for additional searchbox markers if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['additionalSearchboxContent'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['additionalSearchboxContent'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->additionalSearchboxContent($content, $this); } } @@ -143,11 +131,7 @@ public function renderAdditionalSearchboxContent($content) { public function initMarkerTemplate() { // init XAJAX? if ($this->conf['renderMethod'] != 'static') { - if (TYPO3_VERSION_INTEGER < 6002000) { - $xajaxIsLoaded = t3lib_extMgm::isLoaded('xajax'); - } else { - $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax'); - } + $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax'); if (!$xajaxIsLoaded) { return ('ke_search error:"XAJAX" must be installed for this mode.'); } @@ -158,11 +142,7 @@ public function initMarkerTemplate() { if ($this->conf['spinnerImageFile']) { $spinnerSrc = $this->conf['spinnerImageFile']; } else { - if (TYPO3_VERSION_INTEGER < 6002000) { - $spinnerSrc = t3lib_extMgm::siteRelPath($this->extKey).'res/img/spinner.gif'; - } else { - $spinnerSrc = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'res/img/spinner.gif'; - } + $spinnerSrc = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'res/img/spinner.gif'; } $this->spinnerImageFilters = ''.$this->pi_getLL('loading').''; $this->spinnerImageResults = ''.$this->pi_getLL('loading').''; diff --git a/pi1/class.tx_kesearch_pi1_wizicon.php b/pi1/class.tx_kesearch_pi1_wizicon.php index 9e4b2722..24e4b8b4 100644 --- a/pi1/class.tx_kesearch_pi1_wizicon.php +++ b/pi1/class.tx_kesearch_pi1_wizicon.php @@ -42,12 +42,7 @@ function proc($wizardItems) { global $LANG; $LL = $this->includeLocalLang(); - - if (TYPO3_VERSION_INTEGER < 6002000) { - $extRelPath = t3lib_extMgm::extRelPath('ke_search'); - } else { - $extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search'); - } + $extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search'); $wizardItems['plugins_tx_kesearch_pi1'] = array( 'icon' => $extRelPath . 'pi1/ce_wiz.gif', @@ -65,24 +60,10 @@ function proc($wizardItems) { * @return The array with language labels */ function includeLocalLang() { - if (TYPO3_VERSION_INTEGER < 6002000) { - $llFile = t3lib_extMgm::extPath('ke_search') . 'pi1/locallang.xml'; - } else { - $llFile = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'pi1/locallang.xml'; - } + $llFile = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'pi1/locallang.xml'; - if (TYPO3_VERSION_INTEGER >= 4006000) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_l10n_parser_Llxml'); - } else { - $xmlParser = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml'); - } - $LOCAL_LANG = $xmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); - } else { - $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang); - } + $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser'); + $LOCAL_LANG = $xmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); return $LOCAL_LANG; } diff --git a/pi1/flexform_pi1.xml b/pi1/flexform_pi1.xml index 560208ab..52bda7d7 100644 --- a/pi1/flexform_pi1.xml +++ b/pi1/flexform_pi1.xml @@ -32,21 +32,17 @@ select - - LLL:EXT:ke_search/pi1/locallang.xml:ff.renderMethod.I.0 - static - - - LLL:EXT:ke_search/pi1/locallang.xml:ff.renderMethod.I.1 - ajax_after_reload - LLL:EXT:ke_search/pi1/locallang.xml:ff.renderMethod.I.2 fluidtemplate + + [DEPRECATED] marker based templating + static + 1 - static + fluidtemplate diff --git a/pi2/class.tx_kesearch_pi2.php b/pi2/class.tx_kesearch_pi2.php index 7cc0503e..62552ccc 100644 --- a/pi2/class.tx_kesearch_pi2.php +++ b/pi2/class.tx_kesearch_pi2.php @@ -42,11 +42,7 @@ class tx_kesearch_pi2 extends tx_kesearch_lib { */ function main($content, $conf) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); - } else { - $this->ms = t3lib_div::milliseconds(); - } + $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); $this->conf = $conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); @@ -72,11 +68,7 @@ function main($content, $conf) { // hook for initials if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->addInitials($this); } } @@ -89,11 +81,7 @@ function main($content, $conf) { // hook: modifyResultList (only valid for marker based templating, not for fluid based templating) if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyResultList'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyResultList'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyResultList($content, $this); } } @@ -133,11 +121,7 @@ function main($content, $conf) { } // process query time - if (TYPO3_VERSION_INTEGER >= 7000000) { - $queryTime = (TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds() - $GLOBALS['TSFE']->register['ke_search_queryStartTime']); - } else { - $queryTime = (t3lib_div::milliseconds() - $GLOBALS['TSFE']->register['ke_search_queryStartTime']); - } + $queryTime = (TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds() - $GLOBALS['TSFE']->register['ke_search_queryStartTime']); $this->fluidTemplateVariables['queryTime'] = $queryTime; $this->fluidTemplateVariables['queryTimeText'] = sprintf($this->pi_getLL('query_time'), $queryTime); if($this->conf['showQueryTime']) { @@ -181,11 +165,7 @@ function main($content, $conf) { public function initMarkerTemplate() { // init XAJAX? if ($this->conf['renderMethod'] != 'static') { - if (TYPO3_VERSION_INTEGER < 6002000) { - $xajaxIsLoaded = t3lib_extMgm::isLoaded('xajax'); - } else { - $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax'); - } + $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax'); if (!$xajaxIsLoaded) return false; else $this->initXajax(); } @@ -194,11 +174,7 @@ public function initMarkerTemplate() { if ($this->conf['spinnerImageFile']) { $spinnerSrc = $this->conf['spinnerImageFile']; } else { - if (TYPO3_VERSION_INTEGER < 6002000) { - $spinnerSrc = t3lib_extMgm::siteRelPath($this->extKey).'res/img/spinner.gif'; - } else { - $spinnerSrc = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'res/img/spinner.gif'; - } + $spinnerSrc = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'res/img/spinner.gif'; } $this->spinnerImageFilters = ''.$this->pi_getLL('loading').''; $this->spinnerImageResults = ''.$this->pi_getLL('loading').''; diff --git a/pi2/class.tx_kesearch_pi2_wizicon.php b/pi2/class.tx_kesearch_pi2_wizicon.php index 587b0410..20a6508a 100644 --- a/pi2/class.tx_kesearch_pi2_wizicon.php +++ b/pi2/class.tx_kesearch_pi2_wizicon.php @@ -43,11 +43,7 @@ function proc($wizardItems) { $LL = $this->includeLocalLang(); - if (TYPO3_VERSION_INTEGER < 6002000) { - $extRelPath = t3lib_extMgm::extRelPath('ke_search'); - } else { - $extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search'); - } + $extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search'); $wizardItems['plugins_tx_kesearch_pi2'] = array( 'icon' => $extRelPath . 'pi2/ce_wiz.gif', @@ -65,23 +61,9 @@ function proc($wizardItems) { * @return The array with language labels */ function includeLocalLang() { - if (TYPO3_VERSION_INTEGER < 6002000) { - $llFile = t3lib_extMgm::extPath('ke_search') . 'pi2/locallang.xml'; - } else { - $llFile = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'pi2/locallang.xml'; - } - if (TYPO3_VERSION_INTEGER >= 4006000) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_l10n_parser_Llxml'); - } else { - $xmlParser = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml'); - } - $LOCAL_LANG = $xmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); - } else { - $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang); - } + $llFile = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'pi2/locallang.xml'; + $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser'); + $LOCAL_LANG = $xmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); return $LOCAL_LANG; } diff --git a/pi3/class.tx_kesearch_pi3.php b/pi3/class.tx_kesearch_pi3.php index 46ed92ec..feb1b4ae 100644 --- a/pi3/class.tx_kesearch_pi3.php +++ b/pi3/class.tx_kesearch_pi3.php @@ -42,11 +42,7 @@ class tx_kesearch_pi3 extends tx_kesearch_lib { */ function main($content, $conf) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); - } else { - $this->ms = t3lib_div::milliseconds(); - } + $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); $this->conf = $conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); @@ -57,11 +53,7 @@ function main($content, $conf) { // init XAJAX? if ($this->conf['renderMethod'] != 'static') { - if (TYPO3_VERSION_INTEGER < 6002000) { - $xajaxIsLoaded = t3lib_extMgm::isLoaded('xajax'); - } else { - $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax'); - } + $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax'); if (!$xajaxIsLoaded) { return ('ke_search error:"XAJAX" must be installed for this mode.'); } @@ -71,11 +63,7 @@ function main($content, $conf) { // hook for initials if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->addInitials($this); } } @@ -97,11 +85,7 @@ function main($content, $conf) { // hook for modifying content if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyMultiselectContent'])) { foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyMultiselectContent'] as $_classRef) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); - } else { - $_procObj = & t3lib_div::getUserObj($_classRef); - } + $_procObj = & TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $content = $_procObj->modifyMultiselectContent($template['multiselect'], $filter, $this); } } diff --git a/pi3/class.tx_kesearch_pi3_wizicon.php b/pi3/class.tx_kesearch_pi3_wizicon.php index b53f297f..acb18290 100644 --- a/pi3/class.tx_kesearch_pi3_wizicon.php +++ b/pi3/class.tx_kesearch_pi3_wizicon.php @@ -40,14 +40,8 @@ class tx_kesearch_pi3_wizicon { */ function proc($wizardItems) { global $LANG; - $LL = $this->includeLocalLang(); - - if (TYPO3_VERSION_INTEGER < 6002000) { - $extRelPath = t3lib_extMgm::extRelPath('ke_search'); - } else { - $extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search'); - } + $extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search'); $wizardItems['plugins_tx_kesearch_pi3'] = array( 'icon' => $extRelPath . 'pi3/ce_wiz.gif', @@ -65,23 +59,9 @@ function proc($wizardItems) { * @return The array with language labels */ function includeLocalLang() { - if (TYPO3_VERSION_INTEGER < 6002000) { - $llFile = t3lib_extMgm::extPath('ke_search') . 'pi3/locallang.xml'; - } else { - $llFile = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'pi3/locallang.xml'; - } - if (TYPO3_VERSION_INTEGER >= 4006000) { - if (TYPO3_VERSION_INTEGER >= 7000000) { - $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser'); - } else if (TYPO3_VERSION_INTEGER >= 6002000) { - $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_l10n_parser_Llxml'); - } else { - $xmlParser = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml'); - } - $LOCAL_LANG = $xmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); - } else { - $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang); - } + $llFile = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'pi3/locallang.xml'; + $xmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser'); + $LOCAL_LANG = $xmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); return $LOCAL_LANG; } diff --git a/tca.php b/tca.php index 1bee970e..f217fc2a 100644 --- a/tca.php +++ b/tca.php @@ -1,13 +1,8 @@ $TCA['tx_kesearch_filters']['ctrl'], @@ -767,19 +762,10 @@ // news version 3 features system categories instead of it's own // category system which was used in previous versions -if (TYPO3_VERSION_INTEGER < 6002000) { - $ttnewsVersion = t3lib_extMgm::getExtensionVersion('news'); -} else { - $ttnewsVersion = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('news'); -} +$ttnewsVersion = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('news'); if (version_compare($ttnewsVersion, '3.0.0') >= 0) { $TCA['tx_kesearch_indexerconfig']['columns']['index_extnews_category_selection']['config']['treeConfig']['parentField'] = 'parent'; $TCA['tx_kesearch_indexerconfig']['columns']['index_extnews_category_selection']['config']['foreign_table'] = 'sys_category'; $TCA['tx_kesearch_indexerconfig']['columns']['index_extnews_category_selection']['config']['foreign_table_where'] = ''; } - -// fallback for TYPO3 versions below 6 where FAL is not present -if (TYPO3_VERSION_INTEGER < 6000000) { - $TCA['tx_kesearch_indexerconfig']['columns']['fal_storage']['config'] = array('type' => 'passthrough'); -} -?> +?> \ No newline at end of file