作者:clickstor
项目:cs_se
/**
* 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');
}
作者:khanhdeu
项目:typo3tes
/**
* 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);
}
作者:Gregp
项目:TYPO3.CM
/**
* 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;
}
作者:Andreas
项目:commerc
/**
* 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;
}
}
作者:steffmeiste
项目:typo3-foru
/**
* 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);
}
作者:hlo
项目:TYPO3.CM
/**
* 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>';
}
作者:Mr-Robot
项目:TYPO3.CM
/**
* 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;
}
作者:nicksergi
项目:TYPO3v4-Cor
/**
* 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);
}
作者:plan2ne
项目:TYPO3.CM
/**
* 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;
}
作者:nxpth
项目:ext-sol
/**
* 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;
}
作者:khanhdeu
项目:typo3tes
/**
* 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;
}
作者:plan2ne
项目:TYPO3.CM
/**
* 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;
}
作者:rickymathe
项目:TYPO3.CM
/**
* 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) . ';');
}
作者:khanhdeu
项目:typo3tes
/**
* 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;
}
作者:plan2ne
项目:TYPO3.CM
/**
* 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;
}
作者:Andreas
项目:commerc
/**
* Main function, rendering the browsable page tree
*
* @return void
*/
public function main()
{
// Produce browse-tree:
$tree = $this->pagetree->getBrowsableTree();
$docHeaderButtons = $this->getButtons();
$markers = array('IMG_RESET' => '', 'WORKSPACEINFO' => '', 'CONTENT' => $tree);
// Build the <body> for the module
$this->content = $this->doc->startPage($this->getLanguageService()->sl('LLL:EXT:commerce/Resources/Private/Language/locallang_be.xml:mod_orders.navigation_title'));
$this->content .= $this->doc->moduleBody('', $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
作者:khanhdeu
项目:typo3tes
/**
* 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' => '', 'view' => '', 'shortcut' => '');
// CSH
$buttons['csh'] = BackendUtility::cshItem('_MOD_web_info', '', $GLOBALS['BACK_PATH'], '', TRUE);
// View page
$buttons['view'] = '<a href="#" ' . 'onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-view') . '</a>';
// Shortcut
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
}
return $buttons;
}
作者:nicksergi
项目:TYPO3v4-Cor
/**
* Create selector for workspaces and change workspace if command is given to do that.
*
* @return string HTML
* @todo Define visibility
*/
public function workspaceSelector()
{
// Changing workspace and if so, reloading entire backend:
if (strlen($this->changeWorkspace)) {
$GLOBALS['BE_USER']->setWorkspace($this->changeWorkspace);
return $this->doc->wrapScriptTags('top.location.href="' . \TYPO3\CMS\Backend\Utility\BackendUtility::getBackendScript() . '";');
}
// Changing workspace and if so, reloading entire backend:
if (strlen($this->changeWorkspacePreview)) {
$GLOBALS['BE_USER']->setWorkspacePreview($this->changeWorkspacePreview);
}
// Create options array:
$options = array();
if ($GLOBALS['BE_USER']->checkWorkspace(array('uid' => 0))) {
$options[0] = '[' . $GLOBALS['LANG']->getLL('bookmark_onlineWS') . ']';
}
if ($GLOBALS['BE_USER']->checkWorkspace(array('uid' => -1))) {
$options[-1] = '[' . $GLOBALS['LANG']->getLL('bookmark_offlineWS') . ']';
}
// Add custom workspaces (selecting all, filtering by BE_USER check):
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('workspaces')) {
$workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers', 'sys_workspace', 'pid=0' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_workspace'), '', 'title');
if (count($workspaces)) {
foreach ($workspaces as $rec) {
if ($GLOBALS['BE_USER']->checkWorkspace($rec)) {
$options[$rec['uid']] = $rec['uid'] . ': ' . $rec['title'];
}
}
}
}
// Build selector box:
if (count($options)) {
foreach ($options as $value => $label) {
$selected = (int) $GLOBALS['BE_USER']->workspace === $value ? ' selected="selected"' : '';
$options[$value] = '<option value="' . htmlspecialchars($value) . '"' . $selected . '>' . htmlspecialchars($label) . '</option>';
}
} else {
$options[] = '<option value="-99">' . $GLOBALS['LANG']->getLL('bookmark_noWSfound', 1) . '</option>';
}
$selector = '';
// Preview:
if ($GLOBALS['BE_USER']->workspace !== 0) {
$selector .= '<label for="workspacePreview">Frontend Preview:</label> <input type="checkbox" name="workspacePreview" id="workspacePreview" onclick="changeWorkspacePreview(' . ($GLOBALS['BE_USER']->user['workspace_preview'] ? 0 : 1) . ')"; ' . ($GLOBALS['BE_USER']->user['workspace_preview'] ? 'checked="checked"' : '') . '/> ';
}
$selector .= '<a href="mod/user/ws/index.php" target="content">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('sys_workspace', array()) . '</a>';
if (count($options) > 1) {
$selector .= '<select name="_workspaceSelector" onchange="changeWorkspace(this.options[this.selectedIndex].value);">' . implode('', $options) . '</select>';
}
return $selector;
}
作者:vip3ou
项目:TYPO3.CM
/**
* Render page title with icon, table title and record title
*
* @return string
*/
protected function renderPageTitle()
{
if ($this->type === 'folder') {
$table = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:folder');
$title = $this->doc->getResourceHeader($this->folderObject, array(' ', ''), false);
} elseif ($this->type === 'file') {
$table = $this->getLanguageService()->sL($GLOBALS['TCA'][$this->table]['ctrl']['title']);
$title = $this->doc->getResourceHeader($this->fileObject, array(' ', ''), false);
} else {
$table = $this->getLanguageService()->sL($GLOBALS['TCA'][$this->table]['ctrl']['title']);
$title = $this->doc->getHeader($this->table, $this->row, $this->pageInfo['_thePath'], 1, array(' ', ''), false);
}
// Set HTML title tag
$this->titleTag = $table . ': ' . strip_tags(BackendUtility::getRecordTitle($this->table, $this->row));
return '<h1>' . ($table ? '<small>' . $table . '</small><br />' : '') . $title . '</h1>';
}
作者:nicksergi
项目:TYPO3v4-Cor
/**
* Returns the rendered record actions
*
* @param string $table
* @param integer $uid
* @return string
*/
protected function getRecordActions($table, $uid)
{
if ($table === '' || $uid < 0) {
return '';
}
$editOnClick = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[' . $table . '][' . $uid . ']=edit', $GLOBALS['BACK_PATH']);
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open');
$pageActionIcons = '<a href="#" onclick="' . htmlspecialchars($editOnClick) . '">' . $icon . '</a>';
$historyOnClick = 'window.location.href=\'show_rechis.php?element=' . $table . '%3A' . $uid . '&returnUrl=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) . '\'; return false;';
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-history-open');
$pageActionIcons .= '<a href="#" onclick="' . $historyOnClick . '">' . $icon . '</a>';
if ($table === 'pages') {
$pageActionIcons .= $this->doc->viewPageIcon($uid, '');
}
return $pageActionIcons;
}