本文整理汇总了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);
}
}
}