本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate类的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate类的具体用法?PHP DocumentTemplate怎么用?PHP DocumentTemplate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DocumentTemplate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructs this view
*
* Defines the global variable SOBE. Normally this is used by the wizards
* which are one file only. This view is now the class with the global
* variable name SOBE.
*
* Defines the document template object.
*
* @see \TYPO3\CMS\Backend\Template\DocumentTemplate
*/
public function __construct()
{
$this->getLanguageService()->includeLLFile('EXT:cs_templates/Resources/Private/Language/locallang.xlf');
$GLOBALS['SOBE'] = $this;
// Define the document template object
$this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
$this->doc->setModuleTemplate('EXT:cs_seo/Resources/Private/Templates/Wizard.html');
}
示例2: processRequest
/**
* Processes a general request. The result can be returned by altering the given response.
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException if the controller doesn't support the current request type
* @return void
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
$this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->pageRenderer = $this->template->getPageRenderer();
$GLOBALS['SOBE'] = new \stdClass();
$GLOBALS['SOBE']->doc = $this->template;
parent::processRequest($request, $response);
$pageHeader = $this->template->startpage($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:module.title'));
$pageEnd = $this->template->endPage();
$response->setContent($pageHeader . $response->getContent() . $pageEnd);
}
示例3: mainAction
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request the current request
* @param ResponseInterface $response the prepared response object
* @return ResponseInterface the response with the content
*/
public function mainAction(ServerRequestInterface $request, ResponseInterface $response)
{
$this->determineScriptUrl($request);
$this->initVariables($request);
$this->loadLinkHandlers();
$this->initCurrentUrl();
$menuData = $this->buildMenuArray();
$renderLinkAttributeFields = $this->renderLinkAttributeFields();
$browserContent = $this->displayedLinkHandler->render($request);
$this->initDocumentTemplate();
$content = $this->doc->startPage('Link Browser');
$content .= $this->doc->getFlashMessages();
if ($this->currentLink) {
$content .= '<!-- Print current URL -->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-curUrl">
<tr>
<td>' . $this->getLanguageService()->getLL('currentLink', true) . ': ' . htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) . '</td>
</tr>
</table>';
}
$content .= $this->doc->getTabMenuRaw($menuData);
$content .= $renderLinkAttributeFields;
$content .= '<div class="linkBrowser-tabContent">' . $browserContent . '</div>';
$content .= $this->doc->endPage();
$response->getBody()->write($this->doc->insertStylesAndJS($content));
return $response;
}
示例4: adminLinks
/**
* Administrative links for a table / record
*
* @param string $table Table name
* @param array $row Record for which administrative links are generated.
*
* @return string HTML link tags.
*/
public function adminLinks($table, array $row)
{
if ($table !== 'tx_commerce_products') {
return parent::adminLinks($table, $row);
} else {
$language = $this->getLanguageService();
// Edit link:
$adminLink = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[' . $table . '][' . $row['uid'] . ']=edit', $this->doc->backPath)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open', array('title' => $language->sL('LLL:EXT:lang/locallang_core.xml:cm.edit', TRUE))) . '</a>';
// Delete link:
$adminLink .= '<a href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:cm.delete', TRUE))) . '</a>';
if ($row['pid'] == -1) {
// get page TSconfig
$pagesTyposcriptConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($GLOBALS['_POST']['popViewId']);
if ($pagesTyposcriptConfig['tx_commerce.']['singlePid']) {
$previewPageId = $pagesTyposcriptConfig['tx_commerce.']['singlePid'];
} else {
$previewPageId = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][COMMERCE_EXTKEY]['extConf']['previewPageID'];
}
$sysLanguageUid = (int) $row['sys_language_uid'];
/**
* Product
*
* @var $product Tx_Commerce_Domain_Model_Product
*/
$product = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Domain_Model_Product', $row['t3ver_oid'], $sysLanguageUid);
$product->loadData();
$getVars = ($sysLanguageUid > 0 ? '&L=' . $sysLanguageUid : '') . '&ADMCMD_vPrev[' . rawurlencode($table . ':' . $row['t3ver_oid']) . ']=' . $row['uid'] . '&no_cache=1&tx_commerce_pi1[showUid]=' . $product->getUid() . '&tx_commerce_pi1[catUid]=' . current($product->getMasterparentCategory());
$adminLink .= '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($previewPageId, $this->doc->backPath, \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-view') . '</a>';
}
return $adminLink;
}
}
示例5: processRequest
/**
* Processes a general request. The result can be returned by altering the given response.
*
* @param RequestInterface $request The request object
* @param ResponseInterface $response The response, modified by this handler
*/
public function processRequest(RequestInterface $request, ResponseInterface $response)
{
$GLOBALS['SOBE'] = new \stdClass();
$GLOBALS['SOBE']->doc = $this->documentTemplate;
parent::processRequest($request, $response);
$pageHeader = $this->documentTemplate->startpage($this->languageService->sL('LLL:EXT:typo3_forum/Resources/Private/Language/locallang_mod.xml:module.title'));
$pageEnd = $this->documentTemplate->endPage();
$response->setContent($pageHeader . $response->getContent() . $pageEnd);
}
示例6: adminLinks
/**
* Administrative links for a table / record
*
* @param string $table Table name
* @param array $row Record for which administrative links are generated.
* @return string HTML link tags.
*/
public function adminLinks($table, $row)
{
// Edit link:
$editUrl = BackendUtility::getModuleUrl('record_edit', ['edit' => [$table => [$row['uid'] => 'edit']], 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]);
$adminLink = '<a class="btn btn-default" href="' . htmlspecialchars($editUrl) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', true) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
// Delete link:
$adminLink .= '<a class="btn btn-default" href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.delete', true) . '">' . $this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render() . '</a>';
if ($table === 'pages') {
// If another page module was specified, replace the default Page module with the new one
$newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
$pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
// Perform some access checks:
$a_wl = $GLOBALS['BE_USER']->check('modules', 'web_list');
$a_wp = $GLOBALS['BE_USER']->check('modules', $pageModule);
$adminLink .= '<a class="btn btn-default" href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'' . $pageModule . '\'); return false;">' . $this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render() . '</a>';
$adminLink .= '<a class="btn btn-default" href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'web_list\'); return false;">' . $this->iconFactory->getIcon('actions-system-list-open', Icon::SIZE_SMALL)->render() . '</a>';
// "View page" icon is added:
$adminLink .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['uid'], '', BackendUtility::BEgetRootLine($row['uid']))) . '">' . $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>';
} else {
if ($row['pid'] == -1) {
$getVars = '&ADMCMD_vPrev[' . rawurlencode($table . ':' . $row['t3ver_oid']) . ']=' . $row['uid'];
// "View page" icon is added:
$adminLink .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['_REAL_PID'], '', BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>';
}
}
return '<div class="btn-group btn-group-sm" role="group">' . $adminLink . '</div>';
}
示例7: adminLinks
/**
* Administrative links for a table / record
*
* @param string $table Table name
* @param array $row Record for which administrative links are generated.
* @return string HTML link tags.
* @todo Define visibility
*/
public function adminLinks($table, $row)
{
// Edit link:
$adminLink = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick('&edit[' . $table . '][' . $row['uid'] . ']=edit', $this->doc->backPath)) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
// Delete link:
$adminLink .= '<a href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.delete', TRUE) . '">' . IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
if ($table === 'pages') {
// If another page module was specified, replace the default Page module with the new one
$newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
$pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
// Perform some acccess checks:
$a_wl = $GLOBALS['BE_USER']->check('modules', 'web_list');
$a_wp = $GLOBALS['BE_USER']->check('modules', $pageModule);
$adminLink .= '<a href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'' . $pageModule . '\'); return false;">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
$adminLink .= '<a href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'web_list\'); return false;">' . IconUtility::getSpriteIcon('actions-system-list-open') . '</a>';
// "View page" icon is added:
$adminLink .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['uid'], $this->doc->backPath, BackendUtility::BEgetRootLine($row['uid']))) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
} else {
if ($row['pid'] == -1) {
$getVars = '&ADMCMD_vPrev[' . rawurlencode($table . ':' . $row['t3ver_oid']) . ']=' . $row['uid'];
// "View page" icon is added:
$adminLink .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['_REAL_PID'], $this->doc->backPath, BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
}
}
return $adminLink;
}
示例8: main
/**
* Main function, rendering the browsable page tree
*
* @return void
* @todo Define visibility
*/
public function main()
{
// Produce browse-tree:
$tree = $this->pagetree->getBrowsableTree();
// Outputting Temporary DB mount notice:
if ($this->active_tempMountPoint) {
$flashText = '
<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('setTempDBmount' => 0))) . '">' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount', 1) . '</a> <br />' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_core.xml:labels.path', 1) . ': <span title="' . htmlspecialchars($this->active_tempMountPoint['_thePathFull']) . '">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->active_tempMountPoint['_thePath'], -50)) . '</span>
';
$flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $flashText, '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
$this->content .= $flashMessage->render();
}
// Outputting page tree:
$this->content .= '<div id="PageTreeDiv">' . $tree . '</div>';
// Adding javascript for drag & drop activation and highlighting
$this->content .= $this->doc->wrapScriptTags('
' . ($this->doHighlight ? 'Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);' : '') . '
Tree.registerDragDropHandlers();');
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers = array('IMG_RESET' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close', array('id' => 'treeFilterReset', 'alt' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter'), 'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter'))), 'WORKSPACEINFO' => $this->getWorkspaceInfo(), 'CONTENT' => $this->content);
$subparts = array();
if (!$this->hasFilterBox) {
$subparts['###SECOND_ROW###'] = '';
}
// Build the <body> for the module
$this->content = $this->doc->startPage('TYPO3 Page Tree');
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers, $subparts);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例9: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array All available buttons as an assoc. array
*/
protected function getButtons()
{
$buttons = array('close' => '', 'save' => '', 'save_view' => '', 'save_close' => '', 'shortcut' => '', 'undo' => '');
if ($this->P['table'] && $this->P['field'] && $this->P['uid'] && $this->checkEditAccess($this->P['table'], $this->P['uid'])) {
$closeUrl = GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']);
// Getting settings for the undo button:
$undoButton = 0;
$databaseConnection = $this->getDatabaseConnection();
$undoRes = $databaseConnection->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $databaseConnection->fullQuoteStr($this->P['table'], 'sys_history') . ' AND recuid=' . (int) $this->P['uid'], '', 'tstamp DESC', '1');
if ($undoButtonR = $databaseConnection->sql_fetch_assoc($undoRes)) {
$undoButton = 1;
}
// Close
$buttons['close'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(' . GeneralUtility::quoteJSvalue($closeUrl) . '); return false;') . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-close') . '</a>';
// Save
$buttons['save'] = IconUtility::getSpriteIcon('actions-document-save', array('html' => '<input type="image" name="_savedok" class="c-inputButton" src="clear.gif" onclick="TBE_EDITOR.checkAndDoSubmit(1); return false;" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) . '" />'));
// Save & View
$buttons['save_view'] = IconUtility::getSpriteIcon('actions-document-save-view', array('html' => '<input type="image" class="c-inputButton" name="_savedokview" src="clear.gif" onclick="' . htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', TRUE) . '" />'));
// Save & Close
$buttons['save_close'] = IconUtility::getSpriteIcon('actions-document-save-close', array('html' => '<input type="image" class="c-inputButton" name="_saveandclosedok" src="clear.gif" onclick="' . htmlspecialchars('document.editform.redirect.value=' . GeneralUtility::quoteJSvalue($closeUrl) . '; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', TRUE) . '" />'));
// Undo/Revert:
if ($undoButton) {
$aOnClick = 'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('record_history', array('element' => $this->P['table'] . ':' . $this->P['uid'], 'revert' => 'field:' . $this->P['field'], 'sumUp' => -1, 'returnUrl' => $this->R_URI))) . '; return false;';
$buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '"' . ' title="' . htmlspecialchars(sprintf($this->getLanguageService()->getLL('undoLastChange'), BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $undoButtonR['tstamp'], $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')))) . '">' . IconUtility::getSpriteIcon('actions-edit-undo') . '</a>';
}
// Shortcut
if ($this->getBackendUserAuthentication()->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('P', '', $this->MCONF['name'], 1);
}
}
return $buttons;
}
示例10: listIndexDocuments
/**
* Queries Solr for this page's documents and lists them in a table.
*
* @return string HTML table of documents indexed for the current page.
*/
protected function listIndexDocuments()
{
$content = '';
$content .= $this->document->sectionHeader('Index Inspector');
$content .= '<div id="indexInspectorDocumentList"></div>';
return $content;
}
示例11: getShortcutButton
/**
* Gets the button to set a new shortcut in the backend (if current user is allowed to).
*
* @return string HTML representation of the shortcut button
*/
protected function getShortcutButton()
{
$result = '';
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$result = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
}
return $result;
}
示例12: getShortcutButton
/**
* Gets the button to set a new shortcut in the backend (if current user is allowed to).
*
* @return string HTML representation of the shortcut button
*/
protected function getShortcutButton()
{
$result = '';
if ($this->getBackendUser()->mayMakeShortcut()) {
$result = $this->doc->makeShortcutIcon('', 'function', $this->pObj->MCONF['name']);
}
return $result;
}
示例13: loadSettings
/**
* Load the settings
*
* The settings are defined in pageTSconfig mod.wizards.form
*
* @return void
*/
protected function loadSettings()
{
$record = $this->repository->getRecord();
$pageId = $record->getPageId();
$modTSconfig = BackendUtility::getModTSconfig($pageId, 'mod.wizards.form');
$settings = $modTSconfig['properties'];
$this->removeTrailingDotsFromTyposcript($settings);
$this->doc->JScode .= $this->doc->wrapScriptTags('TYPO3.Form.Wizard.Settings = ' . json_encode($settings) . ';');
}
示例14: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an assoc. array
*/
protected function getButtons()
{
$buttons = array('csh' => '', 'shortcut' => '');
// Shortcut
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
}
return $buttons;
}
示例15: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array All available buttons as an assoc. array
*/
protected function getButtons()
{
$buttons = array('csh' => '', 'save' => '', 'shortcut' => '');
$buttons['csh'] = BackendUtility::cshItem('_MOD_user_setup', '');
$buttons['save'] = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-save', array('html' => '<input type="image" name="data[save]" class="c-inputButton" src="clear.gif" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) . '" />'));
if ($this->getBackendUser()->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('', '', $this->moduleName);
}
return $buttons;
}