/** * 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; } }
/** * 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'); }
/** * 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); }
/** * 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); }
/** * 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>'; }
/** * 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; }
/** * 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); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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) . ';'); }
/** * 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; }
/** * 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; }
/** * 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); }
/** * 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; }
/** * 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; }
/** * 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>'; }
/** * 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; }
/** * Returns the rendered record actions * * @param string $table * @param integer $uid * @return string */ protected function getRecordActions($table, $uid) { if ($table === '' || $uid < 0) { return ''; } $editOnClick = BackendUtility::editOnClick('&edit[' . $table . '][' . $uid . ']=edit', $GLOBALS['BACK_PATH']); $icon = IconUtility::getSpriteIcon('actions-document-open'); $pageActionIcons = '<a href="#" onclick="' . htmlspecialchars($editOnClick) . '">' . $icon . '</a>'; $historyOnClick = 'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('record_history', array('element' => $table . ':' . $uid, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')))) . '; return false;'; $icon = IconUtility::getSpriteIcon('actions-document-history-open'); $pageActionIcons .= '<a href="#" onclick="' . htmlspecialchars($historyOnClick) . '">' . $icon . '</a>'; if ($table === 'pages') { $pageActionIcons .= $this->doc->viewPageIcon($uid, ''); } return $pageActionIcons; }
/** * Main function, rendering the folder tree * * @return void */ public function main() { // Produce browse-tree: $tree = $this->foldertree->getBrowsableTree(); // Outputting page tree: $this->content .= $tree; // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers = array('CONTENT' => $this->content); $subparts = array(); // Build the <body> for the module $this->content = $this->doc->startPage('TYPO3 Folder Tree'); $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markers, $subparts); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Main function, rendering the upload file form fields * * @return void */ public function main() { // Make page header: $this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle')); $form = $this->renderUploadForm(); $pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle')) . $this->doc->section('', $form); // Header Buttons $docHeaderButtons = array('csh' => BackendUtility::cshItem('xMOD_csh_corebe', 'file_upload', $GLOBALS['BACK_PATH']), 'back' => ''); $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent, 'PATH' => $this->title); // Back if ($this->returnUrl) { $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>'; } $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Main function, rendering the upload file form fields * * @return void */ public function main() { // Make page header: $this->content = $this->doc->startPage($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle')); $form = $this->renderUploadForm(); $pageContent = $this->doc->header($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle')) . $this->doc->section('', $form); // Header Buttons $docHeaderButtons = array('csh' => BackendUtility::cshItem('xMOD_csh_corebe', 'file_upload'), 'back' => ''); $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => '', 'CONTENT' => $pageContent, 'PATH' => $this->title); // Back if ($this->returnUrl) { $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true) . '">' . $this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL)->render() . '</a>'; } $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Main function, rendering the content of the rename form * * @return void */ public function main() { // Make page header: $this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle')); $pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle')); $pageContent .= $this->doc->spacer(5); $pageContent .= $this->doc->divider(5); if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) { $fileIdentifier = $this->fileOrFolderObject->getCombinedIdentifier(); } else { $fileIdentifier = $this->fileOrFolderObject->getUid(); } $code = '<form action="tce_file.php" method="post" name="editform">'; // Making the formfields for renaming: $code .= ' <div id="c-rename"> <input type="text" name="file[rename][0][target]" value="' . htmlspecialchars($this->fileOrFolderObject->getName()) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(40) . ' /> <input type="hidden" name="file[rename][0][data]" value="' . htmlspecialchars($fileIdentifier) . '" /> </div> '; // Making submit button: $code .= ' <div id="c-submit"> <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.submit', TRUE) . '" /> <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', TRUE) . '" onclick="backToList(); return false;" /> <input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" /> ' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . ' </div> '; $code .= '</form>'; // Add the HTML as a section: $pageContent .= $code; $docHeaderButtons = array('back' => ''); $docHeaderButtons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename', $GLOBALS['BACK_PATH']); // Back if ($this->returnUrl) { $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>'; } // Add the HTML as a section: $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent, 'PATH' => $this->title); $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Create the panel of buttons for submitting the form * or otherwise perform operations. * * @return array all available buttons as an assoc. array */ protected function getHeaderButtons() { $backendUser = $this->getBackendUser(); $language = $this->getLanguageService(); $buttons = array('csh' => '', 'level_up' => '', 'back' => '', 'new_record' => '', 'paste' => '', 'view' => '', 'edit' => '', 'move' => '', 'hide_unhide' => '', 'csv' => '', 'export' => '', 'cache' => '', 'reload' => '', 'shortcut' => ''); // CSH $buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_commerce_statistic', '', $this->getBackPath(), '', true); // Shortcut if ($backendUser->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']); } // If access to Web>List for user, then link to that module. if ($backendUser->check('modules', 'web_list')) { $href = $this->getBackPath() . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')); $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-folder-list', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1))) . '</a>'; } return $buttons; }
/** * 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' => '', 'record_list' => '', 'shortcut' => ''); // CSH if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS']) { // View page $buttons['view'] = ' <a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '"> ' . $this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . ' </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->moduleName); } // If access to Web>List for user, then link to that module. $buttons['record_list'] = BackendUtility::getListViewLink(array('id' => $this->pageinfo['uid'], 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')), '', $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showList')); } return $buttons; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array All available buttons as an assoc. array * @todo Define visibility */ public function getButtons() { $buttons = array('csh' => '', 'shortcut' => '', 'upload' => '', 'new' => ''); // Add shortcut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('pointer,id,target,table', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); } // FileList Module CSH: $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_module', $GLOBALS['BACK_PATH'], '', TRUE); // Upload button (only if upload to this directory is allowed) if ($this->folderObject && $this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) { $buttons['upload'] = '<a href="' . $GLOBALS['BACK_PATH'] . 'file_upload.php?target=' . rawurlencode($this->folderObject->getCombinedIdentifier()) . '&returnUrl=' . rawurlencode($this->filelist->listURL()) . '" id="button-upload" title="' . $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.upload', TRUE)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-upload') . '</a>'; } // New folder button if ($this->folderObject && $this->folderObject->checkActionPermission('write') && ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File') || $this->folderObject->checkActionPermission('add'))) { $buttons['new'] = '<a href="' . $GLOBALS['BACK_PATH'] . 'file_newfolder.php?target=' . rawurlencode($this->folderObject->getCombinedIdentifier()) . '&returnUrl=' . rawurlencode($this->filelist->listURL()) . '" title="' . $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.new', TRUE)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new') . '</a>'; } return $buttons; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array All available buttons as an assoc. array */ public function getButtons() { $buttons = array('csh' => '', 'shortcut' => '', 'upload' => '', 'new' => ''); // Add shortcut if ($this->getBackendUser()->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('pointer,id,target,table', implode(',', array_keys($this->MOD_MENU)), $this->moduleName); } // FileList Module CSH: $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_module'); // Upload button (only if upload to this directory is allowed) if ($this->folderObject && $this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) { $buttons['upload'] = '<a href="' . htmlspecialchars($GLOBALS['BACK_PATH'] . BackendUtility::getModuleUrl('file_upload', array('target' => $this->folderObject->getCombinedIdentifier(), 'returnUrl' => $this->filelist->listURL()))) . '" id="button-upload" title="' . $this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.upload', TRUE)) . '">' . IconUtility::getSpriteIcon('actions-edit-upload') . '</a>'; } // New folder button if ($this->folderObject && $this->folderObject->checkActionPermission('write') && ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File') || $this->folderObject->checkActionPermission('add'))) { $buttons['new'] = '<a href="' . htmlspecialchars($GLOBALS['BACK_PATH'] . BackendUtility::getModuleUrl('file_newfolder', array('target' => $this->folderObject->getCombinedIdentifier(), 'returnUrl' => $this->filelist->listURL()))) . '" title="' . $this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.new', TRUE)) . '">' . IconUtility::getSpriteIcon('actions-document-new') . '</a>'; } return $buttons; }
/** * Render supplier row. * * @param \mysqli_result $result Result * @param array $fields Fields * * @return string */ protected function renderSupplierRows(\mysqli_result $result, array $fields) { $language = $this->getLanguageService(); $output = ''; $table = 'tx_commerce_supplier'; while ($row = $this->getDatabaseConnection()->sql_fetch_assoc($result)) { $refCountMsg = BackendUtility::referenceCount($table, $row['uid'], ' ' . $language->sL('LLL:EXT:lang/locallang_core.xml:labels.referencesToRecord'), $this->getReferenceCount($table, $row['uid'])); $editParams = '&edit[' . $table . '][' . (int) $row['uid'] . ']=edit'; $deleteParams = '&cmd[' . $table . '][' . (int) $row['uid'] . '][delete]=1'; $onClickAction = 'onclick="' . htmlspecialchars(BackendUtility::editOnClick($editParams, $this->getBackPath(), -1)) . '"'; $output .= '<tr><td><a href="#" ' . $onClickAction . '>' . IconUtility::getSpriteIcon('actions-document-open', array('title' => $language->getLL('edit', true))) . '</a>'; $output .= '<a href="#" onclick="' . htmlspecialchars('if (confirm(' . $language->JScharCode($language->getLL('deleteWarningSupplier') . ' "' . htmlspecialchars($row['title']) . '" ' . $refCountMsg) . ')) {jumpToUrl(\'' . $this->doc->issueCommand($deleteParams, -1) . '\');} return false;') . '">' . IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $language->getLL('delete', true))) . '</a>'; $output .= '</td>'; foreach ($fields as $field) { $output .= '<td valign="top" class="bgColor4"><strong>' . htmlspecialchars($row[$field]) . '</strong>'; } $output .= '</td></tr>'; } return $output; }