當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ModuleTemplate::sectionHeader方法代碼示例

本文整理匯總了PHP中TYPO3\CMS\Backend\Template\ModuleTemplate::sectionHeader方法的典型用法代碼示例。如果您正苦於以下問題:PHP ModuleTemplate::sectionHeader方法的具體用法?PHP ModuleTemplate::sectionHeader怎麽用?PHP ModuleTemplate::sectionHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TYPO3\CMS\Backend\Template\ModuleTemplate的用法示例。


在下文中一共展示了ModuleTemplate::sectionHeader方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: main

 /**
  * Main module function
  *
  * @throws \BadFunctionCallException
  * @throws \InvalidArgumentException
  * @return void
  */
 public function main()
 {
     $this->lang->includeLLFile('EXT:impexp/Resources/Private/Language/locallang.xlf');
     // Start document template object:
     // We keep this here, in case somebody relies on the old doc being here
     $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
     $this->doc->bodyTagId = 'imp-exp-mod';
     $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
     $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
     // Setting up the context sensitive menu:
     $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
     $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Impexp/ImportExport');
     $this->moduleTemplate->addJavaScriptCode('ImpexpInLineJS', 'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';');
     $this->moduleTemplate->setForm('<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('xMOD_tximpexp')) . '" method="post" enctype="multipart/form-data">' . '<input type="hidden" name="id" value="' . $this->id . '" />');
     // Input data grabbed:
     $inData = GeneralUtility::_GP('tx_impexp');
     $this->content .= $this->moduleTemplate->sectionHeader($this->lang->getLL('title_' . (string) $inData['action']));
     $this->content .= '<div style="padding-top: 5px;"></div>';
     $this->checkUpload();
     switch ((string) $inData['action']) {
         case 'export':
             $this->shortcutName = $this->lang->getLL('title_export');
             // Finally: If upload went well, set the new file as the thumbnail in the $inData array:
             if (!empty($this->uploadedFiles[0])) {
                 $inData['meta']['thumbnail'] = $this->uploadedFiles[0]->getCombinedIdentifier();
             }
             // Call export interface
             $this->exportData($inData);
             break;
         case 'import':
             $this->shortcutName = $this->lang->getLL('title_import');
             // Finally: If upload went well, set the new file as the import file:
             if (!empty($this->uploadedFiles[0])) {
                 // Only allowed extensions....
                 if (GeneralUtility::inList('t3d,xml', $this->uploadedFiles[0]->getExtension())) {
                     $inData['file'] = $this->uploadedFiles[0]->getCombinedIdentifier();
                 }
             }
             // Call import interface:
             $this->importData($inData);
             break;
     }
     // Setting up the buttons and markers for docheader
     $this->getButtons();
 }
開發者ID:Audibene-GMBH,項目名稱:TYPO3.CMS,代碼行數:52,代碼來源:ImportExportController.php


注:本文中的TYPO3\CMS\Backend\Template\ModuleTemplate::sectionHeader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。