コード例 #1
0
 /**
  * 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', true))->setOnClick($onClick)->setHref('#')->setIcon($this->iconFactory->getIcon('actions-window-open', Icon::SIZE_SMALL));
     $buttonBar->addButton($fullscreenButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);
     // Shortcut
     if ($this->getBackendUser()->mayMakeShortcut()) {
         $shortCutButton = $buttonBar->makeFullyRenderedButton()->setHtmlSource($this->moduleTemplate->makeShortcutIcon('', 'function', $this->moduleName));
         $buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT, 2);
     }
 }
コード例 #2
0
 /**
  * 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);
         }
     }
 }
コード例 #3
0
 /**
  * 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', true))->setIcon($this->iconFactory->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->iconFactory->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', true))->setIcon($this->iconFactory->getIcon('actions-document-close', Icon::SIZE_SMALL))->setOnClick('document.location=' . htmlspecialchars(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')->setIcon($this->iconFactory->getIcon('actions-document-save', Icon::SIZE_SMALL))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:save', true));
         $saveButtonDropdown->addItem($saveButton);
         $saveAndCloseButton = $buttonBar->makeInputButton()->setName('CMD')->setValue('saveclose')->setIcon($this->iconFactory->getIcon('actions-document-save-close', Icon::SIZE_SMALL))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:saveAndClose', true));
         $saveButtonDropdown->addItem($saveAndCloseButton);
         $saveAndNewButton = $buttonBar->makeInputButton()->setName('CMD')->setValue('savenew')->setIcon($this->iconFactory->getIcon('actions-document-save-new', Icon::SIZE_SMALL))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:saveAndCreateNewDoc', true));
         $saveButtonDropdown->addItem($saveAndNewButton);
         $buttonBar->addButton($saveButtonDropdown, ButtonBar::BUTTON_POSITION_LEFT, 3);
     }
     // Edit
     if ($this->CMD === 'edit') {
         $deleteButton = $buttonBar->makeInputButton()->setName('CMD')->setValue('delete')->setIcon($this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:delete', true));
         $buttonBar->addButton($deleteButton, ButtonBar::BUTTON_POSITION_LEFT, 4);
     }
     // Shortcut
     if ($this->getBackendUser()->mayMakeShortcut()) {
         $shortCutButton = $buttonBar->makeFullyRenderedButton()->setHtmlSource($this->moduleTemplate->makeShortcutIcon('', 'function', $this->moduleName));
         $buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT, 2);
     }
 }
コード例 #4
0
ファイル: DatabaseRecordList.php プロジェクト: hlop/TYPO3.CMS
 /**
  * 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
     $cshButton = $buttonBar->makeFullyRenderedButton();
     if ((string) $this->id === '') {
         $cshButton->setHtmlSource(BackendUtility::cshItem('xMOD_csh_corebe', 'list_module_noId'));
     } elseif (!$this->id) {
         $cshButton->setHtmlSource(BackendUtility::cshItem('xMOD_csh_corebe', 'list_module_root'));
     } else {
         $cshButton->setHtmlSource(BackendUtility::cshItem('xMOD_csh_corebe', 'list_module'));
     }
     $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);
         }
         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);
         }
         // 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);
         }
         // 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);
             }
         }
         // 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);
             // 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);
             }
         }
         // 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->makeFullyRenderedButton()->setHtmlSource($moduleTemplate->makeShortcutIcon('id, imagemode, pointer, table, search_field, search_levels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_list'));
             $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>';
         }
     }
 }
コード例 #5
0
 /**
  * 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', true))->setIcon($this->iconFactory->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')->setIcon($this->iconFactory->getIcon('actions-document-save', Icon::SIZE_SMALL))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', true));
                 $saveAndCloseButton = $buttonBar->makeInputButton()->setName('_saveandclosedok')->setValue('1')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', true))->setIcon($this->iconFactory->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', true))->setIcon($this->iconFactory->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', true))->setIcon($this->iconFactory->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')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', true))->setIcon($this->iconFactory->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', true))->setIcon($this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
                 $buttonBar->addButton($backButton);
             }
         }
     }
     // Shortcut
     if ($this->getBackendUser()->mayMakeShortcut()) {
         $shortcutButton = $buttonBar->makeFullyRenderedButton()->setHtmlSource($this->moduleTemplate->makeShortcutIcon('id', '', $this->MCONF['name']));
         $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT, 99);
     }
 }