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


PHP ModuleTemplate::getDynamicTabMenu方法代碼示例

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


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

示例1: importData


//.........這裏部分代碼省略.........
						</tr>';
                }
                $menuItems[] = array('label' => $this->lang->getLL('importdata_upload'), 'content' => '
						<table border="0" cellpadding="1" cellspacing="1">
							' . implode('
							', $row) . '
						</table>
					');
            }
            // Perform import or preview depending:
            $overviewContent = '';
            $extensionInstallationMessage = '';
            $inFile = $this->getFile($inData['file']);
            if ($inFile !== null && $inFile->exists()) {
                $trow = array();
                if ($import->loadFile($inFile->getForLocalProcessing(false), 1)) {
                    // Check extension dependencies:
                    $extKeysToInstall = array();
                    if (is_array($import->dat['header']['extensionDependencies'])) {
                        foreach ($import->dat['header']['extensionDependencies'] as $extKey) {
                            if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey)) {
                                $extKeysToInstall[] = $extKey;
                            }
                        }
                    }
                    if (!empty($extKeysToInstall)) {
                        $extensionInstallationMessage = 'Before you can install this T3D file you need to install the extensions "' . implode('", "', $extKeysToInstall) . '".';
                    }
                    if ($inData['import_file']) {
                        if (empty($extKeysToInstall)) {
                            $import->importData($this->id);
                            BackendUtility::setUpdateSignal('updatePageTree');
                        }
                    }
                    $import->display_import_pid_record = $this->pageinfo;
                    $overviewContent = $import->displayContentOverview();
                }
                // Meta data output:
                $trow[] = '<tr class="bgColor5">
						<td colspan="2"><strong>' . $this->lang->getLL('importdata_metaData', true) . '</strong></td>
					</tr>';
                $trow[] = '<tr class="bgColor4">
					<td><strong>' . $this->lang->getLL('importdata_title', true) . '</strong></td>
					<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['title'])) . '</td>
					</tr>';
                $trow[] = '<tr class="bgColor4">
					<td><strong>' . $this->lang->getLL('importdata_description', true) . '</strong></td>
					<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['description'])) . '</td>
					</tr>';
                $trow[] = '<tr class="bgColor4">
					<td><strong>' . $this->lang->getLL('importdata_notes', true) . '</strong></td>
					<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['notes'])) . '</td>
					</tr>';
                $trow[] = '<tr class="bgColor4">
					<td><strong>' . $this->lang->getLL('importdata_packager', true) . '</strong></td>
					<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['packager_name'] . ' (' . $import->dat['header']['meta']['packager_username'] . ')')) . '<br/>
						' . $this->lang->getLL('importdata_email', true) . ' ' . $import->dat['header']['meta']['packager_email'] . '</td>
					</tr>';
                // Thumbnail icon:
                if (is_array($import->dat['header']['thumbnail'])) {
                    $pI = pathinfo($import->dat['header']['thumbnail']['filename']);
                    if (GeneralUtility::inList('gif,jpg,png,jpeg', strtolower($pI['extension']))) {
                        // Construct filename and write it:
                        $fileName = PATH_site . 'typo3temp/importthumb.' . $pI['extension'];
                        GeneralUtility::writeFile($fileName, $import->dat['header']['thumbnail']['content']);
                        // Check that the image really is an image and not a malicious PHP script...
                        if (getimagesize($fileName)) {
                            // Create icon tag:
                            $iconTag = '<img src="../' . PathUtility::stripPathSitePrefix($fileName) . '" ' . $import->dat['header']['thumbnail']['imgInfo'][3] . ' vspace="5" style="border: solid black 1px;" alt="" />';
                            $trow[] = '<tr class="bgColor4">
								<td><strong>' . $this->lang->getLL('importdata_icon', true) . '</strong></td>
								<td>' . $iconTag . '</td>
								</tr>';
                        } else {
                            GeneralUtility::unlink_tempfile($fileName);
                        }
                    }
                }
                $menuItems[] = array('label' => $this->lang->getLL('importdata_metaData_1387'), 'content' => '
						<table border="0" cellpadding="1" cellspacing="1">
							' . implode('
							', $trow) . '
						</table>
					');
            }
            // Print errors that might be:
            $errors = $import->printErrorLog();
            $menuItems[] = array('label' => $this->lang->getLL('importdata_messages'), 'content' => $errors, 'stateIcon' => $errors ? 2 : 0);
            // Output tabs:
            $content = $this->moduleTemplate->getDynamicTabMenu($menuItems, 'tx_impexp_import', 1, false, true, false);
            if ($extensionInstallationMessage) {
                $content = '<div style="border: 1px black solid; margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px;">' . $this->moduleTemplate->icons(1) . htmlspecialchars($extensionInstallationMessage) . '</div>' . $content;
            }
            $this->content .= $this->moduleTemplate->section('', $content, 0, 1);
            // Print overview:
            if ($overviewContent) {
                $this->content .= $this->moduleTemplate->section($inData['import_file'] ? $this->lang->getLL('importdata_structureHasBeenImported', true) : $this->lang->getLL('filterpage_structureToBeImported', true), $overviewContent, 0, 1);
            }
        }
    }
開發者ID:Audibene-GMBH,項目名稱:TYPO3.CMS,代碼行數:101,代碼來源:ImportExportController.php


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