本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate::getDynamicTabMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate::getDynamicTabMenu方法的具体用法?PHP DocumentTemplate::getDynamicTabMenu怎么用?PHP DocumentTemplate::getDynamicTabMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Template\DocumentTemplate
的用法示例。
在下文中一共展示了DocumentTemplate::getDynamicTabMenu方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createTabs
/**
* Create tabs to split the report and the checkLink functions
*
* @return string
*/
protected function createTabs()
{
$menuItems = array(0 => array('label' => $this->getLanguageService()->getLL('Report'), 'content' => $this->flush(TRUE)));
if ((bool) $this->modTS['showCheckLinkTab']) {
$menuItems[1] = array('label' => $this->getLanguageService()->getLL('CheckLink'), 'content' => $this->flush());
}
return $this->doc->getDynamicTabMenu($menuItems, 'report-linkvalidator');
}
示例2: main
//.........这里部分代码省略.........
}
// Add document inline javascript
$this->doc->JScode = $this->doc->wrapScriptTags('
function goToalt_doc() { //
' . $this->onClickEvent . '
}
if(top.refreshMenu) {
top.refreshMenu();
} else {
top.TYPO3ModuleMenu.refreshMenu();
}
');
// Traverse items for the wizard.
// An item is either a header or an item rendered with a radio button and title/description and icon:
$cc = $key = 0;
$menuItems = array();
foreach ($wizardItems as $k => $wInfo) {
if ($wInfo['header']) {
$menuItems[] = array('label' => htmlspecialchars($wInfo['header']), 'content' => $this->elementWrapper['section'][0]);
$key = count($menuItems) - 1;
} else {
$content = '';
if (!$this->onClickEvent) {
// Radio button:
$oC = 'document.editForm.defValues.value=unescape(' . GeneralUtility::quoteJSvalue(rawurlencode($wInfo['params'])) . ');goToalt_doc();' . (!$this->onClickEvent ? 'window.location.hash=\'#sel2\';' : '');
$content .= '<div class="media-left"><input type="radio" name="tempB" value="' . htmlspecialchars($k) . '" onclick="' . htmlspecialchars($oC) . '" /></div>';
// Onclick action for icon/title:
$aOnClick = 'document.getElementsByName(\'tempB\')[' . $cc . '].checked=1;' . $oC . 'return false;';
} else {
$aOnClick = "document.editForm.defValues.value=unescape('" . rawurlencode($wInfo['params']) . "');goToalt_doc();" . (!$this->onClickEvent ? "window.location.hash='#sel2';" : '');
}
$icon = $wInfo['icon'];
if (strpos($wInfo['icon'], '..') === FALSE) {
$icon = GeneralUtility::getFileAbsFileName($icon, TRUE, TRUE);
$icon = substr($icon, strlen(PATH_typo3));
}
$menuItems[$key]['content'] .= '
<div class="media">
' . $content . '
<div class="media-left">
<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">
<img' . IconUtility::skinImg($this->doc->backPath, $icon) . ' alt="" />
</a>
</div>
<div class="media-body">
<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">
<strong>' . htmlspecialchars($wInfo['title']) . '</strong>
<br />' . nl2br(htmlspecialchars(trim($wInfo['description']))) . '</a>
</div>
</div>';
$cc++;
}
}
// Add closing section-tag
foreach ($menuItems as $key => $val) {
$menuItems[$key]['content'] .= $this->elementWrapper['section'][1];
}
// Add the wizard table to the content, wrapped in tabs:
if ($this->config['renderMode'] == 'tabs') {
$code = '<p>' . $lang->getLL('sel1', 1) . '</p>' . $this->doc->getDynamicTabMenu($menuItems, 'new-content-element-wizard');
} else {
$code = '<p>' . $lang->getLL('sel1', 1) . '</p>';
foreach ($menuItems as $section) {
$code .= '<h3 class="divider">' . $section['label'] . '</h3>' . $section['content'];
}
}
$this->content .= $this->doc->section(!$this->onClickEvent ? $lang->getLL('1_selectType') : '', $code, 0, 1);
// If the user must also select a column:
if (!$this->onClickEvent) {
// Add anchor "sel2"
$this->content .= $this->doc->section('', '<a name="sel2"></a>');
// Select position
$code = '<p>' . $lang->getLL('sel2', 1) . '</p>';
// Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
$colPosArray = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $this->id, $this);
$colPosIds = array_column($colPosArray, 1);
// Removing duplicates, if any
$colPosList = implode(',', array_unique(array_map('intval', $colPosIds)));
// Finally, add the content of the column selector to the content:
$code .= $posMap->printContentElementColumns($this->id, 0, $colPosList, 1, $this->R_URI);
$this->content .= $this->doc->section($lang->getLL('2_selectPosition'), $code, 0, 1);
}
} else {
// In case of no access:
$this->content = '';
$this->content .= $this->doc->header($lang->getLL('newContentElement'));
$this->content .= $this->doc->spacer(5);
}
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers['CSH'] = $docHeaderButtons['csh'];
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->startPage($lang->getLL('newContentElement'));
$this->content .= $this->doc->moduleBody($this->pageInfo, $docHeaderButtons, $markers);
$this->content .= $this->doc->sectionEnd();
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例3: main
/**
* Generate the main settings form:
*
* @return void
*/
public function main()
{
if ($this->languageUpdate) {
$this->doc->JScodeArray['languageUpdate'] .= '
if (top.refreshMenu) {
top.refreshMenu();
} else {
top.TYPO3ModuleMenu.refreshMenu();
}
';
}
if ($this->pagetreeNeedsRefresh) {
BackendUtility::setUpdateSignal('updatePageTree');
}
// Start page:
$this->doc->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/md5.js');
// Use a wrapper div
$this->content .= '<div id="user-setup-wrapper">';
// Load available backend modules
$this->loadModules = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Module\ModuleLoader::class);
$this->loadModules->observeWorkspaces = TRUE;
$this->loadModules->load($GLOBALS['TBE_MODULES']);
$this->content .= $this->doc->header($this->getLanguageService()->getLL('UserSettings'));
// Show if setup was saved
if ($this->setupIsUpdated && !$this->tempDataIsCleared && !$this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('setupWasUpdated'), $this->getLanguageService()->getLL('UserSettings'));
$this->content .= $flashMessage->render();
}
// Show if temporary data was cleared
if ($this->tempDataIsCleared) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('tempDataClearedFlashMessage'), $this->getLanguageService()->getLL('tempDataCleared'));
$this->content .= $flashMessage->render();
}
// Show if temporary data was cleared
if ($this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('settingsAreReset'), $this->getLanguageService()->getLL('resetConfiguration'));
$this->content .= $flashMessage->render();
}
// Notice
if ($this->setupIsUpdated || $this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('activateChanges'), '', FlashMessage::INFO);
$this->content .= $flashMessage->render();
}
// If password is updated, output whether it failed or was OK.
if ($this->passwordIsSubmitted) {
$flashMessage = NULL;
switch ($this->passwordIsUpdated) {
case self::PASSWORD_OLD_WRONG:
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('oldPassword_failed'), $this->getLanguageService()->getLL('newPassword'), FlashMessage::ERROR);
break;
case self::PASSWORD_NOT_THE_SAME:
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('newPassword_failed'), $this->getLanguageService()->getLL('newPassword'), FlashMessage::ERROR);
break;
case self::PASSWORD_UPDATED:
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('newPassword_ok'), $this->getLanguageService()->getLL('newPassword'));
break;
}
if ($flashMessage) {
$this->content .= $flashMessage->render();
}
}
// Render user switch
$this->content .= $this->renderSimulateUserSelectAndLabel();
// Render the menu items
$menuItems = $this->renderUserSetup();
$this->content .= $this->doc->getDynamicTabMenu($menuItems, 'user-setup', 1, FALSE, FALSE);
$formToken = $this->formProtection->generateToken('BE user setup', 'edit');
$this->content .= $this->doc->section('', '<input type="hidden" name="simUser" value="' . $this->simUser . '" />
<input type="hidden" name="formToken" value="' . $formToken . '" />
<input type="hidden" value="1" name="data[save]" />
<input type="hidden" name="data[setValuesToDefault]" value="0" id="setValuesToDefault" />
<input type="hidden" name="data[clearSessionVars]" value="0" id="clearSessionVars" />');
// End of wrapper div
$this->content .= '</div>';
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers['CSH'] = $docHeaderButtons['csh'];
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
// Renders the module page
$this->content = $this->doc->render($this->getLanguageService()->getLL('UserSettings'), $this->content);
}