本文整理汇总了PHP中TYPO3\CMS\Backend\Template\ModuleTemplate::getDocHeaderComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleTemplate::getDocHeaderComponent方法的具体用法?PHP ModuleTemplate::getDocHeaderComponent怎么用?PHP ModuleTemplate::getDocHeaderComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Template\ModuleTemplate
的用法示例。
在下文中一共展示了ModuleTemplate::getDocHeaderComponent方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise
* perform operations.
*
* @return void
*/
protected function getButtons()
{
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
// Fullscreen Button
$url = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
$onClick = 'devlogWin=window.open(' . GeneralUtility::quoteJSvalue($url) . ',\'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
$fullscreenButton = $buttonBar->makeLinkButton()->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow'))->setOnClick($onClick)->setHref('#')->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-window-open', Icon::SIZE_SMALL));
$buttonBar->addButton($fullscreenButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);
// Shortcut
$shortcutButton = $buttonBar->makeShortcutButton()->setModuleName($this->moduleName)->setSetVariables(['function']);
$buttonBar->addButton($shortcutButton);
}
示例2: getButtons
/**
* Register docHeader buttons
*/
protected function getButtons()
{
/** @var ButtonBar $buttonBar */
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
/** @var IconFactory $iconFactory */
$iconFactory = $this->moduleTemplate->getIconFactory();
// Refresh
$refreshButton = $buttonBar->makeLinkButton()->setHref(GeneralUtility::getIndpEnv('REQUEST_URI'))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload'))->setIcon($iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
$buttonBar->addButton($refreshButton, ButtonBar::BUTTON_POSITION_RIGHT);
// CSH
$cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('filetree');
$buttonBar->addButton($cshButton);
}
示例3: getModuleMenu
/**
* Generates the action menu
*/
protected function getModuleMenu()
{
$menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
$menu->setIdentifier('ConfigurationJumpMenu');
foreach ($this->MOD_MENU['function'] as $controller => $title) {
$item = $menu->makeMenuItem()->setHref(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->id, 'SET' => ['function' => $controller]]))->setTitle($title);
if ($controller === (int) $this->MOD_SETTINGS['function']) {
$item->setActive(true);
}
$menu->addMenuItem($item);
}
$this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
}
示例4: init
/**
* Determines if table/uid point to database record or file and
* if user has access to view information
*
* @return void
*/
public function init()
{
$this->table = GeneralUtility::_GET('table');
$this->uid = GeneralUtility::_GET('uid');
$this->permsClause = $this->getBackendUser()->getPagePermsClause(1);
$this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
$this->moduleTemplate->getDocHeaderComponent()->disable();
if (isset($GLOBALS['TCA'][$this->table])) {
$this->initDatabaseRecord();
} elseif ($this->table === '_FILE' || $this->table === '_FOLDER' || $this->table === 'sys_file') {
$this->initFileOrFolderRecord();
}
}
示例5: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*/
protected function getButtons()
{
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
// CSH
$cshButton = $buttonBar->makeHelpButton()->setModuleName('_MOD_web_func')->setFieldName('');
$buttonBar->addButton($cshButton);
if ($this->id && is_array($this->pageinfo)) {
// View page
$viewButton = $buttonBar->makeLinkButton()->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage'))->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL))->setHref('#');
$buttonBar->addButton($viewButton);
// Shortcut
$shortcutButton = $buttonBar->makeShortcutButton()->setModuleName($this->moduleName)->setGetVariables(['id', 'edit_record', 'pointer', 'new_unique_uid', 'search_field', 'search_levels', 'showLimit'])->setSetVariables(array_keys($this->MOD_MENU));
$buttonBar->addButton($shortcutButton);
}
}
示例6: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*/
protected function getButtons()
{
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
// CSH
$cshButton = $buttonBar->makeFullyRenderedButton()->setHtmlSource(BackendUtility::cshItem('_MOD_web_func', ''));
$buttonBar->addButton($cshButton);
if ($this->id && is_array($this->pageinfo)) {
// View page
$viewButton = $buttonBar->makeLinkButton()->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true))->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL))->setHref('#');
$buttonBar->addButton($viewButton);
// Shortcut
if ($this->getBackendUser()->mayMakeShortcut()) {
$shortCutButton = $buttonBar->makeFullyRenderedButton()->setHtmlSource($this->moduleTemplate->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->moduleName));
$buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT);
}
}
}
示例7: addToolbarButtons
/**
* Creates the toolbar buttons (TYPO3 7.6+).
*
* @return void
*/
protected function addToolbarButtons()
{
// Render SAVE type buttons:
// The action of each button is decided by its name attribute. (See doProcessData())
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
$saveSplitButton = $buttonBar->makeSplitButton();
// SAVE button:
$saveButton = $buttonBar->makeInputButton()->setTitle($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', true))->setName('_savedok')->setValue('1')->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', \TYPO3\CMS\Core\Imaging\Icon::SIZE_SMALL));
$saveSplitButton->addItem($saveButton, true);
// SAVE & CLOSE button:
$saveAndCloseButton = $buttonBar->makeInputButton()->setName('_saveandclosedok')->setClasses('t3js-editform-submitButton')->setValue('1')->setTitle($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', true))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save-close', \TYPO3\CMS\Core\Imaging\Icon::SIZE_SMALL));
$saveSplitButton->addItem($saveAndCloseButton);
$buttonBar->addButton($saveSplitButton, \TYPO3\CMS\Backend\Template\Components\ButtonBar::BUTTON_POSITION_LEFT, 2);
// CLOSE button:
$closeButton = $buttonBar->makeLinkButton()->setHref('#')->setClasses('t3js-editform-close')->setTitle($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', true))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', \TYPO3\CMS\Core\Imaging\Icon::SIZE_SMALL));
$buttonBar->addButton($closeButton);
$shortcutButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->makeShortcutButton();
$shortcutButton->setModuleName($this->MCONF['name'])->setGetVariables(['returnUrl', 'edit', 'defVals', 'overrideVals', 'columnsOnly', 'returnNewPageId', 'editRegularContentFromId', 'noView']);
$this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($shortcutButton);
}
示例8: 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()
{
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
$lang = $this->getLanguageService();
if ($this->id && $this->access) {
// View page
$viewButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 99);
if ($this->extClassConf['name'] === TypoScriptTemplateInformationModuleFunctionController::class) {
// NEW button
$urlParameters = array('id' => $this->id, 'template' => 'all', 'createExtension' => 'new');
if (!empty($this->e) && !GeneralUtility::_POST('_saveandclosedok')) {
$saveButton = $buttonBar->makeInputButton()->setName('_savedok')->setValue('1')->setForm('TypoScriptTemplateModuleController')->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', Icon::SIZE_SMALL))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc'));
$saveAndCloseButton = $buttonBar->makeInputButton()->setName('_saveandclosedok')->setValue('1')->setForm('TypoScriptTemplateModuleController')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save-close', Icon::SIZE_SMALL));
$splitButtonElement = $buttonBar->makeSplitButton()->addItem($saveButton)->addItem($saveAndCloseButton);
$buttonBar->addButton($splitButtonElement, ButtonBar::BUTTON_POSITION_LEFT, 3);
// CLOSE button
$closeButton = $buttonBar->makeLinkButton()->setHref(BackendUtility::getModuleUrl('web_ts', array('id' => $this->id)))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-close', Icon::SIZE_SMALL));
$buttonBar->addButton($closeButton);
} else {
$newButton = $buttonBar->makeLinkButton()->setHref(BackendUtility::getModuleUrl('web_ts', $urlParameters))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:db_new.php.pagetitle'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-new', Icon::SIZE_SMALL));
$buttonBar->addButton($newButton);
}
} elseif ($this->extClassConf['name'] === TypoScriptTemplateConstantEditorModuleFunctionController::class && !empty($this->MOD_MENU['constant_editor_cat'])) {
// SAVE button
$saveButton = $buttonBar->makeInputButton()->setName('_savedok')->setValue('1')->setForm('TypoScriptTemplateModuleController')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', Icon::SIZE_SMALL))->setShowLabelText(true);
$buttonBar->addButton($saveButton);
} elseif ($this->extClassConf['name'] === TypoScriptTemplateObjectBrowserModuleFunctionController::class) {
if (!empty($this->sObj)) {
// BACK
$urlParameters = array('id' => $this->id);
$backButton = $buttonBar->makeLinkButton()->setHref(BackendUtility::getModuleUrl('web_ts', $urlParameters))->setClasses('typo3-goBack')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
$buttonBar->addButton($backButton);
}
}
}
// Shortcut
$shortcutButton = $buttonBar->makeShortcutButton()->setModuleName($this->MCONF['name'])->setGetVariables(['id', 'M']);
$buttonBar->addButton($shortcutButton);
}
示例9: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*/
protected function getButtons()
{
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
// CSH
$helpButton = $buttonBar->makeHelpButton()->setModuleName('_MOD_' . $this->moduleName)->setFieldName('');
$buttonBar->addButton($helpButton);
// Add and Reload
if (empty($this->CMD) || $this->CMD === 'list' || $this->CMD === 'delete' || $this->CMD === 'stop' || $this->CMD === 'toggleHidden') {
$reloadButton = $buttonBar->makeLinkButton()->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-refresh', Icon::SIZE_SMALL))->setHref($this->moduleUri);
$buttonBar->addButton($reloadButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);
if ($this->MOD_SETTINGS['function'] === 'scheduler' && !empty($this->getRegisteredClasses())) {
$addButton = $buttonBar->makeLinkButton()->setTitle($this->getLanguageService()->getLL('action.add'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-new', Icon::SIZE_SMALL))->setHref($this->moduleUri . '&CMD=add');
$buttonBar->addButton($addButton, ButtonBar::BUTTON_POSITION_LEFT, 2);
}
}
// Close and Save
if ($this->CMD === 'add' || $this->CMD === 'edit') {
// Close
$closeButton = $buttonBar->makeLinkButton()->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:cancel'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-close', Icon::SIZE_SMALL))->setOnClick('document.location=' . GeneralUtility::quoteJSvalue($this->moduleUri))->setHref('#');
$buttonBar->addButton($closeButton, ButtonBar::BUTTON_POSITION_LEFT, 2);
// Save, SaveAndClose, SaveAndNew
$saveButtonDropdown = $buttonBar->makeSplitButton();
$saveButton = $buttonBar->makeInputButton()->setName('CMD')->setValue('save')->setForm('tx_scheduler_form')->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', Icon::SIZE_SMALL))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:save'));
$saveButtonDropdown->addItem($saveButton);
$saveAndNewButton = $buttonBar->makeInputButton()->setName('CMD')->setValue('savenew')->setForm('tx_scheduler_form')->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save-new', Icon::SIZE_SMALL))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:saveAndCreateNewDoc'));
$saveButtonDropdown->addItem($saveAndNewButton);
$saveAndCloseButton = $buttonBar->makeInputButton()->setName('CMD')->setValue('saveclose')->setForm('tx_scheduler_form')->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save-close', Icon::SIZE_SMALL))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:saveAndClose'));
$saveButtonDropdown->addItem($saveAndCloseButton);
$buttonBar->addButton($saveButtonDropdown, ButtonBar::BUTTON_POSITION_LEFT, 3);
}
// Edit
if ($this->CMD === 'edit') {
$deleteButton = $buttonBar->makeInputButton()->setName('CMD')->setValue('delete')->setForm('tx_scheduler_form')->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-edit-delete', Icon::SIZE_SMALL))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:delete'));
$buttonBar->addButton($deleteButton, ButtonBar::BUTTON_POSITION_LEFT, 4);
}
// Shortcut
$shortcutButton = $buttonBar->makeShortcutButton()->setModuleName($this->moduleName)->setDisplayName($this->MOD_MENU['function'][$this->MOD_SETTINGS['function']])->setSetVariables(['function']);
$buttonBar->addButton($shortcutButton);
}
示例10: getDocHeaderButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform
* operations.
*
* @param ModuleTemplate $moduleTemplate
*/
public function getDocHeaderButtons(ModuleTemplate $moduleTemplate)
{
$buttonBar = $moduleTemplate->getDocHeaderComponent()->getButtonBar();
$module = $this->getModule();
$backendUser = $this->getBackendUserAuthentication();
$lang = $this->getLanguageService();
// Get users permissions for this page record:
$localCalcPerms = $backendUser->calcPerms($this->pageRow);
// CSH
if ((string) $this->id === '') {
$fieldName = 'list_module_noId';
} elseif (!$this->id) {
$fieldName = 'list_module_root';
} else {
$fieldName = 'list_module';
}
$cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName($fieldName);
$buttonBar->addButton($cshButton);
if (isset($this->id)) {
// View Exclude doktypes 254,255 Configuration:
// mod.web_list.noViewWithDokTypes = 254,255
if (isset($module->modTSconfig['properties']['noViewWithDokTypes'])) {
$noViewDokTypes = GeneralUtility::trimExplode(',', $module->modTSconfig['properties']['noViewWithDokTypes'], true);
} else {
//default exclusion: doktype 254 (folder), 255 (recycler)
$noViewDokTypes = array(PageRepository::DOKTYPE_SYSFOLDER, PageRepository::DOKTYPE_RECYCLER);
}
// New record on pages that are not locked by editlock
if (!$module->modTSconfig['properties']['noCreateRecordsLink'] && $this->editLockPermissions()) {
$onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['id' => $this->id])) . ');';
$newRecordButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick($onClick)->setTitle($lang->getLL('newRecordGeneral', true))->setIcon($this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL));
$buttonBar->addButton($newRecordButton, ButtonBar::BUTTON_POSITION_LEFT, 10);
}
if (!in_array($this->pageRow['doktype'], $noViewDokTypes)) {
$onClick = BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id));
$viewButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick($onClick)->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true))->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 20);
}
// If edit permissions are set, see
// \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
if ($localCalcPerms & Permission::PAGE_EDIT && !empty($this->id) && $this->editLockPermissions()) {
// Edit
$params = '&edit[pages][' . $this->pageRow['uid'] . ']=edit';
$onClick = BackendUtility::editOnClick($params, '', -1);
$editButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick($onClick)->setTitle($lang->getLL('editPage', true))->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL));
$buttonBar->addButton($editButton, ButtonBar::BUTTON_POSITION_LEFT, 20);
}
// Paste
if (($localCalcPerms & Permission::PAGE_NEW || $localCalcPerms & Permission::CONTENT_EDIT) && $this->editLockPermissions()) {
$elFromTable = $this->clipObj->elFromTable('');
if (!empty($elFromTable)) {
$onClick = 'return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable);
$pasteButton = $buttonBar->makeLinkButton()->setHref($this->clipObj->pasteUrl('', $this->id))->setOnClick($onClick)->setTitle($lang->getLL('clip_paste', true))->setIcon($this->iconFactory->getIcon('actions-document-paste-after', Icon::SIZE_SMALL));
$buttonBar->addButton($pasteButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
}
}
// Cache
$clearCacheButton = $buttonBar->makeLinkButton()->setHref($this->listURL() . '&clear_cache=1')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.clear_cache', true))->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));
$buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT);
if ($this->table && (!isset($module->modTSconfig['properties']['noExportRecordsLinks']) || isset($module->modTSconfig['properties']['noExportRecordsLinks']) && !$module->modTSconfig['properties']['noExportRecordsLinks'])) {
// CSV
$csvButton = $buttonBar->makeLinkButton()->setHref($this->listURL() . '&csv=1')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.csv', true))->setIcon($this->iconFactory->getIcon('actions-document-export-csv', Icon::SIZE_SMALL));
$buttonBar->addButton($csvButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
// Export
if (ExtensionManagementUtility::isLoaded('impexp')) {
$url = BackendUtility::getModuleUrl('xMOD_tximpexp', array('tx_impexp[action]' => 'export'));
$exportButton = $buttonBar->makeLinkButton()->setHref($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.export', true))->setIcon($this->iconFactory->getIcon('actions-document-export-t3d', Icon::SIZE_SMALL));
$buttonBar->addButton($exportButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
}
}
// Reload
$reloadButton = $buttonBar->makeLinkButton()->setHref($this->listURL())->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload', true))->setIcon($this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
$buttonBar->addButton($reloadButton, ButtonBar::BUTTON_POSITION_RIGHT);
// Shortcut
if ($backendUser->mayMakeShortcut()) {
$shortCutButton = $buttonBar->makeShortcutButton()->setModuleName('web_list')->setGetVariables(['id', 'M', 'imagemode', 'pointer', 'table', 'search_field', 'search_levels', 'showLimit', 'sortField', 'sortRev'])->setSetVariables(array_keys($this->MOD_MENU));
$buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT);
}
// Back
if ($this->returnUrl) {
$href = htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id)));
$buttons['back'] = '<a href="' . $href . '" class="typo3-goBack" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true) . '">' . $this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL) . '</a>';
}
}
}
示例11: makeLanguageMenu
/**
* Make the LanguageMenu
*
* @return void
*/
protected function makeLanguageMenu()
{
if (count($this->MOD_MENU['language']) > 1) {
$lang = $this->getLanguageService();
$languageMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
$languageMenu->setIdentifier('languageMenu');
$languageMenu->setLabel($lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.language', true));
foreach ($this->MOD_MENU['language'] as $key => $language) {
$menuItem = $languageMenu->makeMenuItem()->setTitle($language)->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&SET[language]=' . $key);
if ((int) $this->current_sys_language === $key) {
$menuItem->setActive(true);
}
$languageMenu->addMenuItem($menuItem);
}
$this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($languageMenu);
}
}
示例12: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an associated array
*/
protected function getButtons()
{
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
if ($this->getBackendUser()->mayMakeShortcut()) {
$shortcutButton = $buttonBar->makeShortcutButton()->setGetVariables(['tx_impexp'])->setDisplayName($this->shortcutName)->setModuleName($this->moduleName);
$buttonBar->addButton($shortcutButton);
}
// Input data grabbed:
$inData = GeneralUtility::_GP('tx_impexp');
if ((string) $inData['action'] == 'import') {
if ($this->id && is_array($this->pageinfo) || $this->getBackendUser()->user['admin'] && !$this->id) {
if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
// View
$onClick = BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid']));
$viewButton = $buttonBar->makeLinkButton()->setTitle($this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true))->setHref('#')->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL))->setOnClick($onClick);
$buttonBar->addButton($viewButton);
}
}
}
}