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


PHP template::getContextMenuCode方法代码示例

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


在下文中一共展示了template::getContextMenuCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()
    {
        global $BE_USER;
        // Setting highlight mode:
        $this->doHighlight = !$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 = $BE_USER->workspace === 0 ? 'active' : 'active active-ws wsver' . $BE_USER->workspace;
        }
        // Create template object:
        $this->doc = t3lib_div::makeInstance('template');
        $this->doc->backPath = $BACK_PATH;
        $this->doc->setModuleTemplate('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();
        $this->doc->getPageRenderer()->loadScriptaculous('effects');
        $this->doc->getPageRenderer()->loadExtJS();
        $this->doc->getPageRenderer()->addJsFile('js/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;

			if (top.TYPO3.configuration.condensedMode) {
				top.content.location.href = theUrl;
			} else {
				parent.list_frame.location.href=theUrl;
			}

			' . ($this->doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '') . '
			' . (!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : '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:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:56,代码来源:alt_db_navframe.php

示例2: init

 /**
  * Initialization of the class
  *
  * @return	void
  */
 public function init()
 {
     // Setting GPvars:
     $this->id = intval(t3lib_div::_GP('id'));
     $this->edit = t3lib_div::_GP('edit');
     $this->return_id = t3lib_div::_GP('return_id');
     $this->lastEdited = t3lib_div::_GP('lastEdited');
     // Module name;
     $this->MCONF = $GLOBALS['MCONF'];
     // Page select clause:
     $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
     // Initializing document template object:
     $this->doc = t3lib_div::makeInstance('template');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setModuleTemplate('templates/perm.html');
     $this->doc->form = '<form action="' . $GLOBALS['BACK_PATH'] . 'tce_db.php" method="post" name="editform">';
     $this->doc->loadJavascriptLib('../t3lib/jsfunc.updateform.js');
     $this->doc->getPageRenderer()->loadPrototype();
     $this->doc->loadJavascriptLib(TYPO3_MOD_PATH . 'perm.js');
     // Setting up the context sensitive menu:
     $this->doc->getContextMenuCode();
     // Set up menus:
     $this->menuConfig();
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:29,代码来源:index.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()
    {
        global $BE_USER, $BACK_PATH, $CLIENT;
        // Setting highlight mode:
        $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
        // Create template object:
        $this->doc = t3lib_div::makeInstance('template');
        $this->doc->backPath = $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: "' . t3lib_div::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;

			if (top.TYPO3.configuration.condensedMode) {
				top.content.location.href = theUrl;
			} else {
				parent.list_frame.location.href=theUrl;
			}

			' . ($this->doHighlight ? 'Tree.highlightActiveItem("file", highlightID + "_" + bank);' : '') . '
			' . (!$CLIENT['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ') . '
			return false;
		}
		' . ($this->cMR ? " jumpTo(top.fsMod.recentIds['file'],'');" : ''));
    }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:95,代码来源:alt_file_navframe.php

示例4: main


//.........这里部分代码省略.........
				function jumpToUrl(URL)	{	//
					window.location.href = URL;
					return false;
				}
				function jumpExt(URL,anchor)	{	//
					var anc = anchor?anchor:"";
					window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;
					return false;
				}
				function jumpSelf(URL)	{	//
					window.location.href = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:"");
					return false;
				}

				function setHighlight(id)	{	//
					top.fsMod.recentIds["web"]=id;
					top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_"+top.fsMod.currentBank;	// For highlighting

					if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav)	{
						top.content.nav_frame.refresh_nav();
					}
				}
				' . $this->doc->redirectUrls($dblist->listURL()) . '
				' . $dblist->CBfunctions() . '
				function editRecords(table,idList,addParams,CBflag)	{	//
					window.location.href="' . $BACK_PATH . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '&edit["+table+"]["+idList+"]=edit"+addParams;
				}
				function editList(table,idList)	{	//
					var list="";

						// Checking how many is checked, how many is not
					var pointer=0;
					var pos = idList.indexOf(",");
					while (pos!=-1)	{
						if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) {
							list+=idList.substr(pointer,pos-pointer)+",";
						}
						pointer=pos+1;
						pos = idList.indexOf(",",pointer);
					}
					if (cbValue(table+"|"+idList.substr(pointer))) {
						list+=idList.substr(pointer)+",";
					}

					return list ? list : idList;
				}

				if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
			');
            // Setting up the context sensitive menu:
            $this->doc->getContextMenuCode();
        }
        // access
        // Begin to compile the whole page, starting out with page header:
        $this->body = '';
        $this->body .= '<form action="' . htmlspecialchars($dblist->listURL()) . '" method="post" name="dblistForm">';
        $this->body .= $dblist->HTMLcode;
        $this->body .= '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" /></form>';
        // If a listing was produced, create the page footer with search form etc:
        if ($dblist->HTMLcode) {
            // Making field select box (when extended view for a single table is enabled):
            if ($dblist->table) {
                $this->body .= $dblist->fieldSelectBox($dblist->table);
            }
            // Adding checkbox options for extended listing and clipboard display:
            $this->body .= '

					<!--
						Listing options for clipboard and thumbnails
					-->
					<div id="typo3-listOptions">
						<form action="" method="post">';
            $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkLargeControl"') . ' <label for="checkLargeControl">' . $LANG->getLL('largeControl', 1) . '</label><br />';
            if ($dblist->showClipboard) {
                $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkShowClipBoard"') . ' <label for="checkShowClipBoard">' . $LANG->getLL('showClipBoard', 1) . '</label><br />';
            }
            $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[localization]', $this->MOD_SETTINGS['localization'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkLocalization"') . ' <label for="checkLocalization">' . $LANG->getLL('localization', 1) . '</label><br />';
            $this->body .= '
						</form>
					</div>';
            $this->body .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_options', $GLOBALS['BACK_PATH']);
            // Printing clipboard if enabled:
            if ($this->MOD_SETTINGS['clipBoard'] && $dblist->showClipboard) {
                $this->body .= $dblist->clipObj->printClipboard();
                $this->body .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_clipboard', $GLOBALS['BACK_PATH']);
            }
            // Search box:
            $this->body .= $dblist->getSearchBox();
            // Display sys-notes, if any are found:
            $this->body .= $dblist->showSysNotesForPage();
        }
        // Setting up the buttons and markers for docheader
        $docHeaderButtons = $dblist->getButtons();
        $markers = array('CSH' => $docHeaderButtons['csh'], 'CONTENT' => $this->body);
        // Build the <body> for the module
        $this->content = $this->doc->startPage('DB list');
        $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:101,代码来源:db_list.php

示例5: main


//.........这里部分代码省略.........
            }
            if (!$this->MOD_SETTINGS['clipBoard']) {
                $CB['setP'] = 'normal';
            }
            $this->filelist->clipObj->setCmd($CB);
            $this->filelist->clipObj->cleanCurrent();
            $this->filelist->clipObj->endClipboard();
            // Saves
            // If the "cmd" was to delete files from the list (clipboard thing), do that:
            if ($this->cmd == 'delete') {
                $items = $this->filelist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'), '_FILE', 1);
                if (count($items)) {
                    // Make command array:
                    $FILE = array();
                    foreach ($items as $v) {
                        $FILE['delete'][] = array('data' => $v);
                    }
                    // Init file processing object for deleting and pass the cmd array.
                    $fileProcessor = t3lib_div::makeInstance('t3lib_extFileFunctions');
                    $fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']);
                    $fileProcessor->init_actionPerms($GLOBALS['BE_USER']->getFileoperationPermissions());
                    $fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0;
                    $fileProcessor->start($FILE);
                    $fileProcessor->processData();
                    $fileProcessor->printLogErrorMessages();
                }
            }
            if (!isset($this->MOD_SETTINGS['sort'])) {
                // Set default sorting
                $this->MOD_SETTINGS['sort'] = 'file';
                $this->MOD_SETTINGS['reverse'] = 0;
            }
            // Start up filelisting object, include settings.
            $this->pointer = t3lib_div::intInRange($this->pointer, 0, 100000);
            $this->filelist->start($this->id, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']);
            // Generate the list
            $this->filelist->generateList();
            // Write the footer
            $this->filelist->writeBottom();
            // Set top JavaScript:
            $this->doc->JScode = $this->doc->wrapScriptTags('

			if (top.fsMod) top.fsMod.recentIds["file"] = unescape("' . rawurlencode($this->id) . '");
			function jumpToUrl(URL)	{	//
				window.location.href = URL;
			}

			' . $this->filelist->CBfunctions());
            // This will return content necessary for the context sensitive clickmenus to work: bodytag events, JavaScript functions and DIV-layers.
            $this->doc->getContextMenuCode();
            // Setting up the buttons and markers for docheader
            list($buttons, $otherMarkers) = $this->filelist->getButtonsAndOtherMarkers($this->id);
            // add the folder info to the marker array
            $otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo();
            $docHeaderButtons = array_merge($this->getButtons(), $buttons);
            // Build the <body> for the module
            // Create output
            $pageContent = '';
            $pageContent .= '<form action="' . htmlspecialchars($this->filelist->listURL()) . '" method="post" name="dblistForm">';
            $pageContent .= $this->filelist->HTMLcode;
            $pageContent .= '<input type="hidden" name="cmd" /></form>';
            if ($this->filelist->HTMLcode) {
                // Making listing options:
                $pageContent .= '

					<!--
						Listing options for extended view, clipboard and thumbnails
					-->
					<div id="typo3-listOptions">
				';
                // Add "display bigControlPanel" checkbox:
                if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable') {
                    $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], 'file_list.php', '', 'id="bigControlPanel"') . '<label for="bigControlPanel"> ' . $GLOBALS['LANG']->getLL('bigControlPanel', TRUE) . '</label><br />';
                }
                // Add "display thumbnails" checkbox:
                if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable') {
                    $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[displayThumbs]', $this->MOD_SETTINGS['displayThumbs'], 'file_list.php', '', 'id="checkDisplayThumbs"') . ' <label for="checkDisplayThumbs">' . $GLOBALS['LANG']->getLL('displayThumbs', TRUE) . '</label><br />';
                }
                // Add "clipboard" checkbox:
                if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableClipBoard') === 'selectable') {
                    $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], 'file_list.php', '', 'id="checkClipBoard"') . ' <label for="checkClipBoard">' . $GLOBALS['LANG']->getLL('clipBoard', TRUE) . '</label>';
                }
                $pageContent .= '
					</div>
				';
                // Set clipboard:
                if ($this->MOD_SETTINGS['clipBoard']) {
                    $pageContent .= $this->filelist->clipObj->printClipboard();
                    $pageContent .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_clipboard', $GLOBALS['BACK_PATH']);
                }
            }
            $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent);
            $this->content = $this->doc->moduleBody(array(), $docHeaderButtons, array_merge($markerArray, $otherMarkers));
            // Renders the module page
            $this->content = $this->doc->render($LANG->getLL('files'), $this->content);
        } else {
            // Create output - no access (no warning though)
            $this->content = $this->doc->render($LANG->getLL('files'), '');
        }
    }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:file_list.php


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