当前位置: 首页>>代码示例>>PHP>>正文


PHP DocumentTemplate::getDragDropCode方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate::getDragDropCode方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate::getDragDropCode方法的具体用法?PHP DocumentTemplate::getDragDropCode怎么用?PHP DocumentTemplate::getDragDropCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Backend\Template\DocumentTemplate的用法示例。


在下文中一共展示了DocumentTemplate::getDragDropCode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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:
        $this->doHighlight = !$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.disableTitleHighlight');
        // Create template object:
        $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_file_navframe.html');
        $this->doc->showFlashMessages = FALSE;
        // Adding javascript code for AJAX (prototype), drag&drop and the filetree as well as the click menu code
        $this->doc->getDragDropCode('folders');
        $this->doc->getContextMenuCode();
        // Setting JavaScript for menu.
        $this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '

		// setting prefs for foldertree
		Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";

		// Function, loading the list frame from navigation tree:
		function jumpTo(id, linkObj, highlightID, bank) {
			var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
			if (theUrl.indexOf("?") != -1) {
				theUrl += "&id=" + id
			} else {
				theUrl += "?id=" + id
			}
			top.fsMod.currentBank = bank;
			top.TYPO3.Backend.ContentContainer.setUrl(theUrl);

			' . ($this->doHighlight ? 'Tree.highlightActiveItem("file", highlightID + "_" + bank);' : '') . '
			if (linkObj) { linkObj.blur(); }
			return false;
		}
		' . ($this->cMR ? ' jumpTo(top.fsMod.recentIds[\'file\'],\'\');' : ''));
    }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:41,代码来源:FileSystemNavigationFrameController.php

示例2: 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;
    }
开发者ID:KarlDennisMatthaei1923,项目名称:PierraaDesign,代码行数:63,代码来源:ElementBrowser.php

示例3: 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:
        $this->doHighlight = !$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.disableTitleHighlight');
        // If highlighting is active, define the CSS class for the active item depending on the workspace
        if ($this->doHighlight) {
            $hlClass = $GLOBALS['BE_USER']->workspace === 0 ? 'active' : 'active active-ws wsver' . $GLOBALS['BE_USER']->workspace;
        }
        // Create template object:
        $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $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 code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
        $this->doc->getDragDropCode('pages');
        $this->doc->getContextMenuCode();
        /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
        $pageRenderer = $this->doc->getPageRenderer();
        $pageRenderer->loadScriptaculous('effects');
        $pageRenderer->loadExtJS();
        if ($this->hasFilterBox) {
            $pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/pagetreefiltermenu.js');
        }
        $this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '
		// setting prefs for pagetree and drag & drop
		' . ($this->doHighlight ? 'Tree.highlightClass = "' . $hlClass . '";' : '') . '

		// Function, loading the list frame from navigation tree:
		function jumpTo(id, linkObj, highlightID, bank) { //
			var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
			if (theUrl.indexOf("?") != -1) {
				theUrl += "&id=" + id
			} else {
				theUrl += "?id=" + id
			}
			top.fsMod.currentBank = bank;
			top.TYPO3.Backend.ContentContainer.setUrl(theUrl);

			' . ($this->doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '') . '
			if (linkObj) { linkObj.blur(); }
			return false;
		}
		' . ($this->cMR ? 'jumpTo(top.fsMod.recentIds[\'web\'],\'\');' : '') . ($this->hasFilterBox ? 'var TYPO3PageTreeFilter = new PageTreeFilter();' : '') . '

		');
        $this->doc->bodyTagId = 'typo3-pagetree';
    }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:54,代码来源:PageTreeNavigationController.php

示例4: 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';
    }
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:52,代码来源:PageTreeNavigationController.php

示例5: 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:
        $this->doHighlight = !$this->getBackendUser()->getTSConfigVal('options.pageTree.disableTitleHighlight');
        // Create template object:
        $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
        $this->doc->bodyTagId = 'ext-backend-Modules-FileSystemNavigationFrame-index-php';
        $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_file_navframe.html');
        $this->doc->showFlashMessages = false;
        // Adding javascript code for drag&drop and the filetree as well as the click menu code
        $dragDropCode = '
			Tree.ajaxID = "sc_alt_file_navframe_expandtoggle";
			Tree.registerDragDropHandlers()';
        if ($this->doHighlight) {
            $hlClass = $this->getBackendUser()->workspace === 0 ? 'active' : 'active active-ws wsver' . $GLOBALS['BE_USER']->workspace;
            $dragDropCode .= '
			Tree.highlightClass = "' . $hlClass . '";
			Tree.highlightActiveItem("", top.fsMod.navFrameHighlightedID["file"]);
			';
        }
        // Adding javascript for drag & drop activation and highlighting
        $this->doc->getDragDropCode('folders', $dragDropCode);
        $this->doc->getContextMenuCode();
        // Setting JavaScript for menu.
        $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);

			' . ($this->doHighlight ? 'Tree.highlightActiveItem("file", highlightID + "_" + bank);' : '') . '
			if (linkObj) { linkObj.blur(); }
			return false;
		}
		' . ($this->cMR ? ' jumpTo(top.fsMod.recentIds[\'file\'],\'\');' : ''));
    }
开发者ID:Gregpl,项目名称:TYPO3.CMS,代码行数:48,代码来源:FileSystemNavigationFrameController.php

示例6: 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:
        $this->doHighlight = !$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.disableTitleHighlight');
        // Create template object:
        $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->setModuleTemplate('templates/alt_file_navframe.html');
        $this->doc->showFlashMessages = FALSE;
        // Adding javascript code for AJAX (prototype), drag&drop and the filetree as well as the click menu code
        $this->doc->getDragDropCode('folders');
        $this->doc->getContextMenuCode();
        // Setting JavaScript for menu.
        $this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '

		function initFlashUploader(path) {
			path = decodeURIComponent(path);
			var flashUploadOptions = {
				uploadURL: top.TS.PATH_typo3 + "ajax.php",
				uploadFileSizeLimit: "' . \TYPO3\CMS\Core\Utility\GeneralUtility::getMaxUploadFileSize() . '",
				uploadFileTypes: {
					allow:  "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['allow'] . '",
					deny: "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['deny'] . '"
				},
				uploadFilePostName: "upload_1",
				uploadPostParams: {
					"file[upload][1][target]": path,
					"file[upload][1][data]": 1,
					"file[upload][1][charset]": "utf-8",
					"ajaxID": "TYPO3_tcefile::process"
				}
			};

				// get the flashUploaderWindow instance from the parent frame
			var flashUploader = top.TYPO3.FileUploadWindow.getInstance(flashUploadOptions);
				// add an additional function inside the container to show the checkbox option
			var infoComponent = new top.Ext.Panel({
				autoEl: { tag: "div" },
				height: "auto",
				bodyBorder: false,
				border: false,
				hideBorders: true,
				cls: "t3-upload-window-infopanel",
				id: "t3-upload-window-infopanel-addition",
				html: \'<label for="overrideExistingFilesCheckbox"><input id="overrideExistingFilesCheckbox" type="checkbox" onclick="setFlashPostOptionOverwriteExistingFiles(this);" />\' + top.String.format(top.TYPO3.LLL.fileUpload.infoComponentOverrideFiles) + \'</label>\'
			});
			flashUploader.add(infoComponent);

				// do a reload of this frame once all uploads are done
			flashUploader.on("totalcomplete", function() {
				jumpTo (top.rawurlencode(path), "", "", "");
			});

				// this is the callback function that delivers the additional post parameter to the flash application
			top.setFlashPostOptionOverwriteExistingFiles = function(checkbox) {
				var uploader = top.TYPO3.getInstance("FileUploadWindow");
				if (uploader.isVisible()) {
					uploader.swf.addPostParam("overwriteExistingFiles", (checkbox.checked == true ? 1 : 0));
				}
			};
		}


		// setting prefs for foldertree
		Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";

		// Function, loading the list frame from navigation tree:
		function jumpTo(id, linkObj, highlightID, bank) {
			var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
			if (theUrl.indexOf("?") != -1) {
				theUrl += "&id=" + id
			} else {
				theUrl += "?id=" + id
			}
			top.fsMod.currentBank = bank;
			top.TYPO3.Backend.ContentContainer.setUrl(theUrl);

			' . ($this->doHighlight ? 'Tree.highlightActiveItem("file", highlightID + "_" + bank);' : '') . '
			' . (!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ') . '
			return false;
		}
		' . ($this->cMR ? ' jumpTo(top.fsMod.recentIds[\'file\'],\'\');' : ''));
    }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:89,代码来源:FileSystemNavigationFrameController.php

示例7: main_folder

    /**
     * TYPO3 Element Browser: Showing a folder tree, allowing you to browse for folders.
     *
     * @return string HTML content for the module
     */
    protected function main_folder()
    {
        // include JS files
        // Setting prefs for foldertree
        $this->doc->getDragDropCode('folders', 'Tree.ajaxID = "sc_alt_file_navframe_expandtoggle";');
        // 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 = ResourceFactory::getInstance()->getFolderObjectFromCombinedIdentifier($this->expandFolder);
        }
        if ($this->selectedFolder) {
            $createFolder = $this->createFolder($this->selectedFolder);
        } else {
            $createFolder = '';
        }
        // Create folder tree:
        /** @var ElementBrowserFolderTreeView $folderTree */
        $folderTree = GeneralUtility::makeInstance(ElementBrowserFolderTreeView::class);
        $folderTree->setLinkParameterProvider($this);
        $folderTree->thisScript = $this->thisScript;
        $folderTree->ext_noTempRecyclerDirs = $this->mode === 'filedrag';
        $tree = $folderTree->getBrowsableTree();
        $folders = '';
        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($this->getLanguageService()->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;
    }
开发者ID:hlop,项目名称:TYPO3.CMS,代码行数:61,代码来源:ElementBrowser.php


注:本文中的TYPO3\CMS\Backend\Template\DocumentTemplate::getDragDropCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。