/** * Adds the newloginbox wizard icon * * @param array Input array with wizard items for plugins * @return array Modified input array, having the item for newloginbox added. */ function proc($wizardItems) { global $LANG; $LL = $this->includeLocalLang(); $wizardItems['plugins_tx_ttnews_pi'] = array('icon' => TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('tt_news') . 'pi/ce_wiz.gif', 'title' => $LANG->getLLL('pi_title', $LL), 'description' => $LANG->getLLL('pi_plus_wiz_description', $LL), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=9'); return $wizardItems; }
/** * Reads the [extDir]/locallang.xml and returns the \$LOCAL_LANG array found in that file. * * @return The array with language labels */ function includeLocalLang() { $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; }
/** * Construcor of this object */ public function __construct($pObj) { parent::__construct($pObj); $this->templavoilaIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('templavoila'); if ($this->templavoilaIsLoaded) { $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(); $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(); // Filling the config-array, first with the main "config." part if (is_array($GLOBALS['TSFE']->tmpl->setup['config.'])) { $GLOBALS['TSFE']->config['config'] = $GLOBALS['TSFE']->tmpl->setup['config.']; } // override it with the page/type-specific "config." if (is_array($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 $GLOBALS['TSFE']->rootLine = array(0 => array('uid' => $row['uid'], 'title' => $row['title'])); $this->tv = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_templavoila_pi1'); } $this->counter = 0; foreach ($this->indexCTypes as $value) { $cTypes[] = 'CType="' . $value . '"'; } $this->whereClauseForCType = implode(' OR ', $cTypes); // get all available sys_language_uid records $this->sysLanguages = TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); }
/** * Return RTE * * @param string $name Field name * @param string $namePrefix Name prefix (tx_ext_pi1[object]) * @param boolean $isLast Is last flag (generate JavaScript only for the last RTE) * @param string $value Any value * @param string $width Width * @param string $height height * @return string Generated RTE content */ public function render($name, $namePrefix, $isLast = 1, $value = '', $width = '400px', $height = '300px') { require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('rtehtmlarea') . 'pi2/class.tx_rtehtmlarea_pi2.php'; require_once PATH_site . 'typo3conf/ext/t3devapi/Classes/class.tx_t3devapi_fertehtmlarea.php'; if ($this->viewHelperVariableContainer->exists('Tx_T3devapi_ViewHelpers_RteViewHelper', 'rte')) { $rteObject = $this->viewHelperVariableContainer->get('Tx_T3devapi_ViewHelpers_RteViewHelper', 'rte'); } else { $rteObject = array(); $rteObject['counter'] = 1; $rteObject['onsubmit'] = ''; } $rte = new tx_t3devapi_fertehtmlarea(); $rte->setField($name); $rte->setPA(array('itemFormElName' => $namePrefix . '[' . $name . ']', 'itemFormElValue' => $value)); $this->registerFieldNameForFormTokenGeneration($namePrefix . '[' . $name . ']'); $this->registerFieldNameForFormTokenGeneration($namePrefix . '[_TRANSFORM_' . $name . ']'); $rte->setRTEcounter($rteObject['counter']); $rte->setWidth($width); $rte->setHeight($height); $markerArray = $rte->drawRTE(); $rteObject['counter']++; $rteObject['onsubmit'] .= $markerArray['###ADDITIONALJS_SUBMIT###']; if ($isLast == 1) { $rteObject['onsubmit'] = '<script type="text/javascript">function rteMove(){' . $rteObject['onsubmit'] . '}</script>'; //t3lib_div::debug($markerArray['###ADDITIONALJS_PRE###'] . $markerArray['###FORM_RTE_ENTRY###'] . $markerArray['###ADDITIONALJS_POST###'] . $rteObject['onsubmit'],'*'); return $markerArray['###ADDITIONALJS_PRE###'] . $markerArray['###FORM_RTE_ENTRY###'] . $markerArray['###ADDITIONALJS_POST###'] . $rteObject['onsubmit']; } else { $this->viewHelperVariableContainer->addOrUpdate('Tx_T3devapi_ViewHelpers_RteViewHelper', 'rte', $rteObject); return $markerArray['###ADDITIONALJS_PRE###'] . $markerArray['###FORM_RTE_ENTRY###'] . $markerArray['###ADDITIONALJS_POST###']; } }
/** * Loads a template file and generate the content * * @param array $context datas to send * @return string */ public function fluidView($context = array()) { $renderer = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Fluid_View_TemplateView'); $controllerContext = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Extbase_MVC_Controller_ControllerContext'); $controllerContext->setRequest(TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Extbase_MVC_Web_Request')); $renderer->setControllerContext($controllerContext); $renderer->setPartialRootPath(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey) . "res/partials/"); $renderer->setTemplateRootPath(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey) . "res/templates/"); $renderer->setLayoutRootPath(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey) . "res/layouts"); $renderer->setTemplatePathAndFilename($this->template); foreach ($context as $key => $value) { $renderer->assign($key, $value); } return $renderer->render(); }
/** * get extension manager configuration for ke_search_premium * and make it possible to override it with page ts setup * * @return array * @author Christian Bülter <*****@*****.**> * @since 14.10.14 */ public static function getExtConfPremium() { $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'] = '_'; } } else { $extConfPremium = array(); } // override extConfPremium with TS Setup if (is_array($GLOBALS['TSFE']->tmpl->setup['ke_search_premium.']['extconf.']['override.']) && count($GLOBALS['TSFE']->tmpl->setup['ke_search_premium.']['extconf.']['override.'])) { foreach ($GLOBALS['TSFE']->tmpl->setup['ke_search_premium.']['extconf.']['override.'] as $key => $value) { $extConfPremium[$key] = $value; } } return $extConfPremium; }
/** * Reads the [extDir]/locallang.xml and returns the \$LOCAL_LANG array found in that file. * * @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); } return $LOCAL_LANG; }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } // 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 include_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . '/Classes/Backend/class.user_filterlist.php'; TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ke_search/pageTSconfig.txt">'); 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'; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyPagesIndexEntry'][] = 'EXT:ke_search/Classes/hooks/class.user_kesearchhooks.php:user_kesearch_sortdate'; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyYACIndexEntry'][] = 'EXT:ke_search/Classes/hooks/class.user_kesearchhooks.php:user_kesearch_sortdate'; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentIndexEntry'][] = 'EXT:ke_search/Classes/hooks/class.user_kesearchhooks.php:user_kesearch_sortdate'; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyTemplaVoilaIndexEntry'][] = 'EXT:ke_search/Classes/hooks/class.user_kesearchhooks.php:user_kesearch_sortdate'; // add scheduler task $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_kesearch_indexertask'] = array('extension' => $_EXTKEY, 'title' => 'Indexing process for ke_search', 'description' => 'This task updates the ke_search index');
<?php defined('TYPO3_MODE') or die; /** @noinspection PhpUndefinedVariableInspection */ $extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]); if (TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('realurl') && (!isset($extensionConfiguration['setRealurlConfigByDefault']) || $extensionConfiguration['setRealurlConfigByDefault'] == 1)) { /** @noinspection PhpIncludeInspection */ require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/Realurl/realurl_conf.php'; } \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin('Evoweb.' . $_EXTKEY, 'Form', array('FeuserCreate' => 'form, preview, proxy, save, confirm, accept, decline, refuse, removeImage', 'FeuserEdit' => 'form, preview, proxy, save, confirm, accept, removeImage', 'FeuserPassword' => 'form, save'), array('FeuserCreate' => 'form, preview, proxy, save, confirm, accept, decline, refuse, removeImage', 'FeuserEdit' => 'form, preview, proxy, save, confirm, accept, removeImage', 'FeuserPassword' => 'form, save')); $TYPO3_CONF_VARS['FE']['eID_include']['sf_register'] = 'EXT:sf_register/Classes/Api/Ajax.php'; define('SFREGISTERCACHEIDENTIFIER', 'cache_' . $_EXTKEY . '_extending'); // Register cache sf_register $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][SFREGISTERCACHEIDENTIFIER] = array('frontend' => \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class, 'backend' => \TYPO3\CMS\Core\Cache\Backend\FileBackend::class, 'options' => array()); \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter(\Evoweb\SfRegister\Property\TypeConverter\FrontendUserConverter::class); if (TYPO3_MODE === 'FE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) { /** * Signal slot dispatcher * * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */ $signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class); $signalSlotDispatcher->connect(\Evoweb\SfRegister\Controller\FeuserController::class, 'initializeAction', \Evoweb\SfRegister\Signal\FeuserControllerSignal::class, 'initializeAction'); }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'ToggleContent'); \FluidTYPO3\Flux\Core::registerProviderExtensionKey('Wondrous.ToggleContent', 'Content');
<?php return array('ctrl' => array('label' => 'subject', 'default_sortby' => 'ORDER BY tstamp DESC', 'tstamp' => 'tstamp', 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.xlf:LGL.prependAtCopy', 'title' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail', 'delete' => 'deleted', 'iconfile' => TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('direct_mail') . 'Resources/Public/Icons/mail.gif', 'type' => 'type', 'useColumnsForDefaultValues' => 'from_email,from_name,replyto_email,replyto_name,organisation,priority,encoding,charset,sendOptions,type', 'dividers2tabs' => true), 'interface' => array('showRecordFieldList' => 'sys_language_uid,type,plainParams,HTMLParams,subject,from_name,from_email,replyto_name,replyto_email,return_path,organisation,attachment,priority,encoding,charset,sendOptions,includeMedia,flowedFormat,issent,renderedsize,use_domain,use_rdct,long_link_mode,authcode_fieldList'), 'columns' => array('sys_language_uid' => array('exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language', 'config' => array('type' => 'select', 'foreign_table' => 'sys_language', 'foreign_table_where' => 'ORDER BY sys_language.title', 'items' => array(array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1), array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)))), 'subject' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.subject', 'config' => array('type' => 'input', 'size' => '30', 'max' => '120', 'eval' => 'trim,required')), 'page' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.page', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages', 'size' => '1', 'maxitems' => 1, 'minitems' => 0, 'wizards' => array('suggest' => array('type' => 'suggest')))), 'from_email' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.from_email', 'config' => array('type' => 'input', 'size' => '30', 'max' => '80', 'eval' => 'trim,required')), 'from_name' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.from_name', 'config' => array('type' => 'input', 'size' => '30', 'eval' => 'trim', 'max' => '80')), 'replyto_email' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.replyto_email', 'config' => array('type' => 'input', 'size' => '30', 'eval' => 'trim', 'max' => '80')), 'replyto_name' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.replyto_name', 'config' => array('type' => 'input', 'size' => '30', 'eval' => 'trim', 'max' => '80')), 'return_path' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.return_path', 'config' => array('type' => 'input', 'size' => '30', 'eval' => 'trim', 'max' => '80')), 'organisation' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.organisation', 'config' => array('type' => 'input', 'size' => '30', 'eval' => 'trim', 'max' => '80')), 'encoding' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.transfer_encoding', 'config' => array('type' => 'select', 'items' => array(array('quoted-printable', 'quoted-printable'), array('base64', 'base64'), array('8bit', '8bit')), 'default' => 'quoted-printable')), 'charset' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.charset', 'config' => array('type' => 'input', 'size' => '15', 'max' => '20', 'eval' => 'trim', 'default' => 'iso-8859-1')), 'priority' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.priority', 'config' => array('type' => 'select', 'items' => array(array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.priority.I.0', '5'), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.priority.I.1', '3'), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.priority.I.2', '1')), 'default' => '3')), 'sendOptions' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.sendOptions', 'config' => array('type' => 'check', 'items' => array(array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.sendOptions.I.0', ''), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.sendOptions.I.1', '')), 'cols' => '2', 'default' => '3')), 'includeMedia' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.includeMedia', 'config' => array('type' => 'check', 'default' => '0')), 'flowedFormat' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.flowedFormat', 'config' => array('type' => 'check', 'default' => '0')), 'HTMLParams' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.HTMLParams', 'config' => array('type' => 'input', 'size' => '15', 'max' => '80', 'eval' => 'trim', 'default' => '')), 'plainParams' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.plainParams', 'config' => array('type' => 'input', 'size' => '15', 'max' => '80', 'eval' => 'trim', 'default' => '&type=99')), 'issent' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.issent', 'exclude' => '1', 'config' => array('type' => 'none', 'size' => 2)), 'scheduled' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.scheduled', 'exclude' => '1', 'config' => array('type' => 'none', 'cols' => '30', 'format' => 'datetime', 'default' => 0)), 'scheduled_begin' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.scheduled_begin', 'config' => array('type' => 'none', 'cols' => '15', 'format' => 'datetime', 'default' => 0)), 'scheduled_end' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.scheduled_end', 'config' => array('type' => 'none', 'cols' => '15', 'format' => 'datetime', 'default' => 0)), 'use_domain' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.use_domain', 'config' => array('type' => 'select', 'foreign_table' => 'sys_domain', 'items' => array(array('', 0)), 'size' => '1', 'maxitems' => 1, 'minitems' => 0)), 'use_rdct' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.use_rdct', 'config' => array('type' => 'check', 'default' => '0')), 'long_link_rdct_url' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.long_link_rdct_url', 'config' => array('type' => 'input', 'size' => '15', 'max' => '80', 'eval' => 'trim', 'default' => '')), 'long_link_mode' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.long_link_mode', 'config' => array('type' => 'check')), 'authcode_fieldList' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.authcode_fieldList', 'config' => array('type' => 'input', 'size' => '30', 'eval' => 'trim', 'max' => '80', 'default' => 'uid,name,email,password')), 'renderedsize' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.renderedsize', 'exclude' => '1', 'config' => array('type' => 'none')), 'attachment' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.attachment', 'config' => array('type' => 'group', 'internal_type' => 'file', 'allowed' => '', 'disallowed' => 'php,php3', 'max_size' => '10000', 'uploadfolder' => 'uploads/tx_directmail', 'show_thumbs' => '0', 'size' => '3', 'maxitems' => '5', 'minitems' => '0')), 'type' => array('label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.type', 'config' => array('type' => 'select', 'items' => array(array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.type.I.0', '0'), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.type.I.1', '1'), array('Draft of internal page', '2'), array('Draft of external URL', '3')), 'default' => '0'))), 'types' => array('0' => array('showitem' => ' --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab1, type;;;;1-1-1,sys_language_uid, page, plainParams, HTMLParams, use_domain, attachment, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab2, subject, --palette--;;from;;;;1-1-1, --palette--;Reply-to;reply, return_path, organisation, priority, encoding, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab3, sendOptions, includeMedia, flowedFormat, use_rdct, long_link_mode, authcode_fieldList, scheduled;;1 '), '1' => array('showitem' => ' --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab1, type;;;;1-1-1, page, plainParams;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.plainParams.ALT.1, HTMLParams;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.HTMLParams.ALT.1, attachment, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab2, subject, --palette--;;from;;;;1-1-1, --palette--;Reply-to;reply, return_path, organisation, priority, encoding, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab3, sendOptions, includeMedia, flowedFormat, use_rdct, long_link_mode, authcode_fieldList, scheduled;;1 '), '2' => array('showitem' => ' --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab1, type;;;;1-1-1,sys_language_uid, page, plainParams, HTMLParams, use_domain, attachment, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab2, subject, --palette--;;from;;;;1-1-1, --palette--;Reply-to;reply, return_path, organisation, priority, encoding, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab3, sendOptions, includeMedia, flowedFormat, use_rdct, long_link_mode, authcode_fieldList, scheduled;;1 '), '3' => array('showitem' => ' --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab1, type;;;;1-1-1, page, plainParams;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.plainParams.ALT.1, HTMLParams;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.HTMLParams.ALT.1, attachment, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab2, subject, --palette--;;from;;;;1-1-1, --palette--;Reply-to;reply, return_path, organisation, priority, encoding, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xlf:sys_dmail.tab3, sendOptions, includeMedia, flowedFormat, use_rdct, long_link_mode, authcode_fieldList, scheduled;;1 ')), 'palettes' => array('1' => array('showitem' => 'scheduled_begin, scheduled_end, issent'), 'from' => array('showitem' => 'from_email, from_name'), 'reply' => array('showitem' => 'replyto_email, replyto_name')));
<?php if (TYPO3_VERSION_INTEGER >= 6002000) { $extensionPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search'); } else { $extensionPath = t3lib_extMgm::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', 'tx_kesearch_indexer' => $extensionPath . 'Classes/indexer/class.tx_kesearch_indexer.php', 'tx_kesearch_indexer_types' => $extensionPath . 'Classes/indexer/class.tx_kesearch_indexer_types.php', 'tx_kesearch_indexer_types_file' => $extensionPath . 'Classes/indexer/types/class.tx_kesearch_indexer_types_file.php', 'tx_kesearch_indexer_types_page' => $extensionPath . 'Classes/indexer/types/class.tx_kesearch_indexer_types_page.php', 'tx_kesearch_indexer_types_templavoila' => $extensionPath . 'Classes/indexer/types/class.tx_kesearch_indexer_types_templavoila.php', 'tx_kesearch_indexer_filetypes' => $extensionPath . 'Classes/indexer/filetypes/interface.tx_kesearch_indexer_filetypes.php', 'tx_kesearch_indexer_filetypes_pdf' => $extensionPath . 'Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_pdf.php', 'tx_kesearch_indexer_filetypes_ppt' => $extensionPath . 'Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_ppt.php', 'tx_kesearch_indexer_filetypes_doc' => $extensionPath . 'Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_doc.php', 'tx_kesearch_indexer_filetypes_xls' => $extensionPath . 'Classes/indexer/filetypes/class.tx_kesearch_indexer_filetypes_xls.php', 'tx_kesearch_lib' => $extensionPath . 'Classes/lib/class.tx_kesearch_lib.php', 'tx_kesearch_lib_div' => $extensionPath . 'Classes/lib/class.tx_kesearch_lib_div.php', 'tx_kesearch_lib_fileinfo' => $extensionPath . 'Classes/lib/class.tx_kesearch_lib_fileinfo.php', 'tx_kesearch_lib_searchphrase' => $extensionPath . 'Classes/lib/class.tx_kesearch_lib_searchphrase.php', 'tx_kesearch_lib_searchresult' => $extensionPath . 'Classes/lib/class.tx_kesearch_lib_searchresult.php', 'tx_kesearch_lib_sorting' => $extensionPath . 'Classes/lib/class.tx_kesearch_lib_sorting.php', 'tx_kesearch_lib_filters_textlinks' => $extensionPath . 'Classes/lib/filters/class.tx_kesearch_lib_filters_textlinks.php', 'tx_kesearch_helper' => $extensionPath . 'Classes/lib/class.tx_kesearch_lib_helper.php', 'tx_kesearch_db' => $extensionPath . 'Classes/lib/class.tx_kesearch_db.php', 'tx_kesearch_filters' => $extensionPath . 'Classes/lib/class.tx_kesearch_filters.php');
function startIndexing($verbose = true, $extConf, $mode = '') { // write starting timestamp into registry // this is a helper to delete all records which are older than starting timestamp in registry // this also prevents starting the indexer twice if ($this->registry->get('tx_kesearch', 'startTimeOfIndexer') === null) { $this->registry->set('tx_kesearch', 'startTimeOfIndexer', time()); } else { // check lock time $lockTime = $this->registry->get('tx_kesearch', 'startTimeOfIndexer'); $compareTime = time() - 60 * 60 * 12; if ($lockTime < $compareTime) { // lock is older than 12 hours - remove $this->registry->removeAllByNamespace('tx_kesearch'); $this->registry->set('tx_kesearch', 'startTimeOfIndexer', time()); } else { return 'You can\'t start the indexer twice. Please wait while first indexer process is currently running'; } } // set indexing start time $this->startTime = time(); // get configurations $configurations = $this->getConfigurations(); // number of records that should be written to the database in one action $this->amountOfRecordsToSaveInMem = 500; // 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->registerAdditionalFields($this->additionalFields); } } // set some prepare statements $this->prepareStatements(); foreach ($configurations as $indexerConfig) { $this->indexerConfig = $indexerConfig; // 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'; } 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); } $content .= $searchObj->startIndexing(); } else { $content = '<div class="error"> Could not find file ' . $path . '</div>' . "\n"; } } // 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); } $content .= $_procObj->customIndexer($indexerConfig, $this); } } // In most cases there are some records waiting in ram to be written to db $this->storeTempRecordsToIndex('both'); } // process index cleanup $content .= $this->cleanUpIndex(); // count index records $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'tx_kesearch_index'); $content .= '<p><b>Index contains ' . $count . ' entries.</b></p>'; // clean up process after indezing to free memory $this->cleanUpProcessAfterIndexing(); // print indexing errors if (sizeof($this->indexingErrors)) { $content .= "\n\n" . '<br /><br /><br /><b>INDEXING ERRORS (' . sizeof($this->indexingErrors) . ')<br /><br />' . CHR(10); foreach ($this->indexingErrors as $error) { $content .= $error . '<br />' . CHR(10); } } // create plaintext report $plaintextReport = $this->createPlaintextReport($content); // 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']); } 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); } } } // log report to sys_log $GLOBALS['BE_USER']->simplelog($plaintextReport, 'ke_search'); // verbose or quiet output? as set in function call! if ($verbose) { return $content; } }
<?php // Static class loading require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_miscellaneous.php'; // first require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_pibase.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_tagbuilder.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_befunc.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_calendar.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_config.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_database.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_export.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_fluid.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_html.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_profiler.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_templating.php'; require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3devapi') . 'Classes/class.tx_t3devapi_validate.php';
<?php return array('ctrl' => array('label' => 'title', 'default_sortby' => 'ORDER BY title', 'tstamp' => 'tstamp', 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.xml:LGL.prependAtCopy', 'title' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group', 'delete' => 'deleted', 'iconfile' => TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('direct_mail') . 'res/gfx/mailgroup.gif', 'type' => 'type'), 'interface' => array('showRecordFieldList' => 'type,title,description'), 'columns' => array('title' => array('label' => 'LLL:EXT:lang/locallang_general.xml:LGL.title', 'config' => array('type' => 'input', 'size' => '30', 'max' => '120', 'eval' => 'trim,required')), 'description' => array('label' => 'LLL:EXT:lang/locallang_general.xml:LGL.description', 'config' => array('type' => 'text', 'cols' => '40', 'rows' => '3')), 'type' => array('label' => 'LLL:EXT:lang/locallang_general.xml:LGL.type', 'config' => array('type' => 'select', 'items' => array(array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.type.I.0', '0'), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.type.I.1', '1'), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.type.I.2', '2'), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.type.I.3', '3'), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.type.I.4', '4')), 'default' => '0')), 'static_list' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.static_list', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'tt_address,fe_users,fe_groups', 'MM' => 'sys_dmail_group_mm', 'size' => '20', 'maxitems' => '100000', 'minitems' => '0', 'show_thumbs' => '1', 'wizards' => array('suggest' => array('type' => 'suggest')))), 'pages' => array('label' => 'LLL:EXT:lang/locallang_general.xml:LGL.startingpoint', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages', 'size' => '3', 'maxitems' => '22', 'minitems' => '0', 'show_thumbs' => '1', 'wizards' => array('suggest' => array('type' => 'suggest')))), 'mail_groups' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.mail_groups', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'sys_dmail_group', 'size' => '3', 'maxitems' => '22', 'minitems' => '0', 'show_thumbs' => '1', 'wizards' => array('suggest' => array('type' => 'suggest')))), 'recursive' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.recursive', 'config' => array('type' => 'check')), 'whichtables' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.whichtables', 'config' => array('type' => 'check', 'items' => array(array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.whichtables.I.0', ''), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.whichtables.I.1', ''), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.whichtables.I.2', ''), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.whichtables.I.3', '')), 'cols' => 2, 'default' => 1)), 'list' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.list', 'config' => array('type' => 'text', 'cols' => '48', 'rows' => '10')), 'csv' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.csv', 'config' => array('type' => 'select', 'items' => array(array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.csv.I.0', '0'), array('LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.csv.I.1', '1')), 'default' => '0')), 'select_categories' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.select_categories', 'config' => array('type' => 'select', 'foreign_table' => 'sys_dmail_category', 'foreign_table_where' => 'AND sys_dmail_category.l18n_parent=0 AND sys_dmail_category.pid IN (###PAGE_TSCONFIG_IDLIST###) ORDER BY sys_dmail_category.sorting', 'itemsProcFunc' => 'DirectMailTeam\\DirectMail\\SelectCategories->get_localized_categories', 'itemsProcFunc_config' => array('table' => 'sys_dmail_category', 'indexField' => 'uid'), 'size' => 5, 'minitems' => 0, 'maxitems' => 60, 'renderMode' => 'checkbox', 'MM' => 'sys_dmail_group_category_mm')), 'query' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.query', 'config' => array('type' => 'text', 'cols' => '48', 'rows' => '10'))), 'types' => array('0' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.advanced,pages;;;;5-5-5,recursive,whichtables,select_categories'), '1' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.advanced,list;;;;5-5-5,csv'), '2' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.advanced,static_list;;;;5-5-5'), '3' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description'), '4' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description, --div--;LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_group.advanced,mail_groups;;;;5-5-5')));
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'CoderDojo pages and content elements');
/** * The main method of the PlugIn * * @param string $content: The PlugIn content * @param array $conf: The PlugIn configuration * @return The content that is displayed on the website */ function main($content, $conf) { $this->ms = TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds(); $this->conf = $conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); $this->pi_USER_INT_obj = 1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object! // initializes plugin configuration $this->init(); // init XAJAX? if ($this->conf['renderMethod'] != 'static') { $xajaxIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('xajax'); if (!$xajaxIsLoaded) { return '<span style="color: red;"><b>ke_search error:</b>"XAJAX" must be installed for this mode.</span>'; } else { $this->initXajax(); } } // 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) { $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->addInitials($this); } } // get templates $template['multiselect'] = $this->cObj->getSubpart($this->templateCode, '###SUB_FILTER_MULTISELECT###'); $template['multihidden'] = $this->cObj->getSubpart($template['multiselect'], '###SUB_FILTER_MULTISELECT_HIDDEN###'); $template['multifilter'] = $this->cObj->getSubpart($template['multiselect'], '###SUB_FILTER_MULTISELECT_FILTER###'); $template['multioption'] = $this->cObj->getSubpart($template['multifilter'], '###SUB_FILTER_MULTISELECT_OPTION###'); // get current filter $filters = $this->filters->getFilters(); foreach ($filters as $filter) { if ($filter['target_pid'] == intval($GLOBALS['TSFE']->id)) { break; } } // 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) { $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $content = $_procObj->modifyMultiselectContent($template['multiselect'], $filter, $this); } } if (is_array($filter) && count($filter)) { $contentOptions = ''; $optionsAmountArray = $GLOBALS['TSFE']->fe_user->getKey('ses', 'ke_search.tagsInSearchResults'); $countLoops = 1; if (is_array($this->piVars['filter'][$filter['uid']]) && count($this->piVars['filter'][$filter['uid']])) { $this->piVars['filter'][$filter['uid']] = array_unique($this->piVars['filter'][$filter['uid']]); } foreach ($filter['options'] as $optionKey => $option) { $option['title'] = htmlspecialchars($option['title']); $option['tag'] = htmlspecialchars($option['tag']); if ($optionsAmountArray[$option['tag']]) { $optionCounter = $optionsAmountArray[$option['tag']]; } else { $optionCounter = 0; } $selected = $this->piVars['filter'][$filter['uid']][$optionKey] ? 'checked="checked"' : ''; $markerArray['###ADDCLASS###'] = $countLoops % 3 ? '' : ' last'; $markerArray['###FILTERNAME###'] = 'tx_kesearch_pi1[filter][' . $filter['uid'] . ']'; $markerArray['###OPTIONID###'] = $option['uid']; $markerArray['###OPTIONKEY###'] = $optionKey; $markerArray['###OPTIONTITLE###'] = $option['title'] . ' (' . $optionCounter . ')'; $markerArray['###OPTIONTAG###'] = $option['tag']; $markerArray['###SELECTED###'] = $selected; $countLoops++; $contentOptions .= $this->cObj->substituteMarkerArray($template['multioption'], $markerArray); } $content .= $this->cObj->substituteSubpart($template['multifilter'], '###SUB_FILTER_MULTISELECT_OPTION###', $contentOptions); $content = $this->cObj->substituteMarker($content, '###TITLE###', $filter['title']); } $content = $this->cObj->substituteSubpart($template['multiselect'], '###SUB_FILTER_MULTISELECT_FILTER###', $content); $content = $this->cObj->substituteMarker($content, '###FORM_ACTION###', $this->pi_getPageLink($this->conf['resultPage'])); $content = $this->cObj->substituteMarker($content, '###SHOW_RESULTS###', $this->pi_getLL('show_results')); $content = $this->cObj->substituteMarker($content, '###LINK_BACK###', $this->cObj->typoLink($this->pi_getLL('back'), array('parameter' => $this->conf['resultPage'], 'addQueryString' => 1, 'addQueryString.' => array('exclude' => 'id')))); if (is_array($this->piVars['filter']) && count($this->piVars['filter'])) { foreach ($this->piVars['filter'] as $filterKey => $filterValue) { if ($filterKey == $filter['uid']) { continue; } foreach ($this->piVars['filter'][$filterKey] as $optionKey => $option) { $hidden .= $this->cObj->substituteMarker($template['multihidden'], '###NAME###', 'tx_kesearch_pi1[filter][' . $filterKey . '][' . $optionKey . ']'); $hidden = $this->cObj->substituteMarker($hidden, '###VALUE###', $option); } } } $content = $this->cObj->substituteSubpart($content, '###SUB_FILTER_MULTISELECT_HIDDEN###', $hidden); $content = $this->cObj->substituteMarker($content, '###PAGEID###', $this->conf['resultPage']); $content = $this->cObj->substituteMarker($content, '###SWORD###', htmlspecialchars($this->piVars['sword'])); return $this->pi_wrapInBaseClass($content); }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } t3lib_extMgm::addToAllTCAtypes('tt_content', 'subheader', '', 'after:header'); TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'FluidFoundationTheme - Foundation 5 based Pages and Content'); \FluidTYPO3\Flux\Core::registerProviderExtensionKey('Smedjadotcom.Fluidfoundationtheme', 'Page'); \FluidTYPO3\Flux\Core::registerProviderExtensionKey('Smedjadotcom.Fluidfoundationtheme', 'Content');
// help file 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'; $TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi2'] = 'pi_flexform'; $TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi3'] = 'pi_flexform'; // Configure FlexForm field 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::addTCAcolumns('pages', $tempColumns); TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'tx_kesearch_tags;;;;1-1-1'); if (TYPO3_MODE == 'BE') { 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'; 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'); // class for displaying the category tree for tt_news in BE forms. 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_MODE == 'BE') { $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_kesearch_pi1_wizicon'] = $extPath . 'pi1/class.tx_kesearch_pi1_wizicon.php'; $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'; }
/** * This function was called from indexer object and saves content to index table * * @return string content which will be displayed in backend */ public function startIndexing() { $tagChar = $this->pObj->extConf['prePostTagChar']; $now = strtotime('today'); // get YAC records from specified pid $fields = '*'; $table = 'tx_keyac_dates'; $where = 'pid IN (' . $this->indexerConfig['sysfolder'] . ') '; $where .= ' AND hidden=0 AND deleted=0 '; // do not index passed events? if ($this->indexerConfig['index_passed_events'] == 'no') { $keYacProductsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_yac_products'); if ($keYacProductsIsLoaded) { // special query if ke_yac_products loaded (VNR) $where .= ' AND (( tx_keyacproducts_type<>"product" AND (startdat >= "' . time() . '" OR enddat >= "' . time() . '") ) OR (tx_keyacproducts_type="product" AND tx_keyacproducts_product<>""))'; } else { // "normal" YAC events $where .= ' AND (startdat >= "' . time() . '" OR enddat >= "' . time() . '")'; } } $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where, $groupBy = '', $orderBy = '', $limit = ''); $resCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res); if ($resCount) { while ($yacRecord = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // prepare content for storing in index table $title = strip_tags($yacRecord['title']); $tags = ''; $params = '&tx_keyac_pi1[showUid]=' . intval($yacRecord['uid']); $abstract = str_replace('<br />', chr(13), $yacRecord['teaser']); $abstract = str_replace('<br>', chr(13), $abstract); $abstract = str_replace('</p>', chr(13), $abstract); $abstract = strip_tags($abstract); $content = strip_tags($yacRecord['bodytext']); $fullContent = $abstract . "\n" . $content; $targetPID = $this->indexerConfig['targetpid']; // get tags $yacRecordTags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $yacRecord['tx_keyacsearchtags_tags'], true); $tags = ''; $clearTextTags = ''; if (count($yacRecordTags)) { foreach ($yacRecordTags as $key => $tagUid) { if ($tags) { $tags .= ',' . $tagChar . $this->getTag($tagUid) . $tagChar; } else { $tags = $tagChar . $this->getTag($tagUid) . $tagChar; } $clearTextTags .= chr(13) . $this->getTag($tagUid, true); } } // add clearText Tags to content if (!empty($clearTextTags)) { $fullContent .= chr(13) . $clearTextTags; } // make it possible to modify the indexerConfig via hook $indexerConfig = $this->indexerConfig; // 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) { $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyYACIndexEntry($title, $abstract, $fullContent, $params, $tags, $yacRecord, $targetPID, $additionalFields, $indexerConfig); } } // store data in index table $this->pObj->storeInIndex($indexerConfig['storagepid'], $title, 'ke_yac', $targetPID, $fullContent, $tags, $params, $abstract, $yacRecord['sys_language_uid'], $yacRecord['starttime'], $yacRecord['endtime'], $yacRecord['fe_group'], false, $additionalFields); } } $content = '<p><b>Indexer "' . $this->indexerConfig['title'] . '": ' . $resCount . ' YAC records have been indexed.</b></p>' . "\n"; $content .= $this->showErrors(); $content .= $this->showTime(); return $content; }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sschhtml5videoplayer_domain_model_audio'); return ['ctrl' => ['title' => 'LLL:EXT:ssch_html5videoplayer/Resources/Private/Language/locallang_db.xlf:tx_sschhtml5videoplayer_domain_model_audio', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'dividers2tabs' => true, 'versioningWS' => 2, 'versioning_followPages' => true, 'origUid' => 't3_origuid', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'delete' => 'deleted', 'enablecolumns' => ['disabled' => 'hidden', 'starttime' => 'starttime', 'endtime' => 'endtime'], 'iconfile' => TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ssch_html5videoplayer') . 'Resources/Public/Icons/tx_sschhtml5videoplayer_domain_model_audio.gif'], 'interface' => ['showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, audio_source, image'], 'types' => ['1' => ['showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, title, image, description;;;richtext[paste|bold|italic|underline|formatblock|class|left|center|right|orderedlist|unorderedlist|outdent|indent|link|image]:rte_transform[mode=ts], audio_source, --div--;LLL:EXT:ssch_html5videoplayer/Resources/Private/Language/locallang_db.xlf:tx_sschhtml5videoplayer_domain_model_audio.categories, categories, --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access,starttime, endtime']], 'palettes' => ['1' => ['showitem' => '']], 'columns' => ['sys_language_uid' => ['exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language', 'config' => ['type' => 'select', 'foreign_table' => 'sys_language', 'foreign_table_where' => 'ORDER BY sys_language.title', 'items' => [['LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1], ['LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0]]]], 'l10n_parent' => ['displayCond' => 'FIELD:sys_language_uid:>:0', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent', 'config' => ['type' => 'select', 'items' => [['', 0]], 'foreign_table' => 'tx_sschhtml5videoplayer_domain_model_audio', 'foreign_table_where' => 'AND tx_sschhtml5videoplayer_domain_model_audio.pid=###CURRENT_PID### AND tx_sschhtml5videoplayer_domain_model_audio.sys_language_uid IN (-1,0)']], 'l10n_diffsource' => ['config' => ['type' => 'passthrough']], 't3ver_label' => ['label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel', 'config' => ['type' => 'input', 'size' => 30, 'max' => 255]], 'hidden' => ['exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden', 'config' => ['type' => 'check']], 'starttime' => ['exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime', 'config' => ['type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => ['lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))]]], 'endtime' => ['exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime', 'config' => ['type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => ['lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))]]], 'title' => ['exclude' => 1, 'label' => 'LLL:EXT:ssch_html5videoplayer/Resources/Private/Language/locallang_db.xlf:tx_sschhtml5videoplayer_domain_model_audio.title', 'config' => ['type' => 'input', 'size' => 30, 'eval' => 'trim,required']], 'description' => ['exclude' => 1, 'label' => 'LLL:EXT:ssch_html5videoplayer/Resources/Private/Language/locallang_db.xlf:tx_sschhtml5videoplayer_domain_model_video.description', 'config' => ['type' => 'text', 'cols' => 40, 'rows' => 15, 'wizards' => ['_PADDING' => 2, 'RTE' => ['notNewRecords' => 1, 'RTEonly' => 1, 'type' => 'script', 'title' => 'Full screen Rich Text Editing|Formatteret redigering i hele vinduet', 'icon' => 'wizard_rte2.gif', 'script' => 'wizard_rte.php']]]], 'audio_source' => ['exclude' => 1, 'label' => 'LLL:EXT:ssch_html5videoplayer/Resources/Private/Language/locallang_db.xlf:tx_sschhtml5videoplayer_domain_model_audio.audio_source', 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('$(field_name)', ['maxitems' => 1], 'mp3')], 'image' => ['exclude' => 1, 'label' => 'LLL:EXT:ssch_html5videoplayer/Resources/Private/Language/locallang_db.xlf:tx_sschhtml5videoplayer_domain_model_audio.image', 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image', ['maxitems' => 1], $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])], 'categories' => ['exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => 'LLL:EXT:ssch_html5videoplayer/Resources/Private/Language/locallang_db.xlf:tx_sschhtml5videoplayer_domain_model_audio.categories', 'config' => ['type' => 'select', 'renderMode' => 'tree', 'treeConfig' => ['parentField' => 'parent', 'appearance' => ['showHeader' => true, 'allowRecursiveMode' => true, 'expandAll' => true, 'maxLevels' => 99]], 'MM' => 'sys_category_record_mm', 'MM_match_fields' => ['fieldname' => 'categories', 'tablenames' => 'tx_sschhtml5videoplayer_domain_model_audio'], 'MM_opposite_field' => 'items', 'foreign_table' => 'sys_category', 'foreign_table_where' => ' AND (sys_category.sys_language_uid = 0 OR sys_category.l10n_parent = 0) ORDER BY sys_category.sorting', 'size' => 10, 'autoSizeMax' => 20, 'minitems' => 0, 'maxitems' => 20]]]];
/** * This function was called from indexer object and saves content to index table * * @return string content which will be displayed in backend */ public function startIndexing() { $tagChar = $this->pObj->extConf['prePostTagChar']; // get categories $categories = $this->getCategories(); // get dam records from categories $fields = 'DISTINCT tx_dam.*'; $table = 'tx_dam_mm_cat, tx_dam'; $where = '1=1'; if (is_array($categories) && count($categories)) { if ($this->indexerConfig['index_dam_without_categories']) { $table = 'tx_dam_mm_cat RIGHT JOIN tx_dam ON (tx_dam_mm_cat.uid_local = tx_dam.uid)'; $where .= ' AND uid_foreign IN (' . implode(',', $categories) . ')'; $where .= ' OR tx_dam.category = 0'; } else { $where .= ' AND tx_dam_mm_cat.uid_local = tx_dam.uid'; $where .= ' AND uid_foreign IN (' . implode(',', $categories) . ')'; } } $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); if ($resCount) { while ($damRecord = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $additionalFields = array(); // prepare content for storing in index table $title = strip_tags($damRecord['title']); $params = '&tx_dam[uid]=' . intval($damRecord['uid']); $abstract = ''; $content = strip_tags($damRecord['description']); $title = strip_tags($damRecord['title']); $keywords = strip_tags($damRecord['keywords']); $filename = strip_tags($damRecord['file_name']); $fullContent = $content . "\n" . $keywords . "\n" . $filename; $targetPID = $this->indexerConfig['targetpid']; // get tags for this record // needs extension ke_search_dam_tags $keSearchDamTagsIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search_dam_tags'); if ($keSearchDamTagsIsLoaded) { $damRecordTags = TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $damRecord['tx_kesearchdamtags_tags'], true); $tags = ''; $clearTextTags = ''; if (count($damRecordTags)) { foreach ($damRecordTags as $key => $tagUid) { if ($tags) { $tags .= ',' . $tagChar . $this->getTag($tagUid) . $tagChar; } else { $tags = $tagChar . $this->getTag($tagUid) . $tagChar; } $clearTextTags .= chr(13) . $this->getTag($tagUid, true); } } } else { $tags = ''; } // make it possible to modify the indexerConfig via hook $indexerConfig = $this->indexerConfig; // 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) { $_procObj =& TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef); $_procObj->modifyDAMIndexEntry($title, $abstract, $fullContent, $params, $tags, $damRecord, $targetPID, $clearTextTags, $additionalFields, $indexerConfig); } } // add clearText Tags to content, make them searchable // by fulltext search if (!empty($clearTextTags)) { $fullContent .= $clearTextTags; } // store data in index table $this->pObj->storeInIndex($indexerConfig['storagepid'], $title, 'dam', $indexerConfig['targetpid'], $fullContent, $tags, $params, $abstract, $damRecord['sys_language_uid'], $damRecord['starttime'], $damRecord['endtime'], $damRecord['fe_group'], false, $additionalFields); } } $content = '<p><b>Indexer "' . $this->indexerConfig['title'] . '": ' . $resCount . ' DAM records have been indexed.</b></p>' . "\n"; $content .= $this->showErrors(); $content .= $this->showTime(); return $content; }
/** * checks if there is a category assigned to the $newsRecord which has * its own single view page and if yes, returns the uid of the page * in $catagoryData['single_pid']. * It also compiles a list of all assigned categories and returns * it as an array in $categoryData['uid_list']. The titles of the * categories are returned in $categoryData['title_list'] (array) * * @author Christian Bülter <*****@*****.**> * @since 26.06.13 14:34 * @param type $newsRecord * @return int */ private function getCategoryData($newsRecord) { $categoryData = array('single_pid' => 0, 'uid_list' => array(), 'title_list' => array()); // 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'); } 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'); } $resCat = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('sys_category.uid, sys_category.single_pid, sys_category.title', 'sys_category', 'sys_category_record_mm', 'tx_news_domain_model_news', $where, '', 'sys_category_record_mm.sorting'); } 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'); } $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', 'tx_news_domain_model_news', 'tx_news_domain_model_news_category_mm', 'tx_news_domain_model_category', $where, '', 'tx_news_domain_model_news_category_mm.sorting'); } while ($newsCat = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resCat)) { $categoryData['uid_list'][] = $newsCat['uid']; $categoryData['title_list'][] = $newsCat['title']; if ($newsCat['single_pid'] && !$categoryData['single_pid']) { $categoryData['single_pid'] = $newsCat['single_pid']; } } return $categoryData; }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * generates a tree from tt_news categories. * * $Id$ * * @author Rupert Germann <*****@*****.**> * @package TYPO3 * @subpackage tt_news */ require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('tt_news') . 'lib/class.tx_ttnews_div.php'; /** * extend class t3lib_treeview to change function wrapTitle(). * */ class tx_ttnews_categorytree extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView { var $categoryCountCache = array(); var $cacheHit = false; var $expandable; /** * Will create and return the HTML code for a browsable tree * Is based on the mounts found in the internal array ->MOUNTS (set in the constructor) * * @param [type] $groupByPages: ... * @return string HTML code for the browsable tree
* * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ if (!defined('TYPO3_cliMode')) { die('You cannot run this script directly!'); } // Include basis cli class require_once TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search') . 'Classes/indexer/class.tx_kesearch_indexer.php'; class tx_kesearch_cli extends t3lib_cli { /** * Constructor */ function tx_kesearch_cli() { // Running parent class constructor parent::__construct(); // Setting help texts: $this->cli_help['name'] = 'ke_search Command Line Interface'; $this->cli_help['synopsis'] = '###OPTIONS###'; $this->cli_help['description'] = 'Start indexer for ke_search as CLI script'; $this->cli_help['examples'] = '.../cli_dispatch.phpsh ke_search startIndexing'; $this->cli_help['author'] = 'Andreas Kiefer, (c) 2010-2011';
<?php defined('TYPO3_MODE') or die; TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('dynamic', 'Configuration/TypoScript', 'Dynamic');
<?php $configurationArray = array('ctrl' => array('title' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'default_sortby' => 'ORDER BY crdate', 'delete' => 'deleted', 'enablecolumns' => array('disabled' => 'hidden'), 'iconfile' => 'EXT:ke_search/res/img/table_icons/icon_tx_kesearch_indexerconfig.gif', 'searchFields' => 'title', 'requestUpdate' => 'type'), 'interface' => array('showRecordFieldList' => 'hidden,title,storagepid,startingpoints_recursive,single_pages,sysfolder,type,index_content_with_restrictions,index_passed_events,,index_news_category_mode,index_news_category_selection,directories,fileext,filteroption'), 'columns' => array('hidden' => array('exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', 'config' => array('type' => 'check', 'default' => '0')), 'title' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.title', 'config' => array('type' => 'input', 'size' => '30')), 'storagepid' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.storagepid', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages', 'size' => 1, 'minitems' => 1, 'maxitems' => 1)), 'targetpid' => array('displayCond' => 'FIELD:type:!IN:page,tt_content,file,templavoila,comments,remote', 'exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.targetpid', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages', 'size' => 1, 'minitems' => 1, 'maxitems' => 1)), 'type' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.0', 'page', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_0.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.1', 'ke_yac', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_1.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.2', 'ttnews', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_2.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.5', 'tt_address', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_5.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.6', 'tt_content', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_6.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.7', 'file', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_7.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.8', 't3s_content', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_8.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.9', 'templavoila', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_9.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.10', 'mmforum', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_10.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.11', 'comments', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_11.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.12', 'news', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_12.gif'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.type.I.13', 'a21glossary', 'EXT:ke_search/res/img/types_backend/selicon_tx_kesearch_indexerconfig_type_13.gif')), 'itemsProcFunc' => 'tx_kesearch_lib_items->fillIndexerConfig', 'size' => 1, 'maxitems' => 1, 'default' => 'page')), 'startingpoints_recursive' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.startingpoints_recursive', 'displayCond' => 'FIELD:type:IN:page,tt_content,ttnews,tt_address,templavoila,comments,news,a21glossary', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages', 'size' => 10, 'minitems' => 0, 'maxitems' => 99)), 'single_pages' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.single_pages', 'displayCond' => 'FIELD:type:IN:page,tt_content,templavoila', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages', 'size' => 10, 'minitems' => 0, 'maxitems' => 99)), 'sysfolder' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.sysfolder', 'displayCond' => 'FIELD:type:IN:ke_yac,ttnews,tt_address,mmforum,comments,news,a21glossary', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages', 'size' => 10, 'minitems' => 0, 'maxitems' => 99)), 'index_content_with_restrictions' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_content_with_restrictions', 'displayCond' => 'FIELD:type:=:page', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_content_with_restrictions.I.0', 'yes'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_content_with_restrictions.I.1', 'no')), 'size' => 1, 'maxitems' => 1, 'default' => 'no')), 'index_passed_events' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_passed_events', 'displayCond' => 'FIELD:type:=:ke_yac', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_passed_events.I.0', 'yes'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_passed_events.I.1', 'no')), 'size' => 1, 'maxitems' => 1)), 'index_news_category_mode' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_category_mode', 'displayCond' => 'FIELD:type:IN:ttnews,news', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_category_mode.I.1', '1'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_category_mode.I.2', '2')), 'size' => 1, 'maxitems' => 1)), 'index_news_archived' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_archived', 'displayCond' => 'FIELD:type:IN:news', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_archived.I.0', '0'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_archived.I.1', '1'), array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_archived.I.2', '2')), 'size' => 1, 'maxitems' => 1)), 'index_news_category_selection' => array('exclude' => 1, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_category_selection', 'displayCond' => 'FIELD:type:=:ttnews', 'config' => array('type' => 'none')), 'index_extnews_category_selection' => array('exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => 'LLL:EXT:news/Resources/Private/Language/locallang_db.xml:tx_news_domain_model_news.categories', 'displayCond' => 'FIELD:type:=:news', 'config' => array('type' => 'none')), 'index_news_useHRDatesSingle' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_useHRDatesSingle', 'displayCond' => 'FIELD:type:=:ttnews', 'config' => array('type' => 'check', 'default' => '0')), 'index_news_useHRDatesSingleWithoutDay' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_news_useHRDatesSingleWithoutDay', 'displayCond' => 'FIELD:type:=:ttnews', 'config' => array('type' => 'check', 'default' => '0')), 'index_use_page_tags' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_use_page_tags', 'displayCond' => 'FIELD:type:IN:ttnews,tt_address,mmforum,comments,news', 'config' => array('type' => 'check', 'default' => '0')), 'directories' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.directories', 'displayCond' => 'FIELD:type:IN:file', 'config' => array('type' => 'text', 'cols' => 48, 'rows' => 10, 'eval' => 'trim')), 'fileext' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.fileext', 'displayCond' => 'FIELD:type:IN:file,page,tt_content', 'config' => array('type' => 'input', 'size' => '30', 'default' => 'pdf,ppt,doc,xls')), 'index_use_page_tags_for_files' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.index_use_page_tags_for_files', 'displayCond' => 'FIELD:type:IN:page,tt_content', 'config' => array('type' => 'check', 'default' => '0')), 'commenttypes' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.commenttypes', 'displayCond' => 'FIELD:type:=:comments', 'config' => array('type' => 'input', 'size' => '30', 'default' => 'pages')), 'filteroption' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.filteroption', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('', 0)), 'itemsProcFunc' => 'user_filterlist->getListOfAvailableFiltersForTCA', 'size' => 1, 'minitems' => 0, 'maxitems' => 1)), 'tvpath' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.tvpath', 'displayCond' => 'FIELD:type:=:templavoila', 'config' => array('type' => 'input', 'size' => '30', 'default' => 'field_content')), 'fal_storage' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.fal_storage', 'displayCond' => 'FIELD:type:=:file', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.fal_storage.dont_use_fal', -1)), 'size' => 1, 'maxitems' => 1, 'default' => -1, 'foreign_table' => 'sys_file_storage', 'allowNonIdValues' => 1)), 'contenttypes' => array('exclude' => 0, 'label' => 'LLL:EXT:ke_search/locallang_db.xml:tx_kesearch_indexerconfig.contenttypes', 'displayCond' => 'FIELD:type:IN:page,tt_content', 'config' => array('type' => 'input', 'size' => '30', 'default' => 'text,textpic,bullets,table,html,header,uploads'))), 'types' => array('0' => array('showitem' => 'hidden;;1;;1-1-1, title;;;;2-2-2, storagepid,targetpid;;;;3-3-3,type,startingpoints_recursive,single_pages,sysfolder,index_content_with_restrictions,index_passed_events,index_news_archived,index_news_category_mode,index_news_category_selection,index_extnews_category_selection,index_news_useHRDatesSingle,index_news_useHRDatesSingleWithoutDay,index_use_page_tags,fal_storage,directories,fileext,contenttypes,commenttypes,filteroption,tvpath,index_use_page_tags_for_files')), 'palettes' => array('1' => array('showitem' => ''))); // define dependencies to tt_news only if tt_news is installed if (TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news')) { $GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['index_news_category_selection']['config'] = array('type' => 'select', 'form_type' => 'user', 'userFunc' => 'tx_ttnews_TCAform_selectTree->renderCategoryFields', 'treeView' => 1, 'foreign_table' => 'tt_news_cat', 'autoSizeMax' => 50, 'minitems' => 0, 'maxitems' => 500); } // define dependencies to news only if news is installed if (TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('news')) { $configurationArray['columns']['index_extnews_category_selection']['config'] = array('type' => 'select', 'renderType' => 'selectTree', 'renderMode' => 'tree', 'treeConfig' => array('parentField' => 'parentcategory'), 'foreign_table' => 'tx_news_domain_model_category', 'foreign_table_where' => ' AND (tx_news_domain_model_category.sys_language_uid = 0 OR tx_news_domain_model_category.l10n_parent = 0) ORDER BY tx_news_domain_model_category.sorting', 'size' => 10, 'autoSizeMax' => 20, 'minitems' => 0, 'maxitems' => 20); // news version 3 features system categories instead of it's own // category system which was used in previous versions if (version_compare(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('news'), '3.0.0') >= 0) { $configurationArray['columns']['index_extnews_category_selection']['config']['treeConfig']['parentField'] = 'parent'; $configurationArray['columns']['index_extnews_category_selection']['config']['foreign_table'] = 'sys_category'; $configurationArray['columns']['index_extnews_category_selection']['config']['foreign_table_where'] = ''; } } return $configurationArray;
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } // tt_content modified $tt_content_cols = array('module_sys_dmail_category' => array('label' => 'LLL:EXT:direct_mail/Resources/Private/Language/locallang_tca.xml:sys_dmail_category.category', 'exclude' => '1', 'l10n_mode' => 'exclude', 'config' => array('type' => 'select', 'foreign_table' => 'sys_dmail_category', 'foreign_table_where' => 'AND sys_dmail_category.l18n_parent=0 AND sys_dmail_category.pid IN (###PAGE_TSCONFIG_IDLIST###) ORDER BY sys_dmail_category.sorting', 'itemsProcFunc' => 'DirectMailTeam\\DirectMail\\SelectCategories->get_localized_categories', 'itemsProcFunc_config' => array('table' => 'sys_dmail_category', 'indexField' => 'uid'), 'size' => 5, 'minitems' => 0, 'maxitems' => 60, 'renderMode' => 'checkbox', 'MM' => 'sys_dmail_ttcontent_category_mm'))); TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $tt_content_cols); TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCATypes('tt_content', 'module_sys_dmail_category;;;;1-1-1');
/** * This function was called from indexer object and saves content to index table * * @return string content which will be displayed in backend */ public function startIndexing() { $content = ''; $this->conf['useHRDatesSingle'] = $this->indexerConfig['index_news_useHRDatesSingle']; $this->conf['useHRDatesSingleWithoutDay'] = $this->indexerConfig['index_news_useHRDatesSingleWithoutDay']; // get all the tt_news entries to index // don't index hidden or deleted news, BUT // get the news with frontend user group access restrictions // or time (start / stop) restrictions. // Copy those restrictions to the index. $fields = '*'; $table = 'tt_news'; $indexPids = $this->getPidList($this->indexerConfig['startingpoints_recursive'], $this->indexerConfig['sysfolder'], $table); if ($this->indexerConfig['index_use_page_tags']) { // add the tags of each page to the global page array $this->pageRecords = $this->getPageRecords($indexPids); $this->addTagsToRecords($indexPids); } $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); } $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where); $counter = 0; if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) { while ($newsRecord = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // 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'); } $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, '', '', ''); if ($GLOBALS['TYPO3_DB']->sql_num_rows($resCat)) { $isInList = false; 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 category was not found stop further processing and loop with next news record if (!$isInList) { continue; } } } // compile the information which should go into the index $type = 'tt_news'; $title = strip_tags($newsRecord['title']); $abstract = strip_tags($newsRecord['short']); $content = strip_tags($newsRecord['bodytext']); // add keywords to content if not empty if (!empty($newsRecord['keywords'])) { $content .= "\n" . $newsRecord['keywords']; } // create content $fullContent = $abstract . "\n" . $content; // create params and custom single view page: // if it is a default news (type = 0), add params // if it is an internal page (type = 1), put that into the "targetpid" field // if it is an external url (type = 2), put that into the "params" field if ($newsRecord['type'] == 1) { $singleViewPage = $newsRecord['page']; $params = ''; } else { if ($newsRecord['type'] == 2) { $type = 'external:tt_news'; $singleViewPage = ''; $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'); } if ($ttnewsIsLoaded) { $singleViewPage = $this->getSingleViewPageFromCategories($newsRecord['uid']); } $paramsSingleView = $this->getParamsForHrDateSingleView($newsRecord['datetime']); $paramsSingleView['tx_ttnews']['tt_news'] = $newsRecord['uid']; $params = '&' . http_build_query($paramsSingleView, NULL, '&'); $params = rawurldecode($params); } } // create tags if ($this->indexerConfig['index_use_page_tags']) { $tags = $this->pageRecords[intval($newsRecord['pid'])]['tags']; } else { $tags = ''; } // add additional fields $additionalFields = array(); // crdate is always given, but can be overwritten $additionalFields['sortdate'] = $newsRecord['crdate']; // last changed date if (isset($newsRecord['datetime']) && $newsRecord['datetime'] > 0) { $additionalFields['sortdate'] = $newsRecord['datetime']; } // fill orig_uid and orig_pid $additionalFields['orig_uid'] = $newsRecord['uid']; $additionalFields['orig_pid'] = $newsRecord['pid']; // make it possible to modify the indexerConfig via hook $indexerConfig = $this->indexerConfig; // overwrite default targetpid value from indexerconfig // only if $singleViewPage is set if ($singleViewPage) { $indexerConfig['targetpid'] = $singleViewPage; } // 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->modifyNewsIndexEntry($title, $abstract, $fullContent, $params, $tags, $newsRecord, $additionalFields, $indexerConfig); } } // ... and store them $this->pObj->storeInIndex($indexerConfig['storagepid'], $title, $type, $indexerConfig['targetpid'], $fullContent, $tags, $params, $abstract, $newsRecord['sys_language_uid'], $newsRecord['starttime'], $newsRecord['endtime'], $newsRecord['fe_group'], false, $additionalFields); $counter++; } $content = '<p><b>Indexer "' . $this->indexerConfig['title'] . '":</b><br />' . "\n" . $counter . ' news have been indexed.</p>' . "\n"; $content .= $this->showErrors(); $content .= $this->showTime(); } return $content; }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin('Winkel.' . $_EXTKEY, 'Pi1', 'Winkel TradeShow'); $pluginSignature = str_replace('_', '', $_EXTKEY) . '_' . pi1; $TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_' . pi1 . '.xml'); TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Winkel Trade Show'); TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_winkeltradeshow_domain_model_tradeshow', 'EXT:winkel_tradeshow/Resources/Private/Language/locallang_csh_tx_winkeltradeshow_domain_model_tradeshow.xlf'); TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_winkeltradeshow_domain_model_tradeshow'); $TCA['tx_winkeltradeshow_domain_model_tradeshow'] = array('ctrl' => array('title' => 'LLL:EXT:winkel_tradeshow/Resources/Private/Language/locallang_db.xlf:tx_winkeltradeshow_domain_model_tradeshow', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'dividers2tabs' => TRUE, 'sortby' => 'sorting', 'versioningWS' => 2, 'versioning_followPages' => TRUE, 'origUid' => 't3_origuid', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'delete' => 'deleted', 'enablecolumns' => array('disabled' => 'hidden', 'starttime' => 'starttime', 'endtime' => 'endtime'), 'searchFields' => 'title,start_trade_show,end_trade_show,continent_trade_show,country_trade_show,city_trade_show,logo_trade_show,address_trade_show,url_trade_show,contact_trade_show,description_trade_show,google_coordinates,', 'dynamicConfigFile' => TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/TradeShow.php', 'iconfile' => TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/tx_winkeltradeshow_domain_model_tradeshow.gif'));