本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate::wrapScriptTags方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate::wrapScriptTags方法的具体用法?PHP DocumentTemplate::wrapScriptTags怎么用?PHP DocumentTemplate::wrapScriptTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Template\DocumentTemplate
的用法示例。
在下文中一共展示了DocumentTemplate::wrapScriptTags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initialize script class
*
* @return void
* @todo Define visibility
*/
public function init()
{
// Setting target, which must be a file reference to a file within the mounts.
$this->target = $this->origTarget = $fileIdentifier = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('target');
$this->returnUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('returnUrl'));
// create the file object
if ($fileIdentifier) {
$this->fileObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($fileIdentifier);
}
// Cleaning and checking target directory
if (!$this->fileObject) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
$message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
throw new \RuntimeException($title . ': ' . $message, 1294586841);
}
// Setting the title and the icon
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
$this->title = $icon . htmlspecialchars($this->fileObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->fileObject->getIdentifier());
// ***************************
// Setting template object
// ***************************
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_edit.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->JScode = $this->doc->wrapScriptTags('
function backToList() { //
top.goToModule("file_list");
}
');
$this->doc->form = '<form action="tce_file.php" method="post" name="editform">';
}
示例2: init
/**
* Initialize.
*
* @return void
*/
protected function init()
{
// Start the template object:
$this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->bodyTagMargins['x'] = 5;
$this->doc->bodyTagMargins['y'] = 5;
$this->doc->backPath = $GLOBALS['BACK_PATH'];
// Add JS
$this->doc->JScode = $this->doc->wrapScriptTags('
function jump(url, modName, mainModName) {
// clear information about which entry in nav. tree that might have been highlighted.
top.fsMod.navFrameHighlightedID = [];
if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
top.content.nav_frame.refresh_nav();
}
top.nextLoadModuleUrl = url;
top.goToModule(modName);
}
');
// Start the page:
$this->content = '';
$this->content .= $this->doc->startPage('TYPO3 Edit Document');
// Loads the backend modules available for the logged in user.
$this->loadModules = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Module\\ModuleLoader');
$this->loadModules->load($GLOBALS['TBE_MODULES']);
}
示例3: init
/**
* Initialize script class
*
* @return void
* @throws \TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException
*/
protected function init()
{
// Setting target, which must be a file reference to a file within the mounts.
$this->target = $this->origTarget = $fileIdentifier = GeneralUtility::_GP('target');
$this->returnUrl = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'));
// create the file object
if ($fileIdentifier) {
$this->fileObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($fileIdentifier);
}
// Cleaning and checking target directory
if (!$this->fileObject) {
$title = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:paramError', TRUE);
$message = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:targetNoDir', TRUE);
throw new \RuntimeException($title . ': ' . $message, 1294586841);
}
if ($this->fileObject->getStorage()->getUid() === 0) {
throw new \TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException('You are not allowed to access files outside your storages', 1375889832);
}
// Setting the title and the icon
$icon = IconUtility::getSpriteIcon('apps-filetree-root');
$this->title = $icon . htmlspecialchars($this->fileObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->fileObject->getIdentifier());
// Setting template object
$this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_edit.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->JScode = $this->doc->wrapScriptTags('
function backToList() { //
top.goToModule("file_list");
}
');
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform">';
}
示例4: main
/**
* Main function, rendering the browsable page tree
*
* @return void
*/
public function main()
{
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'doktype = 254 AND module in (\'dmail\')' . BackendUtility::deleteClause('pages'), '', 'title');
$out = '';
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (BackendUtility::readPageAccess($row['uid'], $GLOBALS['BE_USER']->getPagePermsClause(1))) {
$icon = $iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL)->render();
$out .= '<tr onmouseover="this.style.backgroundColor=\'' . GeneralUtility::modifyHTMLColorAll($this->doc->bgColor, -5) . '\'" onmouseout="this.style.backgroundColor=\'\'">' . '<td id="dmail_' . $row['uid'] . '" >
<a href="#" onclick="top.fsMod.recentIds[\'txdirectmailM1\']=' . $row['uid'] . ';jumpTo(\'id=' . $row['uid'] . '\',this,\'dmail_' . $row['uid'] . '\');">' . $icon . ' ' . htmlspecialchars($row['title']) . '</a></td></tr>';
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$content = '<table cellspacing="0" cellpadding="0" border="0" width="100%">' . $out . '</table>';
// Adding highlight - JavaScript
if ($this->doHighlight) {
$content .= $this->doc->wrapScriptTags('
hilight_row("",top.fsMod.navFrameHighlightedID["web"]);
');
}
$docHeaderButtons = array('CSH' => BackendUtility::cshItem('_MOD_txdirectmailM1', 'folders', $GLOBALS['BACK_PATH'], TRUE), 'REFRESH' => '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('unique' => uniqid('directmail_navframe')))) . '">' . $iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL) . '</a>');
$markers = array('HEADLINE' => '', 'CONTENT' => $this->getLanguageService()->getLL('dmail_folders') . $content);
// Build the <body> for the module
$this->content = $this->doc->startPage('TYPO3 Direct Mail Navigation');
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
}
示例5: main
/**
* Main function, rendering the browsable page tree
*
* @return void
* @todo Define visibility
*/
public function main()
{
// Produce browse-tree:
$tree = $this->pagetree->getBrowsableTree();
// Outputting Temporary DB mount notice:
if ($this->active_tempMountPoint) {
$flashText = '
<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('setTempDBmount' => 0))) . '">' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount', 1) . '</a> <br />' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_core.xml:labels.path', 1) . ': <span title="' . htmlspecialchars($this->active_tempMountPoint['_thePathFull']) . '">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->active_tempMountPoint['_thePath'], -50)) . '</span>
';
$flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $flashText, '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
$this->content .= $flashMessage->render();
}
// Outputting page tree:
$this->content .= '<div id="PageTreeDiv">' . $tree . '</div>';
// Adding javascript for drag & drop activation and highlighting
$this->content .= $this->doc->wrapScriptTags('
' . ($this->doHighlight ? 'Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);' : '') . '
Tree.registerDragDropHandlers();');
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers = array('IMG_RESET' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close', array('id' => 'treeFilterReset', 'alt' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter'), 'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter'))), 'WORKSPACEINFO' => $this->getWorkspaceInfo(), 'CONTENT' => $this->content);
$subparts = array();
if (!$this->hasFilterBox) {
$subparts['###SECOND_ROW###'] = '';
}
// Build the <body> for the module
$this->content = $this->doc->startPage('TYPO3 Page Tree');
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers, $subparts);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例6: main
/**
* Initialize module header etc and call extObjContent function
*
* @return void
*/
public function main()
{
// 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 = BackendUtility::readPageAccess($this->id, $this->perms_clause);
$access = is_array($this->pageinfo);
// Template markers
$markers = array('CSH' => '', 'FUNC_MENU' => '', 'CONTENT' => '');
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('EXT:func/Resources/Private/Templates/func.html');
// Main
if ($this->id && $access) {
// JavaScript
$this->doc->postCode = $this->doc->wrapScriptTags('if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';');
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('web_func')) . '" method="post"><input type="hidden" name="id" value="' . htmlspecialchars($this->id) . '" />';
$vContent = $this->doc->getVersionSelector($this->id, TRUE);
if ($vContent) {
$this->content .= $this->doc->section('', $vContent);
}
$this->extObjContent();
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers['CSH'] = $docHeaderButtons['csh'];
$markers['FUNC_MENU'] = BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
$markers['CONTENT'] = $this->content;
} else {
// If no access or if ID == zero
$title = $this->getLanguageService()->getLL('title');
$message = $this->getLanguageService()->getLL('clickAPage_content');
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:func/Resources/Private/Templates/InfoBox.html'));
$view->assignMultiple(array('title' => $title, 'message' => $message, 'state' => InfoboxViewHelper::STATE_INFO));
$this->content = $view->render();
// 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('title'), $this->content);
}
示例7: main_folder
/**
* TYPO3 Element Browser: Showing a folder tree, allowing you to browse for folders.
*
* @return string HTML content for the module
* @todo Define visibility
*/
public function main_folder()
{
// include JS files
$this->doc->getDragDropCode('folders');
// Setting prefs for foldertree
$this->doc->JScode .= $this->doc->wrapScriptTags('
Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
');
// Starting content:
$content = $this->doc->startPage('TBE folder selector');
// Add the FlashMessages if any
$content .= $this->doc->getFlashMessages();
// Init variable:
$parameters = explode('|', $this->bparams);
if ($this->expandFolder) {
$this->selectedFolder = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFolderObjectFromCombinedIdentifier($this->expandFolder);
}
if ($this->selectedFolder) {
$createFolder = $this->createFolder($this->selectedFolder);
} else {
$createFolder = '';
}
// Create folder tree:
$folderTree = GeneralUtility::makeInstance('TBE_FolderTree');
$folderTree->thisScript = $this->thisScript;
$folderTree->ext_noTempRecyclerDirs = $this->mode == 'filedrag';
$tree = $folderTree->getBrowsableTree(FALSE);
list(, , $specUid) = explode('_', $this->PM);
if ($this->selectedFolder) {
if ($this->mode == 'filedrag') {
$folders = $this->TBE_dragNDrop($this->selectedFolder, $parameters[3]);
} else {
$folders = $this->TBE_expandSubFolders($this->selectedFolder);
}
}
// Putting the parts together, side by side:
$content .= '
<!--
Wrapper table for folder tree / folder list:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-EBfiles">
<tr>
<td class="c-wCell" valign="top">' . $this->barheader($GLOBALS['LANG']->getLL('folderTree') . ':') . $tree . '</td>
<td class="c-wCell" valign="top">' . $folders . '</td>
</tr>
</table>
';
// Adding create folder if applicable:
$content .= $createFolder;
// Add some space
$content .= '<br /><br />';
// Ending page, returning content:
$content .= $this->doc->endPage();
$content = $this->doc->insertStylesAndJS($content);
return $content;
}
示例8: loadSettings
/**
* Load the settings
*
* The settings are defined in pageTSconfig mod.wizards.form
*
* @return void
*/
protected function loadSettings()
{
$record = $this->repository->getRecord();
$pageId = $record->getPageId();
$modTSconfig = BackendUtility::getModTSconfig($pageId, 'mod.wizards.form');
$settings = $modTSconfig['properties'];
$this->removeTrailingDotsFromTyposcript($settings);
$this->doc->JScode .= $this->doc->wrapScriptTags('TYPO3.Form.Wizard.Settings = ' . json_encode($settings) . ';');
}
示例9: init
/**
* @return [type] ...
* @todo Define visibility
*/
public function init()
{
$this->editorNo = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('editorNo');
$this->siteUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->bodyTagAdditions = 'onload="Init();"';
$this->doc->form = '
<form action="" id="process" name="process" method="post">
<input type="hidden" name="processContent" value="" />
<input type="hidden" name="returnUrl" value="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) . '" />
';
$JScode = '
var plugin = window.parent.RTEarea[' . GeneralUtility::quoteJSvalue($this->editorNo) . '].editor.getPlugin("UserElements");
var HTMLArea = window.parent.HTMLArea;
var editor = plugin.editor;
function Init() {
};
function insertHTML(content,noHide) {
plugin.restoreSelection();
editor.getSelection().insertHtml(content);
if(!noHide) plugin.close();
};
function wrapHTML(wrap1,wrap2,noHide) {
plugin.restoreSelection();
if(!editor.getSelection().isEmpty()) {
editor.getSelection().surroundHtml(wrap1,wrap2);
} else {
alert(' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->getLL('noTextSelection')) . ');
}
if(!noHide) plugin.close();
};
function processSelection(script) {
plugin.restoreSelection();
document.process.action = script;
document.process.processContent.value = editor.getSelection().getHtml();
document.process.submit();
};
function jumpToUrl(URL) {
var RTEtsConfigParams = "&RTEtsConfigParams=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('RTEtsConfigParams')) . '";
var editorNo = "&editorNo=' . rawurlencode($this->editorNo) . '";
theLocation = URL+RTEtsConfigParams+editorNo;
window.location.href = theLocation;
}
';
// unset the default jumpToUrl() function
unset($this->doc->JScodeArray['jumpToUrl']);
$this->doc->JScode = $this->doc->wrapScriptTags($JScode);
$this->modData = $GLOBALS['BE_USER']->getModuleData('user.php', 'ses');
if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('OC_key')) {
$parts = explode('|', \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('OC_key'));
$this->modData['openKeys'][$parts[1]] = $parts[0] == 'O' ? 1 : 0;
$GLOBALS['BE_USER']->pushModuleData('user.php', $this->modData);
}
}
示例10: main
/**
* Initialize module header etc and call extObjContent function
*
* @return void
*/
public function main()
{
// 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 = BackendUtility::readPageAccess($this->id, $this->perms_clause);
$access = is_array($this->pageinfo);
if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
$this->CALC_PERMS = $GLOBALS['BE_USER']->calcPerms($this->pageinfo);
if ($GLOBALS['BE_USER']->user['admin'] && !$this->id) {
$this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
}
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('EXT:info/Resources/Private/Templates/info.html');
$this->doc->tableLayout = array('0' => array('0' => array('<td valign="top"><strong>', '</strong></td>'), 'defCol' => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><strong>', '</strong></td>')), 'defRow' => array('0' => array('<td valign="top">', '</td>'), 'defCol' => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top">', '</td>')));
// JavaScript
$this->doc->postCode = $this->doc->wrapScriptTags('if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';');
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('web_info')) . '" method="post" name="webinfoForm">';
$vContent = $this->doc->getVersionSelector($this->id, 1);
if ($vContent) {
$this->content .= $this->doc->section('', $vContent);
}
$this->extObjContent();
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $this->content);
// Build the <body> for the module
$this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
} else {
// If no access or if ID == zero
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->content = $this->doc->header($GLOBALS['LANG']->getLL('title'));
$this->content .= $this->doc->spacer(5);
$this->content .= $this->doc->spacer(10);
}
// Renders the module page
$this->content = $this->doc->render($GLOBALS['LANG']->getLL('title'), $this->content);
}
示例11: workspaceSelector
/**
* Create selector for workspaces and change workspace if command is given to do that.
*
* @return string HTML
* @todo Define visibility
*/
public function workspaceSelector()
{
// Changing workspace and if so, reloading entire backend:
if (strlen($this->changeWorkspace)) {
$GLOBALS['BE_USER']->setWorkspace($this->changeWorkspace);
return $this->doc->wrapScriptTags('top.location.href="' . \TYPO3\CMS\Backend\Utility\BackendUtility::getBackendScript() . '";');
}
// Changing workspace and if so, reloading entire backend:
if (strlen($this->changeWorkspacePreview)) {
$GLOBALS['BE_USER']->setWorkspacePreview($this->changeWorkspacePreview);
}
// Create options array:
$options = array();
if ($GLOBALS['BE_USER']->checkWorkspace(array('uid' => 0))) {
$options[0] = '[' . $GLOBALS['LANG']->getLL('bookmark_onlineWS') . ']';
}
if ($GLOBALS['BE_USER']->checkWorkspace(array('uid' => -1))) {
$options[-1] = '[' . $GLOBALS['LANG']->getLL('bookmark_offlineWS') . ']';
}
// Add custom workspaces (selecting all, filtering by BE_USER check):
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('workspaces')) {
$workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers', 'sys_workspace', 'pid=0' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_workspace'), '', 'title');
if (count($workspaces)) {
foreach ($workspaces as $rec) {
if ($GLOBALS['BE_USER']->checkWorkspace($rec)) {
$options[$rec['uid']] = $rec['uid'] . ': ' . $rec['title'];
}
}
}
}
// Build selector box:
if (count($options)) {
foreach ($options as $value => $label) {
$selected = (int) $GLOBALS['BE_USER']->workspace === $value ? ' selected="selected"' : '';
$options[$value] = '<option value="' . htmlspecialchars($value) . '"' . $selected . '>' . htmlspecialchars($label) . '</option>';
}
} else {
$options[] = '<option value="-99">' . $GLOBALS['LANG']->getLL('bookmark_noWSfound', 1) . '</option>';
}
$selector = '';
// Preview:
if ($GLOBALS['BE_USER']->workspace !== 0) {
$selector .= '<label for="workspacePreview">Frontend Preview:</label> <input type="checkbox" name="workspacePreview" id="workspacePreview" onclick="changeWorkspacePreview(' . ($GLOBALS['BE_USER']->user['workspace_preview'] ? 0 : 1) . ')"; ' . ($GLOBALS['BE_USER']->user['workspace_preview'] ? 'checked="checked"' : '') . '/> ';
}
$selector .= '<a href="mod/user/ws/index.php" target="content">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('sys_workspace', array()) . '</a>';
if (count($options) > 1) {
$selector .= '<select name="_workspaceSelector" onchange="changeWorkspace(this.options[this.selectedIndex].value);">' . implode('', $options) . '</select>';
}
return $selector;
}
示例12: main
/**
* Main function, creating the content for the access editing forms/listings
*
* @return void
*/
public function main()
{
// 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 || $GLOBALS['BE_USER']->isAdmin() && !$this->id) {
if ($GLOBALS['BE_USER']->isAdmin() && !$this->id) {
$this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
}
// This decides if the editform can and will be drawn:
$this->editingAllowed = $this->pageinfo['perms_userid'] == $GLOBALS['BE_USER']->user['uid'] || $GLOBALS['BE_USER']->isAdmin();
$this->edit = $this->edit && $this->editingAllowed;
// If $this->edit then these functions are called in the end of the page...
if ($this->edit) {
$this->doc->postCode .= $this->doc->wrapScriptTags('
setCheck("check[perms_user]", "data[pages][' . $this->id . '][perms_user]");
setCheck("check[perms_group]", "data[pages][' . $this->id . '][perms_group]");
setCheck("check[perms_everybody]", "data[pages][' . $this->id . '][perms_everybody]");
');
}
// Draw the HTML page header.
$this->content .= $this->doc->header($GLOBALS['LANG']->getLL('permissions') . ($this->edit ? ': ' . $GLOBALS['LANG']->getLL('Edit') : ''));
$this->content .= $this->doc->spacer(5);
$vContent = $this->doc->getVersionSelector($this->id, 1);
if ($vContent) {
$this->content .= $this->doc->section('', $vContent);
}
// Main function, branching out:
if (!$this->edit) {
$this->notEdit();
} else {
$this->doEdit();
}
$docHeaderButtons = $this->getButtons();
$markers['CSH'] = $this->docHeaderButtons['csh'];
$markers['FUNC_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[mode]', $this->MOD_SETTINGS['mode'], $this->MOD_MENU['mode']);
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
} else {
// If no access or if ID == zero
$this->content = $this->doc->header($GLOBALS['LANG']->getLL('permissions'));
}
// Renders the module page
$this->content = $this->doc->render($GLOBALS['LANG']->getLL('permissions'), $this->content);
}
示例13: initPage
/**
* Initialization for the visual parts of the class
* Use template rendering only if this is a non-AJAX call
*
* @return void
*/
public function initPage()
{
// Setting highlight mode:
$doHighlight = !$this->getBackendUser()->getTSConfigVal('options.pageTree.disableTitleHighlight');
// Create template object:
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_db_navframe.html');
$this->doc->showFlashMessages = FALSE;
// Get HTML-Template
// Adding javascript for drag & drop activation and highlighting
$dragDropCode = 'Tree.registerDragDropHandlers();';
// If highlighting is active, define the CSS class for the active item depending on the workspace
if ($doHighlight) {
$hlClass = $this->getBackendUser()->workspace === 0 ? 'active' : 'active active-ws wsver' . $this->getBackendUser()->workspace;
$dragDropCode .= '
Tree.highlightClass = "' . $hlClass . '";
Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);';
}
// Adding javascript code for drag&drop and the pagetree as well as the click menu code
$this->doc->getDragDropCode('pages', $dragDropCode);
$this->doc->getContextMenuCode();
/** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
$pageRenderer = $this->doc->getPageRenderer();
$pageRenderer->loadExtJS();
$this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '
// Function, loading the list frame from navigation tree:
function jumpTo(id, linkObj, highlightID, bank) { //
var theUrl = top.currentSubScript ;
if (theUrl.indexOf("?") != -1) {
theUrl += "&id=" + id
} else {
theUrl += "?id=" + id
}
top.fsMod.currentBank = bank;
top.TYPO3.Backend.ContentContainer.setUrl(theUrl);
' . ($doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '') . '
if (linkObj) { linkObj.blur(); }
return false;
}
' . ($this->cMR ? 'jumpTo(top.fsMod.recentIds[\'web\'],\'\');' : '') . '
');
$this->doc->bodyTagId = 'typo3-pagetree';
}
示例14: 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);
}
示例15: main
/**
* Main Method, rendering either colorpicker or frameset depending on ->showPicker
*
* @return void
*/
public function main()
{
// Show frameset by default:
if (!GeneralUtility::_GP('showPicker')) {
$this->frameSet();
} else {
// Putting together the items into a form:
$content = '
<form name="colorform" method="post" action="' . htmlspecialchars(BackendUtility::getModuleUrl('wizard_colorpicker')) . '">
' . $this->colorMatrix() . '
' . $this->colorList() . '
' . $this->colorImage() . '
<!-- Value box: -->
<p class="c-head">' . $GLOBALS['LANG']->getLL('colorpicker_colorValue', TRUE) . '</p>
<table border="0" cellpadding="0" cellspacing="3">
<tr>
<td><input type="text" ' . $this->doc->formWidth(7) . ' maxlength="10" name="colorValue" value="' . htmlspecialchars($this->colorValue) . '" /></td>
<td style="background-color:' . htmlspecialchars($this->colorValue) . '; border: 1px solid black;"> <span style="color: black;">' . $GLOBALS['LANG']->getLL('colorpicker_black', TRUE) . '</span> <span style="color: white;">' . $GLOBALS['LANG']->getLL('colorpicker_white', TRUE) . '</span> </td>
<td><input type="submit" name="save_close" value="' . $GLOBALS['LANG']->getLL('colorpicker_setClose', TRUE) . '" /></td>
</tr>
</table>
<!-- Hidden fields with values that has to be kept constant -->
<input type="hidden" name="showPicker" value="1" />
<input type="hidden" name="fieldChangeFunc" value="' . htmlspecialchars($this->fieldChangeFunc) . '" />
<input type="hidden" name="fieldChangeFuncHash" value="' . htmlspecialchars($this->fieldChangeFuncHash) . '" />
<input type="hidden" name="fieldName" value="' . htmlspecialchars($this->fieldName) . '" />
<input type="hidden" name="formName" value="' . htmlspecialchars($this->formName) . '" />
<input type="hidden" name="md5ID" value="' . htmlspecialchars($this->md5ID) . '" />
<input type="hidden" name="exampleImg" value="' . htmlspecialchars($this->exampleImg) . '" />
</form>';
// If the save/close button is clicked, then close:
if (GeneralUtility::_GP('save_close')) {
$content .= $this->doc->wrapScriptTags('
setValue(' . GeneralUtility::quoteJSvalue($this->colorValue) . ');
parent.close();
');
}
// Output:
$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('colorpicker_title'), $content, 0, 1);
}
}