本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate::funcMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate::funcMenu方法的具体用法?PHP DocumentTemplate::funcMenu怎么用?PHP DocumentTemplate::funcMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Template\DocumentTemplate
的用法示例。
在下文中一共展示了DocumentTemplate::funcMenu方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main function of the module. Write the content to $this->content.
*
* @return void
*/
public function main()
{
$backendUser = $this->getBackendUser();
$language = $this->getLanguageService();
// Access check!
// The page will show only if there is a valid page and if
// this page may be viewed by the user
$this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
$access = is_array($this->pageinfo);
// Checking access:
if ($this->id && $access || $backendUser->isAdmin()) {
// Render content:
$this->moduleContent();
} else {
// If no access or if ID == zero
$this->content .= $this->doc->header($language->getLL('statistic'));
}
$docHeaderButtons = $this->getHeaderButtons();
$markers = array('CSH' => $docHeaderButtons['csh'], 'CONTENT' => $this->content);
$markers['FUNC_MENU'] = $this->doc->funcMenu('', \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']));
// put it all together
$this->content = $this->doc->startPage($language->getLL('statistic'));
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例2: main
/**
* Main method.
*
* @return void
*/
public function main()
{
$listUrl = GeneralUtility::getIndpEnv('REQUEST_URI');
// Access check!
// The page will show only if there is a valid page and if user may access it
if ($this->id && (is_array($this->pageRow) ? 1 : 0)) {
// JavaScript
$this->doc->JScode = $this->doc->wrapScriptTags('
script_ended = 0;
function jumpToUrl(URL) {
document.location = URL;
}
function deleteRecord(table, id, url, warning) {
if (
confirm(eval(warning))
) {
window.location.href = "' . $this->getBackPath() . 'tce_db.php?cmd["+table+"]["+id+"][delete]=1&redirect="+escape(url);
}
return false;
}
' . $this->doc->redirectUrls($listUrl) . '
');
$this->doc->postCode = $this->doc->wrapScriptTags('
script_ended = 1;
if (top.fsMod) {
top.fsMod.recentIds["web"] = ' . (int) $this->id . ';
}
');
$this->doc->inDocStylesArray['mod_systemdata'] = '';
// Render content:
$this->moduleContent();
} else {
$this->content = 'Access denied or commerce pages not created yet!';
}
$docHeaderButtons = $this->getHeaderButtons();
$markers = array('CSH' => $docHeaderButtons['csh'], 'CONTENT' => $this->content);
$markers['FUNC_MENU'] = $this->doc->funcMenu('', BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']));
// put it all together
$this->content = $this->doc->startPage($this->getLanguageService()->getLL('title'));
$this->content .= $this->doc->moduleBody($this->pageRow, $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例3: main
//.........这里部分代码省略.........
ul {
list-style:none;
margin:0;
padding:0;
}
a.buttons, a.buttons_db {
-moz-border-radius:1px 1px 1px 1px;
BACKGROUND-IMAGE: url(' . $this->FULL_HTTP_URL . 'typo3/sysext/t3skin/images/backgrounds/button.png);
background-color:#F6F6F6;
background-image:-moz-linear-gradient(center top , #F6F6F6 10%, #D5D5D5 90%);
background-position:center bottom;
background-repeat:repeat-x;
border:1px solid #7C7C7C;
color:#434343;
display:block;
padding:2px 4px;
text-align:center;
font-family:Verdana,Arial,Helvetica,sans-serif;
font-size:11px;
line-height:16px;
}
a.buttons:hover, a.buttons_db:hover {
BACKGROUND-IMAGE: url(' . $this->FULL_HTTP_URL . 'typo3/sysext/t3skin/images/backgrounds/button-hover.png);
background-color:#C8C8C8;
background-image:-moz-linear-gradient(center top , #F6F6F6 10%, #BDBCBC 90%);
background-position:center bottom;
background-repeat:repeat-x;
border:1px solid #737F91;
color:#1E1E1E;
}
a.buttons {
width:142px;
}
a.buttons_db {
width:126px;
}
fieldset.mod1MultishopFieldset ul { overflow:hidden; width:100%; }
fieldset.mod1MultishopFieldset ul li { float:left; margin:0 10px 0 0; }
</style>
<!--[if IE]>
<style>
fieldset {
position: relative;
padding-top:15px;
margin:20px 0 0;
}
legend {
position: absolute;
top: -10px;
left: 10px;
}
</style>
<![endif]-->
<script language="javascript" type="text/javascript">
script_ended = 0;
function jumpToUrl(URL) {
document.location = URL;
}
function CONFIRM(label)
{
if (confirm(label))
{
return true;
}
else
{
return false;
}
}
</script>
';
$this->doc->postCode = '
<script language="javascript" type="text/javascript">
script_ended = 1;
if (top.fsMod) top.fsMod.recentIds["web"] = 0;
</script>
';
$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], 50);
$this->content .= $this->doc->startPage($LANG->getLL('title'));
$this->content .= $this->doc->header($LANG->getLL('title'));
$this->content .= $this->doc->spacer(5);
$this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
$this->content .= $this->doc->divider(5);
// Render content:
$this->moduleContent();
// ShortCut
if ($BE_USER->mayMakeShortcut()) {
$this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
}
$this->content .= $this->doc->spacer(10);
} else {
// If no access or if ID == zero
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('mediumDoc');
$this->doc->backPath = $BACK_PATH;
$this->content .= $this->doc->startPage($LANG->getLL('title'));
$this->content .= $this->doc->header($LANG->getLL('title'));
$this->content .= $this->doc->spacer(5);
$this->content .= $this->doc->spacer(10);
}
}
示例4: showCopyWizard
//.........这里部分代码省略.........
} elseif (0 < $l) {
// at least 1 item - offer choice
$icon = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' alt="" title="Insert the category" />';
$prodIcon = \TYPO3\CMS\Backend\Utility\IconUtility::getIconImage('tx_commerce_products', array('uid' => $uidTarget), $this->doc->backPath, 'align="top" class="c-recIcon"');
$str .= '<h1>' . $language->getLL('copy.position') . '</h1>';
$onClickAction = 'onclick="submitForm(' . $records['pid'][$uidTarget][0]['uid'] . ')"';
$str .= '<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
for ($i = 0; $i < $l; $i++) {
$record = $records['pid'][$uidTarget][$i];
$onClickAction = 'onclick="submitForm(-' . $record['uid'] . ')"';
$str .= '<span class="nobr">' . $prodIcon . $record['title'] . '</span><br />';
$str .= '<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
}
} else {
$noActionReq = TRUE;
}
break;
case 'pasteCategory':
// chose locale to copy from category
/**
* Category
*
* @var Tx_Commerce_Domain_Model_Category $category
*/
$category = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Domain_Model_Category', $uidClip);
$category->loadData();
$cats = $category->getL18nCategories();
if (0 != count($cats)) {
$str .= '<h1>' . $language->getLL('copy.head.l18n') . '</h1>
<h2>' . $language->getLL('copy.category') . ': ' . $category->getTitle() . '</h2>
<ul>';
// walk the l18n and get the selector box
$l = count($cats);
for ($i = 0; $i < $l; $i++) {
$tmpCat = $cats[$i];
$flag = $tmpCat['flag'] != '' ? '<img src="' . $this->doc->backPath . 'gfx/flags/' . $tmpCat['flag'] . '" alt="Flag" />' : '';
$str .= '<li><input type="checkbox" name="locale[]" id="loc_' . $tmpCat['uid'] . '" value="' . $tmpCat['sys_language'] . '" /><label for="loc_' . $tmpCat['uid'] . '">' . $flag . $tmpCat['title'] . '</label></li>';
}
$str .= '</ul>';
}
// chose sorting position
// Initialize tree object:
/**
* Category data
*
* @var Tx_Commerce_Tree_Leaf_CategoryData $treedb
*/
$treedb = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Tree_Leaf_CategoryData');
$treedb->init();
$records = $treedb->getRecordsDbList($uidTarget);
$l = count($records['pid'][$uidTarget]);
// Hook: beforeFormClose
$userIgnoreClose = FALSE;
foreach ($hookObjectsArr as $hookObj) {
if (method_exists($hookObj, 'beforeFormClose')) {
$str .= $hookObj->beforeFormClose($uidClip, $uidTarget, $command, $userIgnoreClose);
}
}
if (0 == $l && (0 != count($cats) || $userIgnoreClose)) {
// no child object - sorting position is irrelevant - just print a submit button
$str .= '<input type="submit" value="' . $language->getLL('copy.submit') . '" />';
} elseif (0 < $l) {
// at least 1 item - offer choice
$icon = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' alt="" title="Insert the category" />';
$catIcon = \TYPO3\CMS\Backend\Utility\IconUtility::getIconImage('tx_commerce_categories', array('uid' => $uidTarget), $this->doc->backPath, 'align="top" class="c-recIcon"');
$str .= '<h1>' . $language->getLL('copy.position') . '</h1>';
$onClickAction = 'onclick="submitForm(' . $records['pid'][$uidTarget][0]['uid'] . ')"';
$str .= '<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
for ($i = 0; $i < $l; $i++) {
$record = $records['pid'][$uidTarget][$i];
$onClickAction = 'onclick="submitForm(-' . $record['uid'] . ')"';
$str .= '<span class="nobr">' . $catIcon . $record['title'] . '</span><br />
<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
}
} else {
$noActionReq = TRUE;
}
break;
default:
die('unknown command');
}
// skip transforming and execute the command
// if there are no locales and no positions
if ($noActionReq) {
$this->commitCommand($uidClip, $uidTarget, $command);
return;
}
// Hook: beforeTransform
foreach ($hookObjectsArr as $hookObj) {
if (method_exists($hookObj, 'beforeTransform')) {
$str .= $hookObj->beforeTransform($uidClip, $uidTarget, $command);
}
}
$this->content .= $str;
$markers = array('CSH' => '', 'CONTENT' => $this->content, 'CATINFO' => '', 'CATPATH' => '');
$markers['FUNC_MENU'] = $this->doc->funcMenu('', \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[mode]', $this->MOD_SETTINGS['mode'], $this->MOD_MENU['mode']));
$this->content = $this->doc->startPage($language->getLL('Copy'));
$this->content .= $this->doc->moduleBody($this->pageinfo, array(), $markers);
$this->content .= $this->doc->endPage();
}
示例5: showCopyWizard
//.........这里部分代码省略.........
} elseif (0 < $l) {
// at least 1 item - offer choice
$icon = '<img' . IconUtility::skinImg($this->getBackPath(), 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' alt="" title="Insert the category" />';
$prodIcon = '<img' . IconUtility::skinImg($this->getBackPath(), IconUtility::getIcon('tx_commerce_products', array('uid' => $uidTarget)), 'width="18" height="16"') . 'align="top" class="c-recIcon"/>';
$str .= '<h1>' . $language->getLL('copy.position') . '</h1>';
$onClickAction = 'onclick="submitForm(' . $records['pid'][$uidTarget][0]['uid'] . ')"';
$str .= '<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
for ($i = 0; $i < $l; ++$i) {
$record = $records['pid'][$uidTarget][$i];
$onClickAction = 'onclick="submitForm(-' . $record['uid'] . ')"';
$str .= '<span class="nobr">' . $prodIcon . $record['title'] . '</span><br />';
$str .= '<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
}
} else {
$noActionReq = true;
}
break;
case 'pasteCategory':
// chose locale to copy from category
/**
* Category.
*
* @var \CommerceTeam\Commerce\Domain\Model\Category $category
*/
$category = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Model\\Category', $uidClip);
$category->loadData();
$cats = $category->getL18nCategories();
if (!empty($cats)) {
$str .= '<h1>' . $language->getLL('copy.head.l18n') . '</h1>
<h2>' . $language->getLL('copy.category') . ': ' . $category->getTitle() . '</h2>
<ul>';
// walk the l18n and get the selector box
$l = count($cats);
for ($i = 0; $i < $l; ++$i) {
$tmpCat = $cats[$i];
$flag = $tmpCat['flag'] != '' ? '<img src="' . $this->getBackPath() . 'gfx/flags/' . $tmpCat['flag'] . '" alt="Flag" />' : '';
$str .= '<li><input type="checkbox" name="locale[]" id="loc_' . $tmpCat['uid'] . '" value="' . $tmpCat['sys_language'] . '" /><label for="loc_' . $tmpCat['uid'] . '">' . $flag . $tmpCat['title'] . '</label></li>';
}
$str .= '</ul>';
}
// chose sorting position
// Initialize tree object:
/**
* Category data.
*
* @var \CommerceTeam\Commerce\Tree\Leaf\CategoryData $categoryData
*/
$categoryData = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Tree\\Leaf\\CategoryData');
$categoryData->init();
$records = $categoryData->getRecordsDbList($uidTarget);
$l = count($records['pid'][$uidTarget]);
// Hook: beforeFormClose
$userIgnoreClose = false;
foreach ($hooks as $hookObj) {
if (method_exists($hookObj, 'beforeFormClose')) {
$str .= $hookObj->beforeFormClose($uidClip, $uidTarget, $command, $userIgnoreClose);
}
}
if ($l == 0 && (!empty($cats) || $userIgnoreClose)) {
// no child object - sorting position is irrelevant - just print a submit button
$str .= '<input type="submit" value="' . $language->getLL('copy.submit') . '" />';
} elseif (0 < $l) {
// at least 1 item - offer choice
$icon = '<img' . IconUtility::skinImg($this->getBackPath(), 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' alt="" title="Insert the category" />';
$catIcon = '<img' . IconUtility::skinImg($this->getBackPath(), IconUtility::getIcon('tx_commerce_categories', array('uid' => $uidTarget)), 'width="18" height="16"') . 'align="top" class="c-recIcon"/>';
$str .= '<h1>' . $language->getLL('copy.position') . '</h1>';
$onClickAction = 'onclick="submitForm(' . $records['pid'][$uidTarget][0]['uid'] . ')"';
$str .= '<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
for ($i = 0; $i < $l; ++$i) {
$record = $records['pid'][$uidTarget][$i];
$onClickAction = 'onclick="submitForm(-' . $record['uid'] . ')"';
$str .= '<span class="nobr">' . $catIcon . $record['title'] . '</span><br />
<span class="nobr"><a href="javascript:void(0)" ' . $onClickAction . '>' . $icon . '</a></span><br />';
}
} else {
$noActionReq = true;
}
break;
default:
die('unknown command');
}
// skip transforming and execute the command
// if there are no locales and no positions
if ($noActionReq) {
$this->commitCommand($uidClip, $uidTarget, $command);
return;
}
// Hook: beforeTransform
foreach ($hooks as $hookObj) {
if (method_exists($hookObj, 'beforeTransform')) {
$str .= $hookObj->beforeTransform($uidClip, $uidTarget, $command);
}
}
$this->content .= $str;
$markers = array('CSH' => '', 'CONTENT' => $this->content, 'CATINFO' => '', 'CATPATH' => '');
$markers['FUNC_MENU'] = $this->doc->funcMenu('', \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[mode]', $this->MOD_SETTINGS['mode'], $this->MOD_MENU['mode']));
$this->content = $this->doc->startPage($language->getLL('Copy'));
$this->content .= $this->doc->moduleBody($this->pageinfo, array(), $markers);
$this->content .= $this->doc->endPage();
}