本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate::getTabMenuRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate::getTabMenuRaw方法的具体用法?PHP DocumentTemplate::getTabMenuRaw怎么用?PHP DocumentTemplate::getTabMenuRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Template\DocumentTemplate
的用法示例。
在下文中一共展示了DocumentTemplate::getTabMenuRaw方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainAction
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request the current request
* @param ResponseInterface $response the prepared response object
* @return ResponseInterface the response with the content
*/
public function mainAction(ServerRequestInterface $request, ResponseInterface $response)
{
$this->determineScriptUrl($request);
$this->initVariables($request);
$this->loadLinkHandlers();
$this->initCurrentUrl();
$menuData = $this->buildMenuArray();
$renderLinkAttributeFields = $this->renderLinkAttributeFields();
$browserContent = $this->displayedLinkHandler->render($request);
$this->initDocumentTemplate();
$content = $this->doc->startPage('Link Browser');
$content .= $this->doc->getFlashMessages();
if ($this->currentLink) {
$content .= '<!-- Print current URL -->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-curUrl">
<tr>
<td>' . $this->getLanguageService()->getLL('currentLink', true) . ': ' . htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) . '</td>
</tr>
</table>';
}
$content .= $this->doc->getTabMenuRaw($menuData);
$content .= $renderLinkAttributeFields;
$content .= '<div class="linkBrowser-tabContent">' . $browserContent . '</div>';
$content .= $this->doc->endPage();
$response->getBody()->write($this->doc->insertStylesAndJS($content));
return $response;
}
示例2: main_rte
/**
* Rich Text Editor (RTE) link selector (MAIN function)
* Generates the link selector for the Rich Text Editor.
* Can also be used to select links for the TCEforms (see $wiz)
*
* @param boolean $wiz If set, the "remove link" is not shown in the menu: Used for the "Select link" wizard which is used by the TCEforms
* @return string Modified content variable.
* @todo Define visibility
*/
public function main_rte($wiz = FALSE)
{
// Starting content:
$content = $this->doc->startPage('RTE link');
// Initializing the action value, possibly removing blinded values etc:
$blindLinkOptions = isset($this->thisConfig['blindLinkOptions']) ? GeneralUtility::trimExplode(',', $this->thisConfig['blindLinkOptions'], TRUE) : array();
$pBlindLinkOptions = isset($this->P['params']['blindLinkOptions']) ? GeneralUtility::trimExplode(',', $this->P['params']['blindLinkOptions']) : array();
$allowedItems = array_diff(array('page', 'file', 'folder', 'url', 'mail', 'spec'), $blindLinkOptions, $pBlindLinkOptions);
// Call hook for extra options
foreach ($this->hookObjects as $hookObject) {
$allowedItems = $hookObject->addAllowedItems($allowedItems);
}
// Removing link fields if configured
$blindLinkFields = isset($this->thisConfig['blindLinkFields']) ? GeneralUtility::trimExplode(',', $this->thisConfig['blindLinkFields'], TRUE) : array();
$pBlindLinkFields = isset($this->P['params']['blindLinkFields']) ? GeneralUtility::trimExplode(',', $this->P['params']['blindLinkFields'], TRUE) : array();
$allowedFields = array_diff(array('target', 'title', 'class', 'params'), $blindLinkFields, $pBlindLinkFields);
// If $this->act is not allowed, default to first allowed
if (!in_array($this->act, $allowedItems)) {
$this->act = reset($allowedItems);
}
// Making menu in top:
$menuDef = array();
if (!$wiz) {
$menuDef['removeLink']['isActive'] = $this->act == 'removeLink';
$menuDef['removeLink']['label'] = $GLOBALS['LANG']->getLL('removeLink', TRUE);
$menuDef['removeLink']['url'] = '#';
$menuDef['removeLink']['addParams'] = 'onclick="self.parent.parent.renderPopup_unLink();return false;"';
}
if (in_array('page', $allowedItems)) {
$menuDef['page']['isActive'] = $this->act == 'page';
$menuDef['page']['label'] = $GLOBALS['LANG']->getLL('page', TRUE);
$menuDef['page']['url'] = '#';
$menuDef['page']['addParams'] = 'onclick="jumpToUrl(' . GeneralUtility::quoteJSvalue('?act=page') . ');return false;"';
}
if (in_array('file', $allowedItems)) {
$menuDef['file']['isActive'] = $this->act == 'file';
$menuDef['file']['label'] = $GLOBALS['LANG']->getLL('file', TRUE);
$menuDef['file']['url'] = '#';
$menuDef['file']['addParams'] = 'onclick="jumpToUrl(' . GeneralUtility::quoteJSvalue('?act=file') . ');return false;"';
}
if (in_array('folder', $allowedItems)) {
$menuDef['folder']['isActive'] = $this->act == 'folder';
$menuDef['folder']['label'] = $GLOBALS['LANG']->getLL('folder', TRUE);
$menuDef['folder']['url'] = '#';
$menuDef['folder']['addParams'] = 'onclick="jumpToUrl(' . GeneralUtility::quoteJSvalue('?act=folder') . ');return false;"';
}
if (in_array('url', $allowedItems)) {
$menuDef['url']['isActive'] = $this->act == 'url';
$menuDef['url']['label'] = $GLOBALS['LANG']->getLL('extUrl', TRUE);
$menuDef['url']['url'] = '#';
$menuDef['url']['addParams'] = 'onclick="jumpToUrl(' . GeneralUtility::quoteJSvalue('?act=url') . ');return false;"';
}
if (in_array('mail', $allowedItems)) {
$menuDef['mail']['isActive'] = $this->act == 'mail';
$menuDef['mail']['label'] = $GLOBALS['LANG']->getLL('email', TRUE);
$menuDef['mail']['url'] = '#';
$menuDef['mail']['addParams'] = 'onclick="jumpToUrl(' . GeneralUtility::quoteJSvalue('?act=mail') . ');return false;"';
}
if (is_array($this->thisConfig['userLinks.']) && in_array('spec', $allowedItems)) {
$menuDef['spec']['isActive'] = $this->act == 'spec';
$menuDef['spec']['label'] = $GLOBALS['LANG']->getLL('special', TRUE);
$menuDef['spec']['url'] = '#';
$menuDef['spec']['addParams'] = 'onclick="jumpToUrl(' . GeneralUtility::quoteJSvalue('?act=spec') . ');return false;"';
}
// Call hook for extra options
foreach ($this->hookObjects as $hookObject) {
$menuDef = $hookObject->modifyMenuDefinition($menuDef);
}
$content .= $this->doc->getTabMenuRaw($menuDef);
// Adding the menu and header to the top of page:
$content .= $this->printCurrentUrl($this->curUrlInfo['info']) . '<br />';
// Depending on the current action we will create the actual module content for selecting a link:
switch ($this->act) {
case 'mail':
$extUrl = '
<!--
Enter mail address:
-->
<form action="" name="lurlform" id="lurlform">
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkMail">
<tr>
<td style="width: 96px;">' . $GLOBALS['LANG']->getLL('emailAddress', TRUE) . ':</td>
<td><input type="text" name="lemail"' . $this->doc->formWidth(20) . ' value="' . htmlspecialchars($this->curUrlInfo['act'] == 'mail' ? $this->curUrlInfo['info'] : '') . '" /> ' . '<input type="submit" value="' . $GLOBALS['LANG']->getLL('setLink', TRUE) . '" onclick="browse_links_setTarget(\'\');browse_links_setValue(\'mailto:\'+' . 'document.lurlform.lemail.value); return link_current();" /></td>
</tr>
</table>
</form>';
$content .= $extUrl;
break;
case 'url':
$extUrl = '
//.........这里部分代码省略.........
示例3: main_rte
/**
* Rich Text Editor (RTE) link selector (MAIN function)
* Generates the link selector for the Rich Text Editor.
* Can also be used to select links for the TCEforms (see $wiz)
*
* @param bool $wiz If set, the "remove link" is not shown in the menu: Used for the "Select link" wizard which is used by the TCEforms
* @return string Modified content variable.
*/
public function main_rte($wiz = FALSE)
{
// Starting content:
$content = $this->doc->startPage('RTE link');
// Add the FlashMessages if any
$content .= $this->doc->getFlashMessages();
$allowedItems = $this->getAllowedItems('page,file,folder,url,mail,spec');
// Removing link fields if configured
$blindLinkFields = isset($this->thisConfig['blindLinkFields']) ? GeneralUtility::trimExplode(',', $this->thisConfig['blindLinkFields'], TRUE) : array();
$pBlindLinkFields = isset($this->P['params']['blindLinkFields']) ? GeneralUtility::trimExplode(',', $this->P['params']['blindLinkFields'], TRUE) : array();
$allowedFields = array_diff(array('target', 'title', 'class', 'params'), $blindLinkFields, $pBlindLinkFields);
$content .= $this->doc->getTabMenuRaw($this->buildMenuArray($wiz, $allowedItems));
// Adding the menu and header to the top of page:
$content .= $this->printCurrentUrl($this->curUrlInfo['info']) . '<br />';
// Depending on the current action we will create the actual module content for selecting a link:
switch ($this->act) {
case 'mail':
$content .= $this->getEmailSelectorHtml();
break;
case 'url':
$content .= $this->getExternalUrlSelectorHtml();
break;
case 'file':
case 'folder':
$content .= $this->getFileSelectorHtml();
break;
case 'spec':
$content .= $this->getUserLinkSelectorHtml();
break;
case 'page':
$content .= $this->getPageSelectorHtml();
break;
default:
// Call hook
foreach ($this->hookObjects as $hookObject) {
$content .= $hookObject->getTab($this->act);
}
}
$lang = $this->getLanguageService();
if (in_array('params', $allowedFields, TRUE)) {
$content .= '
<!--
Selecting params for link:
-->
<form action="" name="lparamsform" id="lparamsform">
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkParams">
<tr>
<td style="width: 96px;">' . $lang->getLL('params', TRUE) . '</td>
<td><input type="text" name="lparams" class="typo3-link-input" onchange="' . 'browse_links_setParams(this.value);" value="' . htmlspecialchars($this->setParams) . '" /></td>
</tr>
</table>
</form>
';
}
if (in_array('class', $allowedFields, TRUE)) {
$content .= '
<!--
Selecting class for link:
-->
<form action="" name="lclassform" id="lclassform">
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkClass">
<tr>
<td style="width: 96px;">' . $lang->getLL('class', TRUE) . '</td>
<td><input type="text" name="lclass" class="typo3-link-input" onchange="' . 'browse_links_setClass(this.value);" value="' . htmlspecialchars($this->setClass) . '" /></td>
</tr>
</table>
</form>
';
}
if (in_array('title', $allowedFields, TRUE)) {
$content .= '
<!--
Selecting title for link:
-->
<form action="" name="ltitleform" id="ltitleform">
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTitle">
<tr>
<td style="width: 96px;">' . $lang->getLL('title', TRUE) . '</td>
<td><input type="text" name="ltitle" class="typo3-link-input" onchange="' . 'browse_links_setTitle(this.value);" value="' . htmlspecialchars($this->setTitle) . '" /></td>
</tr>
</table>
</form>
';
}
// additional fields for page links
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['addFields_PageLink']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['addFields_PageLink'])) {
$conf = array();
$_params = array('conf' => &$conf);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['addFields_PageLink'] as $objRef) {
$processor =& GeneralUtility::getUserObj($objRef);
$content .= $processor->addFields($_params, $this);
}
//.........这里部分代码省略.........
示例4: main_rte
/**
* Rich Text Editor (RTE) link selector (MAIN function)
* Generates the link selector for the Rich Text Editor.
* Can also be used to select links for the TCEforms (see $wiz)
*
* @param bool $wiz If set, the "remove link" is not shown in the menu: Used for the "Select link" wizard which is used by the TCEforms
* @return string Modified content variable.
*/
protected function main_rte($wiz = false)
{
// needs to be executed before doc->startPage()
if (in_array($this->act, array('file', 'folder'))) {
$this->doc->getDragDropCode('folders', 'Tree.ajaxID = "sc_alt_file_navframe_expandtoggle"');
} elseif ($this->act === 'page') {
$this->doc->getDragDropCode('pages');
}
// Starting content:
$content = $this->doc->startPage('RTE link');
// Add the FlashMessages if any
$content .= $this->doc->getFlashMessages();
$content .= $this->doc->getTabMenuRaw($this->buildMenuArray($wiz, $this->getAllowedItems('page,file,folder,url,mail')));
// Adding the menu and header to the top of page:
$content .= $this->printCurrentUrl($this->curUrlInfo['info']) . '<br />';
// Depending on the current action we will create the actual module content for selecting a link:
switch ($this->act) {
case 'mail':
$content .= $this->getEmailSelectorHtml();
break;
case 'url':
$content .= $this->getExternalUrlSelectorHtml();
break;
case 'file':
case 'folder':
$content .= $this->getFileSelectorHtml();
break;
case 'page':
$content .= $this->getPageSelectorHtml();
break;
default:
// Call hook
foreach ($this->hookObjects as $hookObject) {
$content .= $hookObject->getTab($this->act);
}
}
$lang = $this->getLanguageService();
// Removing link fields if configured
$blindLinkFields = isset($this->RTEProperties['default.']['blindLinkFields']) ? GeneralUtility::trimExplode(',', $this->RTEProperties['default.']['blindLinkFields'], true) : array();
$pBlindLinkFields = isset($this->P['params']['blindLinkFields']) ? GeneralUtility::trimExplode(',', $this->P['params']['blindLinkFields'], true) : array();
$allowedFields = array_diff(array('target', 'title', 'class', 'params'), $blindLinkFields, $pBlindLinkFields);
if (in_array('params', $allowedFields, true) && $this->act !== 'url') {
$content .= '
<!--
Selecting params for link:
-->
<form action="" name="lparamsform" id="lparamsform">
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkParams">
<tr>
<td style="width: 96px;">' . $lang->getLL('params', true) . '</td>
<td><input type="text" name="lparams" class="typo3-link-input" onchange="' . 'browse_links_setParams(this.value);" value="' . htmlspecialchars($this->setParams) . '" /></td>
</tr>
</table>
</form>
';
}
if (in_array('class', $allowedFields, true)) {
$content .= '
<!--
Selecting class for link:
-->
<form action="" name="lclassform" id="lclassform">
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkClass">
<tr>
<td style="width: 96px;">' . $lang->getLL('class', true) . '</td>
<td><input type="text" name="lclass" class="typo3-link-input" onchange="' . 'browse_links_setClass(this.value);" value="' . htmlspecialchars($this->setClass) . '" /></td>
</tr>
</table>
</form>
';
}
if (in_array('title', $allowedFields, true)) {
$content .= '
<!--
Selecting title for link:
-->
<form action="" name="ltitleform" id="ltitleform">
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTitle">
<tr>
<td style="width: 96px;">' . $lang->getLL('title', true) . '</td>
<td><input type="text" name="ltitle" class="typo3-link-input" onchange="' . 'browse_links_setTitle(this.value);" value="' . htmlspecialchars($this->setTitle) . '" /></td>
</tr>
</table>
</form>
';
}
// additional fields for page links
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$this->hookName]['addFields_PageLink']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$this->hookName]['addFields_PageLink'])) {
$conf = array();
$_params = array('conf' => &$conf);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$this->hookName]['addFields_PageLink'] as $objRef) {
$processor =& GeneralUtility::getUserObj($objRef);
//.........这里部分代码省略.........