本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::setUpdateSignal方法的具体用法?PHP BackendUtility::setUpdateSignal怎么用?PHP BackendUtility::setUpdateSignal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Utility\BackendUtility
的用法示例。
在下文中一共展示了BackendUtility::setUpdateSignal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
/**
* Renders the review module user dependent with all workspaces.
* The module will show all records of one workspace.
*
* @return void
*/
public function indexAction()
{
$wsService = GeneralUtility::makeInstance(\TYPO3\CMS\Workspaces\Service\WorkspaceService::class);
$this->view->assign('showGrid', !($GLOBALS['BE_USER']->workspace === 0 && !$GLOBALS['BE_USER']->isAdmin()));
$this->view->assign('showAllWorkspaceTab', TRUE);
$this->view->assign('pageUid', GeneralUtility::_GP('id'));
if (GeneralUtility::_GP('id')) {
$pageRecord = BackendUtility::getRecord('pages', GeneralUtility::_GP('id'));
$this->view->assign('pageTitle', BackendUtility::getRecordTitle('pages', $pageRecord));
}
$this->view->assign('showLegend', !($GLOBALS['BE_USER']->workspace === 0 && !$GLOBALS['BE_USER']->isAdmin()));
$wsList = $wsService->getAvailableWorkspaces();
$activeWorkspace = $GLOBALS['BE_USER']->workspace;
$performWorkspaceSwitch = FALSE;
// Only admins see multiple tabs, we decided to use it this
// way for usability reasons. Regular users might be confused
// by switching workspaces with the tabs in a module.
if (!$GLOBALS['BE_USER']->isAdmin()) {
$wsCur = array($activeWorkspace => TRUE);
$wsList = array_intersect_key($wsList, $wsCur);
} else {
if ((string) GeneralUtility::_GP('workspace') !== '') {
$switchWs = (int) GeneralUtility::_GP('workspace');
if (in_array($switchWs, array_keys($wsList)) && $activeWorkspace != $switchWs) {
$activeWorkspace = $switchWs;
$GLOBALS['BE_USER']->setWorkspace($activeWorkspace);
$performWorkspaceSwitch = TRUE;
BackendUtility::setUpdateSignal('updatePageTree');
} elseif ($switchWs == WorkspaceService::SELECT_ALL_WORKSPACES) {
$this->redirect('fullIndex');
}
}
}
$this->pageRenderer->addInlineSetting('Workspaces', 'isLiveWorkspace', (int) $GLOBALS['BE_USER']->workspace === 0 ? TRUE : FALSE);
$this->pageRenderer->addInlineSetting('Workspaces', 'workspaceTabs', $this->prepareWorkspaceTabs($wsList, $activeWorkspace));
$this->pageRenderer->addInlineSetting('Workspaces', 'activeWorkspaceId', $activeWorkspace);
$this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', BackendUtility::getModuleUrl('record_edit'));
$this->view->assign('performWorkspaceSwitch', $performWorkspaceSwitch);
$this->view->assign('workspaceList', $wsList);
$this->view->assign('activeWorkspaceUid', $activeWorkspace);
$this->view->assign('activeWorkspaceTitle', WorkspaceService::getWorkspaceTitle($activeWorkspace));
$this->view->assign('showPreviewLink', $wsService->canCreatePreviewLink(GeneralUtility::_GP('id'), $activeWorkspace));
$GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', $activeWorkspace);
}
示例2: render
/**
* Crafts a link to edit a database record or create a new one
*
* @param integer $pageId
* @param string $returnUrl URL to return to
* @param string $action
* @param string $controller
* @return string The <a> tag
* @see \TYPO3\CMS\Backend\Utility::editOnClick()
*/
public function render($pageId, $returnUrl = '', $action = null, $controller = null)
{
if ($returnUrl == '') {
$returnUrl = 'index.php?M=web_CadabraProductadministration&id=' . (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('id') . '&moduleToken=' . \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get()->generateToken('moduleCall', 'web_CadabraProductadministration');
}
$params = array('id' => $pageId, 'returnUrl' => $returnUrl);
if ($action) {
$params['tx_cadabra_web_cadabraproductadministration[action]'] = $action;
}
if ($controller) {
$params['tx_cadabra_web_cadabraproductadministration[controller]'] = $controller;
}
\TYPO3\CMS\Backend\Utility\BackendUtility::openPageTree((int) $pageId, false);
\TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updatePageTree');
$uri = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_CadabraProductadministration', $params);
$this->tag->addAttribute('href', $uri);
$this->tag->setContent($this->renderChildren());
$this->tag->forceClosingTag(true);
return $this->tag->render();
}
示例3: commitCommand
/**
* Commits the given command.
*
* @param int $uidClip Uid of clipboard item
* @param int $uidTarget Uid of target
* @param string $command Command
*/
protected function commitCommand($uidClip, $uidTarget, $command)
{
// First prepare user defined hooks
$hooks = \CommerceTeam\Commerce\Factory\HookFactory::getHooks('Utility/DataHandlerUtility', 'commitCommand');
// Hook: beforeCommit
foreach ($hooks as $hookObj) {
if (method_exists($hookObj, 'beforeCommit')) {
$hookObj->beforeCommit($uidClip, $uidTarget, $command);
}
}
// we got all info we need - commit command
switch ($command) {
case 'overwrite':
BackendUtility::overwriteProduct($uidClip, $uidTarget, $this->locales);
break;
case 'pasteProduct':
BackendUtility::copyProduct($uidClip, $uidTarget, false, $this->locales, $this->sorting);
break;
case 'pasteCategory':
BackendUtility::copyCategory($uidClip, $uidTarget, $this->locales, $this->sorting);
break;
default:
die('unknown command');
}
// Hook: afterCommit
foreach ($hooks as $hookObj) {
if (method_exists($hookObj, 'afterCommit')) {
$hookObj->afterCommit($uidClip, $uidTarget, $command);
}
}
// Update page tree?
if ($this->uPT && (isset($this->data['tx_commerce_categories']) || isset($this->cmd['tx_commerce_categories'])) && (isset($this->data['tx_commerce_products']) || isset($this->cmd['tx_commerce_products']))) {
\TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updateFolderTree');
}
}
示例4: main
/**
* Main function creating the content for the module.
*
* @return string HTML content for the module, actually a "section" made through the parent object in $this->pObj
*/
public function main()
{
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->getLanguageService()->includeLLFile('EXT:wizard_crpages/Resources/Private/Language/locallang.xlf');
$theCode = '';
$this->tsConfig = BackendUtility::getPagesTSconfig($this->pObj->id);
$this->pagesTsConfig = isset($this->tsConfig['TCEFORM.']['pages.']) ? $this->tsConfig['TCEFORM.']['pages.'] : array();
// Create new pages here?
$pageRecord = BackendUtility::getRecord('pages', $this->pObj->id, 'uid', ' AND ' . $this->getBackendUser()->getPagePermsClause(8));
$pageRepository = GeneralUtility::makeInstance(PageRepository::class);
$menuItems = $pageRepository->getMenu($this->pObj->id, '*', 'sorting', '', false);
if (is_array($pageRecord)) {
$data = GeneralUtility::_GP('data');
if (is_array($data['pages'])) {
if (GeneralUtility::_GP('createInListEnd')) {
$endI = end($menuItems);
$thePid = -(int) $endI['uid'];
if (!$thePid) {
$thePid = $this->pObj->id;
}
} else {
$thePid = $this->pObj->id;
}
$firstRecord = true;
$previousIdentifier = '';
foreach ($data['pages'] as $identifier => $dat) {
if (!trim($dat['title'])) {
unset($data['pages'][$identifier]);
} else {
$data['pages'][$identifier]['hidden'] = GeneralUtility::_GP('hidePages') ? 1 : 0;
$data['pages'][$identifier]['nav_hide'] = GeneralUtility::_GP('hidePagesInMenus') ? 1 : 0;
if ($firstRecord) {
$firstRecord = false;
$data['pages'][$identifier]['pid'] = $thePid;
} else {
$data['pages'][$identifier]['pid'] = '-' . $previousIdentifier;
}
$previousIdentifier = $identifier;
}
}
if (!empty($data['pages'])) {
reset($data);
$dataHandler = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$dataHandler->stripslashes_values = 0;
// set default TCA values specific for the user
$TCAdefaultOverride = $this->getBackendUser()->getTSConfigProp('TCAdefaults');
if (is_array($TCAdefaultOverride)) {
$dataHandler->setDefaultsFromUserTS($TCAdefaultOverride);
}
$dataHandler->start($data, array());
$dataHandler->process_datamap();
BackendUtility::setUpdateSignal('updatePageTree');
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, '', $this->getLanguageService()->getLL('wiz_newPages_create'));
} else {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, '', $this->getLanguageService()->getLL('wiz_newPages_noCreate'), FlashMessage::ERROR);
}
$theCode .= $flashMessage->render();
// Display result:
$menuItems = $pageRepository->getMenu($this->pObj->id, '*', 'sorting', '', false);
$lines = array();
foreach ($menuItems as $record) {
BackendUtility::workspaceOL('pages', $record);
if (is_array($record)) {
$lines[] = '<span class="text-nowrap" title="' . BackendUtility::titleAttribForPages($record, '', false) . '">' . $this->iconFactory->getIconForRecord('pages', $record, Icon::SIZE_SMALL)->render() . htmlspecialchars(GeneralUtility::fixed_lgd_cs($record['title'], $this->getBackendUser()->uc['titleLen'])) . '</span>';
}
}
$theCode .= '<h4>' . $this->getLanguageService()->getLL('wiz_newPages_currentMenu') . '</h4>' . implode('<br />', $lines);
} else {
// Display create form
$this->typeSelectHtml = $this->getTypeSelectHtml();
$tableData = array();
for ($a = 0; $a < 5; $a++) {
$tableData[] = $this->getFormLine($a);
}
$theCode .= '
<h4>' . $this->getLanguageService()->getLL('wiz_newPages') . ':</h4>
<div class="form-group t3js-wizardcrpages-container">
' . implode(LF, $tableData) . '
</div>
<div class="form-group">
<input class="btn btn-default t3js-wizardcrpages-createnewfields" type="button" value="' . $this->getLanguageService()->getLL('wiz_newPages_addMoreLines') . '" />
</div>
<div class="form-group">
<div class="checkbox">
<label for="createInListEnd">
<input type="checkbox" name="createInListEnd" id="createInListEnd" value="1" />
' . $this->getLanguageService()->getLL('wiz_newPages_listEnd') . '
</label>
</div>
<div class="checkbox">
<label for="hidePages">
<input type="checkbox" name="hidePages" id="hidePages" value="1" />
' . $this->getLanguageService()->getLL('wiz_newPages_hidePages') . '
</label>
</div>
//.........这里部分代码省略.........
示例5: indexAction
/**
* Basically makes sure that the workspace preview is rendered.
* The preview itself consists of three frames, so there are
* only the frames-urls we've to generate here
*
* @param integer $previewWS
* @return void
*/
public function indexAction($previewWS = NULL)
{
// Get all the GET parameters to pass them on to the frames
$queryParameters = GeneralUtility::_GET();
// Remove the GET parameters related to the workspaces module and the page id
unset($queryParameters['tx_workspaces_web_workspacesworkspaces']);
unset($queryParameters['M']);
unset($queryParameters['id']);
// Assemble a query string from the retrieved parameters
$queryString = GeneralUtility::implodeArrayForUrl('', $queryParameters);
// fetch the next and previous stage
$workspaceItemsArray = $this->workspaceService->selectVersionsInWorkspace($this->stageService->getWorkspaceId(), $filter = 1, $stage = -99, $this->pageId, $recursionLevel = 0, $selectionType = 'tables_modify');
list(, $nextStage) = $this->stageService->getNextStageForElementCollection($workspaceItemsArray);
list(, $previousStage) = $this->stageService->getPreviousStageForElementCollection($workspaceItemsArray);
/** @var $wsService \TYPO3\CMS\Workspaces\Service\WorkspaceService */
$wsService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
$wsList = $wsService->getAvailableWorkspaces();
$activeWorkspace = $GLOBALS['BE_USER']->workspace;
if (!is_null($previewWS)) {
if (in_array($previewWS, array_keys($wsList)) && $activeWorkspace != $previewWS) {
$activeWorkspace = $previewWS;
$GLOBALS['BE_USER']->setWorkspace($activeWorkspace);
BackendUtility::setUpdateSignal('updatePageTree');
}
}
/** @var $uriBuilder \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder */
$uriBuilder = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
$wsSettingsPath = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
$wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), 'TYPO3\\CMS\\Workspaces\\Controller\\ReviewController', 'workspaces', 'web_workspacesworkspaces');
$wsSettingsParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Review';
$wsSettingsUrl = $wsSettingsPath . $wsSettingsUri . $wsSettingsParams;
$viewDomain = BackendUtility::getViewDomain($this->pageId);
$wsBaseUrl = $viewDomain . '/index.php?id=' . $this->pageId . $queryString;
// @todo - handle new pages here
// branchpoints are not handled anymore because this feature is not supposed anymore
if (\TYPO3\CMS\Workspaces\Service\WorkspaceService::isNewPage($this->pageId)) {
$wsNewPageUri = $uriBuilder->uriFor('newPage', array(), 'TYPO3\\CMS\\Workspaces\\Controller\\PreviewController', 'workspaces', 'web_workspacesworkspaces');
$wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
$this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams);
} else {
$this->view->assign('liveUrl', $wsBaseUrl . '&ADMCMD_noBeUser=1');
}
$this->view->assign('wsUrl', $wsBaseUrl . '&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' . $GLOBALS['BE_USER']->workspace);
$this->view->assign('wsSettingsUrl', $wsSettingsUrl);
$this->view->assign('backendDomain', GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
$splitPreviewTsConfig = BackendUtility::getModTSconfig($this->pageId, 'workspaces.splitPreviewModes');
$splitPreviewModes = GeneralUtility::trimExplode(',', $splitPreviewTsConfig['value']);
$allPreviewModes = array('slider', 'vbox', 'hbox');
if (!array_intersect($splitPreviewModes, $allPreviewModes)) {
$splitPreviewModes = $allPreviewModes;
}
$this->pageRenderer->addInlineSetting('Workspaces', 'SplitPreviewModes', $splitPreviewModes);
$GLOBALS['BE_USER']->setAndSaveSessionData('workspaces.backend_domain', GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
$this->pageRenderer->addInlineSetting('Workspaces', 'disableNextStageButton', $this->isInvalidStage($nextStage));
$this->pageRenderer->addInlineSetting('Workspaces', 'disablePreviousStageButton', $this->isInvalidStage($previousStage));
$this->pageRenderer->addInlineSetting('Workspaces', 'disableDiscardStageButton', $this->isInvalidStage($nextStage) && $this->isInvalidStage($previousStage));
$resourcePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('lang') . 'Resources/Public/JavaScript/';
$this->pageRenderer->addJsFile($resourcePath . 'Typo3Lang.js');
$this->pageRenderer->addJsInlineCode('workspaces.preview.lll', '
TYPO3.lang = {
visualPreview: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.visualPreview', TRUE)) . ',
listView: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.listView', TRUE)) . ',
livePreview: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.livePreview', TRUE)) . ',
livePreviewDetail: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.livePreviewDetail', TRUE)) . ',
workspacePreview: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreview', TRUE)) . ',
workspacePreviewDetail: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreviewDetail', TRUE)) . ',
modeSlider: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeSlider', TRUE)) . ',
modeVbox: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeVbox', TRUE)) . ',
modeHbox: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeHbox', TRUE)) . ',
discard: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:label_doaction_discard', TRUE)) . ',
nextStage: ' . Utility\GeneralUtility::quoteJSvalue($nextStage['title']) . ',
previousStage: ' . Utility\GeneralUtility::quoteJSvalue($previousStage['title']) . '
};TYPO3.l10n.initialize();
');
$resourcePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/';
$this->pageRenderer->addJsFile($resourcePath . 'JavaScript/preview.js');
}
示例6: finish
/**
* Redirecting the user after the processing has been done.
* Might also display error messages directly, if any.
*
* @return void
*/
public function finish()
{
// Prints errors, if there are any
$this->fileProcessor->printLogErrorMessages($this->redirect);
\TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updateFolderTree');
if ($this->redirect) {
\TYPO3\CMS\Core\Utility\HttpUtility::redirect($this->redirect);
}
}
示例7: main
/**
* Main function creating the content for the module.
*
* @return string HTML content for the module, actually a "section" made through the parent object in $this->pObj
*/
public function main()
{
$lang = $this->getLanguageService();
$lang->includeLLFile('EXT:wizard_sortpages/Resources/Private/Language/locallang.xlf');
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
$out = '<h1>' . htmlspecialchars($lang->getLL('wiz_sort')) . '</h1>';
if ($this->getBackendUser()->workspace === 0) {
$theCode = '';
// Check if user has modify permissions to
$sys_pages = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\PageRepository::class);
$sortByField = GeneralUtility::_GP('sortByField');
if ($sortByField) {
$menuItems = array();
if ($sortByField === 'title' || $sortByField === 'subtitle' || $sortByField === 'crdate' || $sortByField === 'tstamp') {
$menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', $sortByField, '', false);
} elseif ($sortByField === 'REV') {
$menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', 'sorting', '', false);
$menuItems = array_reverse($menuItems);
}
if (!empty($menuItems)) {
$tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$menuItems = array_reverse($menuItems);
$cmd = array();
foreach ($menuItems as $r) {
$cmd['pages'][$r['uid']]['move'] = $this->pObj->id;
}
$tce->start(array(), $cmd);
$tce->process_cmdmap();
BackendUtility::setUpdateSignal('updatePageTree');
}
}
$menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', false);
if (!empty($menuItems)) {
$lines = array();
$lines[] = '<thead><tr>';
$lines[] = '<th>' . $lang->getLL('wiz_changeOrder_title') . '</th>';
$lines[] = '<th>' . $lang->getLL('wiz_changeOrder_subtitle') . '</th>';
$lines[] = '<th>' . $lang->getLL('wiz_changeOrder_tChange') . '</th>';
$lines[] = '<th>' . $lang->getLL('wiz_changeOrder_tCreate') . '</th>';
$lines[] = '</tr></thead>';
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
foreach ($menuItems as $rec) {
$m_perms_clause = $this->getBackendUser()->getPagePermsClause(2);
// edit permissions for that page!
$pRec = BackendUtility::getRecord('pages', $rec['uid'], 'uid', ' AND ' . $m_perms_clause);
$lines[] = '<tr><td nowrap="nowrap">' . $iconFactory->getIconForRecord('pages', $rec, Icon::SIZE_SMALL)->render() . (!is_array($pRec) ? '<strong class="text-danger">' . $lang->getLL('wiz_W', true) . '</strong></span> ' : '') . htmlspecialchars(GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</td>
<td nowrap="nowrap">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($rec['subtitle'], $this->getBackendUser()->uc['titleLen'])) . '</td>
<td nowrap="nowrap">' . BackendUtility::datetime($rec['tstamp']) . '</td>
<td nowrap="nowrap">' . BackendUtility::datetime($rec['crdate']) . '</td>
</tr>';
}
$theCode .= '<h2>' . $lang->getLL('wiz_currentPageOrder', true) . '</h2>';
$theCode .= '<div class="table-fit"><table class="table table-striped table-hover">' . implode('', $lines) . '</table></div>';
// Menu:
$lines = array();
$lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_title'), 'title');
$lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_subtitle'), 'subtitle');
$lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_tChange'), 'tstamp');
$lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_tCreate'), 'crdate');
$lines[] = '';
$lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_REVERSE'), 'REV');
$theCode .= '<h4>' . $lang->getLL('wiz_changeOrder') . '</h4><p>' . implode(' ', $lines) . '</p>';
} else {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('no_subpages'), '', FlashMessage::NOTICE);
/** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
/** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
}
// CSH:
$theCode .= BackendUtility::cshItem('_MOD_web_func', 'tx_wizardsortpages', null, '<span class="btn btn-default btn-sm">|</span>');
$out .= '<div>' . $theCode . '</div>';
} else {
$out .= '<div>Sorry, this function is not available in the current draft workspace!</div>';
}
return $out;
}
示例8: closeDocument
/**
* Handling the closing of a document
*
* @param int $code Close code: 0/1 will redirect to $this->retUrl, 3 will clear the docHandler (thus closing all
* documents) and other values will call setDocument with ->retUrl
* @return void
*/
public function closeDocument($code = 0)
{
// If current document is found in docHandler,
// then unset it, possibly unset it ALL and finally, write it to the session data
if (isset($this->docHandler[$this->storeUrlMd5])) {
// add the closing document to the recent documents
$recentDocs = $this->getBackendUser()->getModuleData('opendocs::recent');
if (!is_array($recentDocs)) {
$recentDocs = array();
}
$closedDoc = $this->docHandler[$this->storeUrlMd5];
$recentDocs = array_merge(array($this->storeUrlMd5 => $closedDoc), $recentDocs);
if (count($recentDocs) > 8) {
$recentDocs = array_slice($recentDocs, 0, 8);
}
// remove it from the list of the open documents
unset($this->docHandler[$this->storeUrlMd5]);
if ($code == '3') {
$recentDocs = array_merge($this->docHandler, $recentDocs);
$this->docHandler = array();
}
$this->getBackendUser()->pushModuleData('opendocs::recent', $recentDocs);
$this->getBackendUser()->pushModuleData('FormEngine', array($this->docHandler, $this->docDat[1]));
BackendUtility::setUpdateSignal('OpendocsController::updateNumber', count($this->docHandler));
}
// If ->returnEditConf is set, then add the current content of editconf to the ->retUrl variable: (used by
// other scripts, like wizard_add, to know which records was created or so...)
if ($this->returnEditConf && $this->retUrl != BackendUtility::getModuleUrl('dummy')) {
$this->retUrl .= '&returnEditConf=' . rawurlencode(json_encode($this->editconf));
}
// If code is NOT set OR set to 1, then make a header location redirect to $this->retUrl
if (!$code || $code == 1) {
HttpUtility::redirect($this->retUrl);
} else {
$this->setDocument('', $this->retUrl);
}
}
示例9: main
/**
* Main function creating the content for the module.
*
* @return string HTML content for the module, actually a "section" made through the parent object in $this->pObj
* @todo Define visibility
*/
public function main()
{
global $SOBE, $LANG;
$out = $this->pObj->doc->header($LANG->getLL('wiz_sort'));
if ($GLOBALS['BE_USER']->workspace === 0) {
$theCode = '';
// Check if user has modify permissions to
$sys_pages = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
$sortByField = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('sortByField');
if ($sortByField) {
$menuItems = array();
if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('title,subtitle,crdate,tstamp', $sortByField)) {
$menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', $sortByField, '', 0);
} elseif ($sortByField == 'REV') {
$menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', 'sorting', '', 0);
$menuItems = array_reverse($menuItems);
}
if (count($menuItems)) {
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandler\\DataHandler');
$tce->stripslashes_values = 0;
$menuItems = array_reverse($menuItems);
$cmd = array();
foreach ($menuItems as $r) {
$cmd['pages'][$r['uid']]['move'] = $this->pObj->id;
}
$tce->start(array(), $cmd);
$tce->process_cmdmap();
\TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updatePageTree');
}
}
$menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
$lines = array();
$lines[] = '<tr class="t3-row-header">
<td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_title'), 'title') . '</td>
' . (\TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('cms') ? '<td> ' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</td>' : '') . '
<td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tChange'), 'tstamp') . '</td>
<td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tCreate'), 'crdate') . '</td>
</tr>';
foreach ($menuItems as $rec) {
$m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(2);
// edit permissions for that page!
$pRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $rec['uid'], 'uid', ' AND ' . $m_perms_clause);
$lines[] = '<tr><td nowrap="nowrap">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec) . (!is_array($pRec) ? $GLOBALS['TBE_TEMPLATE']->rfw('<strong>' . $LANG->getLL('wiz_W', 1) . '</strong> ') : '') . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . ' </td>
' . (\TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('cms') ? '<td nowrap="nowrap">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['subtitle'], $GLOBALS['BE_USER']->uc['titleLen'])) . ' </td>' : '') . '
<td nowrap="nowrap">' . \t3lib_Befunc::datetime($rec['tstamp']) . ' </td>
<td nowrap="nowrap">' . \t3lib_Befunc::datetime($rec['crdate']) . ' </td>
</tr>';
}
$theCode .= '<h4>' . $LANG->getLL('wiz_currentPageOrder', TRUE) . '</h4>
<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">' . implode('', $lines) . '</table><br />';
if (count($menuItems)) {
// Menu:
$lines = array();
$lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_title'), 'title');
if (\TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('cms')) {
$lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_subtitle'), 'subtitle');
}
$lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tChange'), 'tstamp');
$lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tCreate'), 'crdate');
$lines[] = '';
$lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_REVERSE'), 'REV');
$theCode .= '<h4>' . $LANG->getLL('wiz_changeOrder') . '</h4>' . implode('<br />', $lines);
}
// CSH:
$theCode .= \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_web_func', 'tx_wizardsortpages', $GLOBALS['BACK_PATH'], '<br />|');
$out .= $this->pObj->doc->section('', $theCode, 0, 1);
} else {
$out .= $this->pObj->doc->section('', 'Sorry, this function is not available in the current draft workspace!', 0, 1, 1);
}
return $out;
}
示例10: main
/**
* Generate the main settings form:
*
* @return void
*/
public function main()
{
if ($this->languageUpdate) {
$this->doc->JScodeArray['languageUpdate'] .= '
if (top.refreshMenu) {
top.refreshMenu();
} else {
top.TYPO3ModuleMenu.refreshMenu();
}
';
}
if ($this->pagetreeNeedsRefresh) {
BackendUtility::setUpdateSignal('updatePageTree');
}
// Start page:
$this->doc->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/md5.js');
// Use a wrapper div
$this->content .= '<div id="user-setup-wrapper">';
// Load available backend modules
$this->loadModules = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Module\ModuleLoader::class);
$this->loadModules->observeWorkspaces = TRUE;
$this->loadModules->load($GLOBALS['TBE_MODULES']);
$this->content .= $this->doc->header($this->getLanguageService()->getLL('UserSettings'));
// Show if setup was saved
if ($this->setupIsUpdated && !$this->tempDataIsCleared && !$this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('setupWasUpdated'), $this->getLanguageService()->getLL('UserSettings'));
$this->content .= $flashMessage->render();
}
// Show if temporary data was cleared
if ($this->tempDataIsCleared) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('tempDataClearedFlashMessage'), $this->getLanguageService()->getLL('tempDataCleared'));
$this->content .= $flashMessage->render();
}
// Show if temporary data was cleared
if ($this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('settingsAreReset'), $this->getLanguageService()->getLL('resetConfiguration'));
$this->content .= $flashMessage->render();
}
// Notice
if ($this->setupIsUpdated || $this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('activateChanges'), '', FlashMessage::INFO);
$this->content .= $flashMessage->render();
}
// If password is updated, output whether it failed or was OK.
if ($this->passwordIsSubmitted) {
$flashMessage = NULL;
switch ($this->passwordIsUpdated) {
case self::PASSWORD_OLD_WRONG:
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('oldPassword_failed'), $this->getLanguageService()->getLL('newPassword'), FlashMessage::ERROR);
break;
case self::PASSWORD_NOT_THE_SAME:
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('newPassword_failed'), $this->getLanguageService()->getLL('newPassword'), FlashMessage::ERROR);
break;
case self::PASSWORD_UPDATED:
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('newPassword_ok'), $this->getLanguageService()->getLL('newPassword'));
break;
}
if ($flashMessage) {
$this->content .= $flashMessage->render();
}
}
// Render user switch
$this->content .= $this->renderSimulateUserSelectAndLabel();
// Render the menu items
$menuItems = $this->renderUserSetup();
$this->content .= $this->doc->getDynamicTabMenu($menuItems, 'user-setup', 1, FALSE, FALSE);
$formToken = $this->formProtection->generateToken('BE user setup', 'edit');
$this->content .= $this->doc->section('', '<input type="hidden" name="simUser" value="' . $this->simUser . '" />
<input type="hidden" name="formToken" value="' . $formToken . '" />
<input type="hidden" value="1" name="data[save]" />
<input type="hidden" name="data[setValuesToDefault]" value="0" id="setValuesToDefault" />
<input type="hidden" name="data[clearSessionVars]" value="0" id="clearSessionVars" />');
// End of wrapper div
$this->content .= '</div>';
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers['CSH'] = $docHeaderButtons['csh'];
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
// Renders the module page
$this->content = $this->doc->render($this->getLanguageService()->getLL('UserSettings'), $this->content);
}
示例11: commitCommand
/**
* Commits the given command
*
* @param int $uidClip Uid of clipboard item
* @param int $uidTarget Uid of target
* @param string $command Command
*
* @return void
*/
protected function commitCommand($uidClip, $uidTarget, $command)
{
// First prepare user defined objects (if any)
// for hooks which extend this function:
$hookObjectsArr = array();
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/mod_cce/class.tx_commerce_cce_db.php']['commitCommandClass'])) {
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('
hook
$GLOBALS[\'TYPO3_CONF_VARS\'][\'EXTCONF\'][\'commerce/mod_cce/class.tx_commerce_cce_db.php\'][\'storeDataToDatabase\']
is deprecated since commerce 1.0.0, it will be removed in commerce 1.4.0, please use instead
$GLOBALS[\'TYPO3_CONF_VARS\'][\'EXTCONF\'][\'commerce/Classes/Utility/DataHandlerUtility.php\'][\'commitCommand\']
');
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/mod_cce/class.tx_commerce_cce_db.php']['commitCommandClass'] as $classRef) {
$hookObjectsArr[] = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
}
}
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/Classes/Utility/DataHandlerUtility.php']['commitCommand'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/Classes/Utility/DataHandlerUtility.php']['commitCommand'] as $classRef) {
$hookObjectsArr[] = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
}
}
// Hook: beforeCommit
foreach ($hookObjectsArr as $hookObj) {
if (method_exists($hookObj, 'beforeCommit')) {
$hookObj->beforeCommit($uidClip, $uidTarget, $command);
}
}
// we got all info we need - commit command
switch ($command) {
case 'overwrite':
Tx_Commerce_Utility_BackendUtility::overwriteProduct($uidClip, $uidTarget, $this->locales);
break;
case 'pasteProduct':
Tx_Commerce_Utility_BackendUtility::copyProduct($uidClip, $uidTarget, FALSE, $this->locales, $this->sorting);
break;
case 'pasteCategory':
Tx_Commerce_Utility_BackendUtility::copyCategory($uidClip, $uidTarget, $this->locales, $this->sorting);
break;
default:
die('unknown command');
}
// Hook: afterCommit
foreach ($hookObjectsArr as $hookObj) {
if (method_exists($hookObj, 'afterCommit')) {
$hookObj->afterCommit($uidClip, $uidTarget, $command);
}
}
// Update page tree?
if ($this->uPT && (isset($this->data['tx_commerce_categories']) || isset($this->cmd['tx_commerce_categories'])) && (isset($this->data['tx_commerce_products']) || isset($this->cmd['tx_commerce_products']))) {
\TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updateFolderTree');
}
}
示例12: indexAction
/**
* Basically makes sure that the workspace preview is rendered.
* The preview itself consists of three frames, so there are
* only the frames-urls we've to generate here
*
* @param int $previewWS
* @return void
*/
public function indexAction($previewWS = null)
{
$backendUser = $this->getBackendUser();
// Get all the GET parameters to pass them on to the frames
$queryParameters = GeneralUtility::_GET();
// Remove the GET parameters related to the workspaces module and the page id
unset($queryParameters['tx_workspaces_web_workspacesworkspaces']);
unset($queryParameters['M']);
unset($queryParameters['id']);
// Assemble a query string from the retrieved parameters
$queryString = GeneralUtility::implodeArrayForUrl('', $queryParameters);
// fetch the next and previous stage
$workspaceItemsArray = $this->workspaceService->selectVersionsInWorkspace($this->stageService->getWorkspaceId(), $filter = 1, $stage = -99, $this->pageId, $recursionLevel = 0, $selectionType = 'tables_modify');
list(, $nextStage) = $this->stageService->getNextStageForElementCollection($workspaceItemsArray);
list(, $previousStage) = $this->stageService->getPreviousStageForElementCollection($workspaceItemsArray);
/** @var $wsService WorkspaceService */
$wsService = GeneralUtility::makeInstance(WorkspaceService::class);
$wsList = $wsService->getAvailableWorkspaces();
$activeWorkspace = $backendUser->workspace;
if (!is_null($previewWS)) {
if (in_array($previewWS, array_keys($wsList)) && $activeWorkspace != $previewWS) {
$activeWorkspace = $previewWS;
$backendUser->setWorkspace($activeWorkspace);
BackendUtility::setUpdateSignal('updatePageTree');
}
}
/** @var $uriBuilder UriBuilder */
$uriBuilder = $this->objectManager->get(UriBuilder::class);
$wsSettingsPath = GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
$wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), ReviewController::class, 'workspaces', 'web_workspacesworkspaces');
$wsSettingsParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Review';
$wsSettingsUrl = $wsSettingsPath . $wsSettingsUri . $wsSettingsParams;
$viewDomain = BackendUtility::getViewDomain($this->pageId);
$wsBaseUrl = $viewDomain . '/index.php?id=' . $this->pageId . $queryString;
// @todo - handle new pages here
// branchpoints are not handled anymore because this feature is not supposed anymore
if (WorkspaceService::isNewPage($this->pageId)) {
$wsNewPageUri = $uriBuilder->uriFor('newPage', array(), PreviewController::class, 'workspaces', 'web_workspacesworkspaces');
$wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
$liveUrl = $wsSettingsPath . $wsNewPageUri . $wsNewPageParams . '&ADMCMD_prev=IGNORE';
} else {
$liveUrl = $wsBaseUrl . '&ADMCMD_noBeUser=1&ADMCMD_prev=IGNORE';
}
$wsUrl = $wsBaseUrl . '&ADMCMD_prev=IGNORE&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' . $backendUser->workspace;
$backendDomain = GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY');
$splitPreviewTsConfig = BackendUtility::getModTSconfig($this->pageId, 'workspaces.splitPreviewModes');
$splitPreviewModes = GeneralUtility::trimExplode(',', $splitPreviewTsConfig['value']);
$allPreviewModes = array('slider', 'vbox', 'hbox');
if (!array_intersect($splitPreviewModes, $allPreviewModes)) {
$splitPreviewModes = $allPreviewModes;
}
$wsList = $wsService->getAvailableWorkspaces();
$activeWorkspace = $backendUser->workspace;
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Workspaces/Preview');
$this->pageRenderer->addInlineSetting('Workspaces', 'SplitPreviewModes', $splitPreviewModes);
$this->pageRenderer->addInlineSetting('Workspaces', 'token', FormProtectionFactory::get('backend')->generateToken('extDirect'));
$cssFile = 'EXT:workspaces/Resources/Public/Css/preview.css';
$cssFile = GeneralUtility::getFileAbsFileName($cssFile);
$this->pageRenderer->addCssFile(PathUtility::getAbsoluteWebPath($cssFile));
$backendUser->setAndSaveSessionData('workspaces.backend_domain', GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
$logoPath = GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Public/Images/typo3-topbar@2x.png');
list($logoWidth, $logoHeight) = @getimagesize($logoPath);
// High-resolution?
$logoWidth = $logoWidth / 2;
$logoHeight = $logoHeight / 2;
$this->view->assignMultiple(['logoUrl' => PathUtility::getAbsoluteWebPath($logoPath), 'logoLink' => TYPO3_URL_GENERAL, 'logoWidth' => $logoWidth, 'logoHeight' => $logoHeight, 'liveUrl' => $liveUrl, 'wsUrl' => $wsUrl, 'wsSettingsUrl' => $wsSettingsUrl, 'backendDomain' => $backendDomain, 'activeWorkspace' => $wsList[$activeWorkspace], 'splitPreviewModes' => $splitPreviewModes, 'firstPreviewMode' => current($splitPreviewModes), 'enablePreviousStageButton' => !$this->isInvalidStage($previousStage), 'enableNextStageButton' => !$this->isInvalidStage($nextStage), 'enableDiscardStageButton' => !$this->isInvalidStage($nextStage) || !$this->isInvalidStage($previousStage), 'nextStage' => $nextStage['title'], 'nextStageId' => $nextStage['uid'], 'prevStage' => $previousStage['title'], 'prevStageId' => $previousStage['uid']]);
foreach ($this->getAdditionalResourceService()->getLocalizationResources() as $localizationResource) {
$this->pageRenderer->addInlineLanguageLabelFile($localizationResource);
}
}
示例13: main
/**
* Executing the posted actions ...
*
* @return void
* @todo Define visibility
*/
public function main()
{
// LOAD TCEmain with data and cmd arrays:
$this->tce->start($this->data, $this->cmd);
if (is_array($this->mirror)) {
$this->tce->setMirror($this->mirror);
}
// Checking referer / executing
$refInfo = parse_url(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_REFERER'));
$httpHost = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY');
if ($httpHost != $refInfo['host'] && $this->vC != $GLOBALS['BE_USER']->veriCode() && !$GLOBALS['TYPO3_CONF_VARS']['SYS']['doNotCheckReferer']) {
$this->tce->log('', 0, 0, 0, 1, 'Referer host "%s" and server host "%s" did not match and veriCode was not valid either!', 1, array($refInfo['host'], $httpHost));
} else {
// Register uploaded files
$this->tce->process_uploads($_FILES);
// Execute actions:
$this->tce->process_datamap();
$this->tce->process_cmdmap();
// Clearing cache:
$this->tce->clear_cacheCmd($this->cacheCmd);
// Update page tree?
if ($this->uPT && (isset($this->data['pages']) || isset($this->cmd['pages']))) {
\TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updatePageTree');
}
}
}
示例14: mainAction
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it just redirects to the given URL afterwards.
*
* @param ServerRequestInterface $request the current request
* @param ResponseInterface $response
* @return ResponseInterface the response with the content
*/
public function mainAction(ServerRequestInterface $request, ResponseInterface $response)
{
$this->main();
// Push errors to flash message queue, if there are any
$this->fileProcessor->pushErrorMessagesToFlashMessageQueue();
BackendUtility::setUpdateSignal('updateFolderTree');
if ($this->redirect) {
return $response->withHeader('Location', GeneralUtility::locationHeaderUrl($this->redirect))->withStatus(303);
} else {
// empty response
return $response;
}
}
示例15: importData
//.........这里部分代码省略.........
' . implode('
', $row) . '
</table>
');
}
// Perform import or preview depending:
$overviewContent = '';
$extensionInstallationMessage = '';
$emURL = '';
$inFile = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($inData['file']);
if ($inFile && @is_file($inFile)) {
$trow = array();
if ($import->loadFile($inFile, 1)) {
// Check extension dependencies:
$extKeysToInstall = array();
if (is_array($import->dat['header']['extensionDependencies'])) {
foreach ($import->dat['header']['extensionDependencies'] as $extKey) {
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey)) {
$extKeysToInstall[] = $extKey;
}
}
}
if (count($extKeysToInstall)) {
$passParams = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('tx_impexp');
unset($passParams['import_mode']);
unset($passParams['import_file']);
$thisScriptUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI') . '?M=xMOD_tximpexp&id=' . $this->id . \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('tx_impexp', $passParams);
$emURL = $this->doc->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('em') . 'classes/index.php?CMD[requestInstallExtensions]=' . implode(',', $extKeysToInstall) . '&returnUrl=' . rawurlencode($thisScriptUrl);
$extensionInstallationMessage = 'Before you can install this T3D file you need to install the extensions "' . implode('", "', $extKeysToInstall) . '". Clicking Import will first take you to the Extension Manager so these dependencies can be resolved.';
}
if ($inData['import_file']) {
if (!count($extKeysToInstall)) {
$import->importData($this->id);
\TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updatePageTree');
} else {
\TYPO3\CMS\Core\Utility\HttpUtility::redirect($emURL);
}
}
$import->display_import_pid_record = $this->pageinfo;
$overviewContent = $import->displayContentOverview();
}
// Meta data output:
$trow[] = '<tr class="bgColor5">
<td colspan="2"><strong>' . $LANG->getLL('importdata_metaData', 1) . '</strong></td>
</tr>';
$opt = array('');
foreach ($filesInDir as $file) {
$opt[$file] = substr($file, strlen(PATH_site));
}
$trow[] = '<tr class="bgColor4">
<td><strong>' . $LANG->getLL('importdata_title', 1) . '</strong></td>
<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['title'])) . '</td>
</tr>';
$trow[] = '<tr class="bgColor4">
<td><strong>' . $LANG->getLL('importdata_description', 1) . '</strong></td>
<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['description'])) . '</td>
</tr>';
$trow[] = '<tr class="bgColor4">
<td><strong>' . $LANG->getLL('importdata_notes', 1) . '</strong></td>
<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['notes'])) . '</td>
</tr>';
$trow[] = '<tr class="bgColor4">
<td><strong>' . $LANG->getLL('importdata_packager', 1) . '</strong></td>
<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['packager_name'] . ' (' . $import->dat['header']['meta']['packager_username'] . ')')) . '<br/>
' . $LANG->getLL('importdata_email', 1) . ' ' . $import->dat['header']['meta']['packager_email'] . '</td>
</tr>';