help.js
资源名称:ioffice-e.rar [点击查看]
上传用户:kaisitong
上传日期:2022-01-01
资源大小:3672k
文件大小:33k
源码类别:
OA系统
开发平台:
ASP/ASPX
- function startMenu() {
- // /菜单参数
- imageDirectory = 'img'; ////图片目录
- menuTree = new obj_collection()
- defineMenuItems(menuTree)
- if (definitionsHaveErrors(menuTree) == false) {createAppearanceArray(menuTree,menuTree.itemWithID('root'));
- treeVariable = menuTree;
- expandNode('root');
- expandNode('ioffice')
- //expandNode('sysset')
- }
- }
- // OBJ_NODE - 定义结点对象
- // ID = 每个结点的绝对标记
- // NAME = 菜单上显示的结点名称
- // PARENTID = 父结点的标记
- // TYPE = 可以是文档,文件夹或者根结点
- // URL = 结点对应的连接
- // ALTIMAGE = 16x16 GIF文件(不用于文件夹folders)
- // POSITION = 结点的位置
- // TARGET = 需要在Frame打开时,为空表示在当前页面打开。
- // _top 表示整页面打开。
- function obj_node(id,name,parentID,type,url,altImage,position,target) {
- this.id = id.toLowerCase();
- this.name = name;
- this.parentID = parentID.toLowerCase();
- this.type = type.toLowerCase();
- this.url = url;
- this.altImage = altImage;
- this.position = position;
- this.target = target;
- }
- // OBJ_COLLECTION function - defines a new collection
- function obj_collection() {
- this.addItem = addItem;
- this.itemWithID = itemWithID;
- this.itemIDExists = itemIDExists;
- this.extractExpandableNodes = extractExpandableNodes;
- this.posOfItemWithID = posOfItemWithID;
- this.length = 0;
- return this
- }
- // OBJ_ARRAY function - defines a fixed size array
- function obj_array(size) {
- this.length = size;
- this.itemWithID = itemWithID;
- this.itemIDExists = itemIDExists;
- this.posOfItemWithID = posOfItemWithID;
- return this
- }
- // OBJ_NODEAPPEARANCE - defines the appearance of a menu node (using images)
- function obj_appearanceNode(id,imageSequence,name,parentID,type,url,target,visable) {
- this.id = id;
- this.imageSequence = imageSequence;
- this.name = name;
- this.parentID = parentID;
- this.type = type;
- this.url = url;
- this.target = target;
- this.visable = visable;
- return this
- }
- // createAppearanceArray() function - this function looks at the menu node definitions,
- // works out how they all fit together, and determines the
- // image sequence needed to show their position on the menu
- // tree. This is then stored in the appearanceArray.
- function createAppearanceArray(treeVariable,startNode) {
- appearanceArray = new obj_array(treeVariable.length);
- appearancePos = 1;
- if (startNode.type == 'page') {alert("The createAppearanceArray() function can only be called on a root or folder node.")}
- else {createAppearanceBranch(treeVariable,startNode)}
- }
- function createAppearanceBranch(treeVariable,startNode) {
- if (startNode.type == 'root') {if (startNode.altImage == '') {var iconImage = 'img-globe.gif'}
- else {var iconImage = startNode.altImage}
- var newAppNode = new obj_appearanceNode(startNode.id,iconImage,startNode.name,'',startNode.type,startNode.url,startNode.target,true)
- appearanceArray[appearancePos] = newAppNode;
- appearancePos = appearancePos + 1}
- if (startNode.type == 'folder') {var newAppNode = new obj_appearanceNode(startNode.id,'',startNode.name,startNode.parentID,startNode.type,startNode.url,startNode.target,false);
- var appearanceStr = addStringToStart('','img-folder.gif');
- var lengthOfBranch = extractChildren(treeVariable,treeVariable.itemWithID(startNode.parentID)).length;
- if (startNode.position == lengthOfBranch) {appearanceStr = addStringToStart(appearanceStr,'img-plus-end.gif|')}
- else {appearanceStr = addStringToStart(appearanceStr,'img-plus-cont.gif|')}
- appearanceStr = addStringToStart(appearanceStr,createParentalStructure(treeVariable,startNode.id));
- newAppNode.imageSequence = appearanceStr;
- appearanceArray[appearancePos] = newAppNode;
- appearancePos = appearancePos + 1}
- if (startNode.type == 'page') {var newAppNode = new obj_appearanceNode(startNode.id,'',startNode.name,startNode.parentID,startNode.type,startNode.url,startNode.target,false);
- if (startNode.altImage == '') {var appearanceStr = 'img-page.gif'}
- else {var appearanceStr = startNode.altImage}
- var lengthOfBranch = extractChildren(treeVariable,treeVariable.itemWithID(startNode.parentID)).length;
- if (startNode.position == lengthOfBranch) {appearanceStr = addStringToStart(appearanceStr,'img-branch-end.gif|')}
- else {appearanceStr = addStringToStart(appearanceStr,'img-branch-cont.gif|')}
- appearanceStr = addStringToStart(appearanceStr,createParentalStructure(treeVariable,startNode.id));
- newAppNode.imageSequence = appearanceStr;
- appearanceArray[appearancePos] = newAppNode;
- appearancePos = appearancePos + 1
- }
- else {
- var nodeChildren = extractAndSortChildren(treeVariable,startNode);
- var lengthOfBranch = nodeChildren.length;
- var currentIndex = 1;
- while (currentIndex <= lengthOfBranch) {createAppearanceBranch(treeVariable,nodeChildren[currentIndex])
- currentIndex = currentIndex + 1}
- }
- }
- function collapseNode(nodeID) {
- var startingPos = appearanceArray.posOfItemWithID(nodeID) + 1;
- childCount = 0;
- countChildrenOf(treeVariable,nodeID);
- var endPos = (startingPos + childCount) - 1;
- if (endPos < startingPos) {endPos = startingPos + ((extractChildren(treeVariable,treeVariable.itemWithID(nodeID)).length) - 1) }
- currentIndex = startingPos
- while (currentIndex <= endPos) {
- if (appearanceArray[currentIndex].type == 'folder') {if ((appearanceArray[currentIndex].imageSequence).indexOf("img-folder-open.gif") != -1) {collapseAppearance(appearanceArray[currentIndex]); appearanceArray[currentIndex].visable = false}
- else {appearanceArray[currentIndex].visable = false}
- }
- else {appearanceArray[currentIndex].visable = false}
- currentIndex = currentIndex + 1
- }
- collapseAppearance(appearanceArray.itemWithID(nodeID))
- timeOutId = setTimeout("drawMenu(appearanceArray)",100);
- }
- function collapseAppearance(arrayNode) {
- var imageSequence = arrayNode.imageSequence;
- var newImage = "img-plus-cont.gif";
- var oldCont = "img-minus-cont.gif";
- var oldEnd = "img-minus-end.gif";
- var oldLength = oldCont.length;
- var plusPosition = imageSequence.indexOf(oldCont)
- if (plusPosition == -1) {plusPosition = imageSequence.indexOf(oldEnd); newImage = "img-plus-end.gif"; oldLength = oldEnd.length}
- var newAppearance = imageSequence.substring(0,plusPosition) + newImage + "|img-folder.gif"
- arrayNode.imageSequence = newAppearance;
- }
- // expandNode() function - expands and displays the given node
- function expandNode(nodeID) {
- var lengthOfArray = appearanceArray.length;
- var currentIndex = 1;
- while (currentIndex <= lengthOfArray) {
- if ((appearanceArray[currentIndex].id == nodeID) || (appearanceArray[currentIndex].parentID == nodeID)) {appearanceArray[currentIndex].visable = true;
- if (appearanceArray[currentIndex].id == nodeID) {var parentIndex = currentIndex}
- }
- currentIndex = currentIndex + 1;
- }
- if (appearanceArray[parentIndex].type != 'root') {
- expandAppearance(appearanceArray[parentIndex])}
- timeOutId = setTimeout("drawMenu(appearanceArray)",100);
- }
- function expandAppearance(arrayNode) {
- var imageSequence = arrayNode.imageSequence;
- var newImage = "img-minus-cont.gif";
- var oldCont = "img-plus-cont.gif";
- var oldEnd = "img-plus-end.gif";
- var oldLength = oldCont.length;
- var plusPosition = imageSequence.indexOf(oldCont)
- if (plusPosition == -1) {plusPosition = imageSequence.indexOf(oldEnd); newImage = "img-minus-end.gif"; oldLength = oldEnd.length}
- var newAppearance = imageSequence.substring(0,plusPosition) + newImage + "|img-folder-open.gif";
- arrayNode.imageSequence = newAppearance;
- }
- // drawMenu() 函数 - 生成explorer外观的菜单,使用document.write书写相关的页面,自己修改。
- function drawMenu(appearanceArray) {
- var lengthOfArray = appearanceArray.length;
- var currentIndex = 1;
- var uname;
- top.MenuFrame.document.open("text/html");
- top.MenuFrame.document.write("<HTML><head><link rel='stylesheet' href='css/tree.css'></head><BODY>")
- while (currentIndex <= lengthOfArray) {
- if (appearanceArray[currentIndex].visable == true){drawNode(appearanceArray[currentIndex])}
- currentIndex = currentIndex + 1;
- }
- top.MenuFrame.document.close();
- window.status = '欢迎你使用 Hongfan iOffice.Net 2001!';
- }
- function getcookieval(offset)
- {
- var endstr=document.cookie.indexOf(";",offset)
- if (endstr==-1)
- endstr=document.cookie.length
- return unescape(document.cookie.substring(offset,endstr))
- }
- function getcookie(name)
- {
- var arg=name+"="
- var alen=arg.length
- var clen=document.cookie.length
- var i=0
- while (i<clen)
- {
- var j=i+alen
- if (document.cookie.substring(i,j)==arg)
- return getcookieval(j)
- i=document.cookie.indexOf(" ",i)+1
- if (i==0)
- break
- }
- return null
- }
- function drawNode(node) {
- var imageSequence = node.imageSequence;
- writeImageSequence(node,imageSequence);
- top.MenuFrame.document.write(" ")
- if (node.type == 'root')
- {
- nodeName = node.name
- }else {
- nodeName = node.name
- }
- if (node.target == '')
- {
- var nodeTarget = 'PageFrame'
- }else {
- nodeTarget = node.target
- }
- if (node.type!='folder')
- {
- top.MenuFrame.document.writeln("<A HREF=" + node.url + " TARGET='" + nodeTarget + "'>" + nodeName + "</A><BR>")
- }else{
- nodeIdent = "'" + node.id + "'"
- switch (imgstyle)
- {
- case 'close':
- top.MenuFrame.document.writeln("<A HREF=javascript:top.expandNode(" + nodeIdent + ")>" + nodeName +"</A><BR>")
- break
- default:
- top.MenuFrame.document.writeln("<A HREF=javascript:top.collapseNode(" + nodeIdent + ")>" + nodeName +"</A><BR>")
- }
- }
- }
- function writeImageSequence(node,sequence) {
- var finished = false;
- var lengthOfString = sequence.length;
- var imageSeq = sequence;
- if (node.target == '')
- {
- var nodeTarget = 'PageFrame'
- }else {
- nodeTarget = node.target
- }
- while (finished == false)
- {
- if (imageSeq == '')
- {
- finished = true
- }else {
- imageString = stringUpToBar(imageSeq);
- if (imageString.length == imageSeq.length)
- {
- imageSeq = ''
- }else {
- imageSeq = imageSeq.substring(imageString.length + 1,imageSeq.length);
- }
- switch(imageString)
- {
- case 'img-plus-cont.gif':
- nodeIdent = "'" + node.id + "'"
- top.MenuFrame.document.write("<A HREF=javascript:top.expandNode(" + nodeIdent + ")><IMG SRC='" + imageDirectory + "/" + imageString + "' ALIGN=TEXTTOP BORDER=0></A>")
- break
- case 'img-plus-end.gif':
- nodeIdent = "'" + node.id + "'"
- top.MenuFrame.document.write("<A HREF=javascript:top.expandNode(" + nodeIdent + ")><IMG SRC='" + imageDirectory + "/" + imageString + "' ALIGN=TEXTTOP BORDER=0></A>")
- break
- case 'img-folder.gif':
- imgstyle="close"
- nodeIdent = "'" + node.id + "'"
- top.MenuFrame.document.write("<A HREF=javascript:top.expandNode(" + nodeIdent + ")><IMG SRC='" + imageDirectory + "/" + imageString + "' ALIGN=TEXTTOP BORDER=0></A>")
- break
- case 'img-minus-cont.gif':
- nodeIdent = "'" + node.id + "'"
- top.MenuFrame.document.write("<A HREF=javascript:top.collapseNode(" + nodeIdent + ")><IMG SRC='" + imageDirectory + "/" + imageString + "' ALIGN=TEXTTOP BORDER=0></A>")
- break
- case 'img-minus-end.gif':
- nodeIdent = "'" + node.id + "'"
- top.MenuFrame.document.write("<A HREF=javascript:top.collapseNode(" + nodeIdent + ")><IMG SRC='" + imageDirectory + "/" + imageString + "' ALIGN=TEXTTOP BORDER=0></A>")
- break
- case 'img-folder-open.gif':
- imgstyle="open"
- nodeIdent = "'" + node.id + "'"
- top.MenuFrame.document.write("<A HREF=javascript:top.collapseNode(" + nodeIdent + ")><IMG SRC='" + imageDirectory + "/" + imageString + "' ALIGN=TEXTTOP BORDER=0></A>")
- break
- case 'img-page.gif':
- nodeIdent = "'" + node.id + "'"
- top.MenuFrame.document.write("<A HREF='" + node.url + "' TARGET='" + nodeTarget + "'><IMG SRC='" + imageDirectory + "/" + imageString + "' ALIGN=TEXTTOP BORDER=0></A>")
- break
- default:
- top.MenuFrame.document.write("<IMG SRC='" + imageDirectory + "/" + imageString + "' ALIGN=TEXTTOP>")
- }
- }
- }
- }
- function stringUpToBar(string) {
- var lengthOfString = string.length;
- var currentIndex = 0;
- var newString = '';
- var finished = false;
- while (finished == false) {
- if (currentIndex == lengthOfString) {finished = true}
- else {
- if (string.charAt(currentIndex) == '|') {finished = true}
- else {newString = newString + string.charAt(currentIndex)}
- currentIndex = currentIndex + 1
- }
- if (currentIndex == lengthOfString) {finished = true}
- }
- return newString
- }
- // addStringToStart() function - adds the addition string to the front of the existing string
- function addStringToStart(existingString,addition) {
- newString = addition + existingString;
- return newString
- }
- // createParentalStructure() function - creates a string that shows the parental tree structure
- function createParentalStructure(treeVariable,nodeID) {
- var parentAppearance = '';
- var parentID = treeVariable.itemWithID(nodeID).parentID;
- var currentNode = treeVariable.itemWithID(parentID);
- while (parentID != 'root') {
- var nodePos = currentNode.position;
- parentID = currentNode.parentID;
- currentNode = treeVariable.itemWithID(parentID);
- var lengthOfBranch = extractChildren(treeVariable,currentNode).length;
- if (nodePos < lengthOfBranch) {parentAppearance = addStringToStart(parentAppearance,'img-vert-line.gif|')}
- else {parentAppearance = addStringToStart(parentAppearance,'img-blank.gif|')}
- }
- return parentAppearance
- }
- // extractExpandableNodes() - METHOD of obj_collection - extracts the root and all folder nodes
- // into a new collection
- function extractExpandableNodes() {
- var newCollection = new obj_collection();
- var collectionSize = this.length;
- var currentIndex = 1;
- var currentArray = this;
- while (currentIndex <= collectionSize) {
- if ((currentArray[currentIndex].type == 'folder') || (currentArray[currentIndex].type == 'root')) {
- newCollection = newCollection.addItem(currentArray[currentIndex])
- }
- currentIndex = currentIndex + 1
- }
- return newCollection
- }
- // ADDITEM function - METHOD of OBJ_COLLECTION - adds an object to the collection
- function addItem(object) {
- collectionSize = this.length;
- returnArray = this;
- idExists = returnArray.itemIDExists(object.id)
- if (idExists == false) {returnArray.length = collectionSize + 1;
- returnArray[returnArray.length] = object;
- return returnArray}
- else {alert("ERROR: Object with id: " + object.id + " already exists in this collection.")
- return returnArray}
- }
- function countChildrenOf(treeVariable,nodeID) {
- var node = treeVariable.itemWithID(nodeID);
- var nodeChildren = extractChildren(treeVariable,node);
- var currentIndex = 1;
- while (currentIndex <= nodeChildren.length) {
- if (nodeChildren[currentIndex].type != 'page') {countChildrenOf(treeVariable,nodeChildren[currentIndex].id)}
- childCount = childCount + 1;
- currentIndex = currentIndex + 1;
- }
- }
- function posOfItemWithID(id) {
- collectionSize = this.length;
- currentIndex = 1;
- returnIndex = 'undefined';
- while (currentIndex <= collectionSize) {
- if (this[currentIndex].id == id) {returnIndex = currentIndex}
- currentIndex = currentIndex + 1}
- if (returnObject == 'undefined') {alert("ERROR: Object with id: " + id + " not found in this collection.")}
- else {return returnIndex}
- }
- // ITEMWITHID function - METHOD of OBJ_COLLECTION and OBJ_ARRAY - returns an object with the given ID
- function itemWithID(id) {
- collectionSize = this.length;
- currentIndex = 1;
- returnObject = 'undefined';
- while (currentIndex <= collectionSize) {
- if (this[currentIndex].id == id) {returnObject = this[currentIndex]}
- currentIndex = currentIndex + 1}
- if (returnObject == 'undefined') {alert("ERROR: Object with id: " + id + " not found in this collection.")}
- else {return returnObject}
- }
- // ITEMIDEXISTS function - METHOD of OBJ_COLLECTION and OBJ_ARRAY - checks if an object with the given ID
- // already exists in the collection
- function itemIDExists(id) {
- collectionSize = this.length;
- currentIndex = 1;
- returnStatus = false;
- while (currentIndex <= collectionSize) {
- if ((this[currentIndex].id) == id) {returnStatus = true}
- currentIndex = currentIndex + 1}
- return returnStatus
- }
- // definitionsHaveErrors function - general function - checks the defined menu infrastructure
- // for errors.
- function definitionsHaveErrors(treeVariable) {
- hasErrors = false
- if (checkForMultipleRoots(treeVariable) == true) {hasErrors = true}
- if (checkNodeTypes(treeVariable) == true) {hasErrors = true}
- if (checkForOrphanNodes(treeVariable) == true) {hasErrors = true}
- if (checkForChildren(treeVariable) == true) {hasErrors = true}
- if (checkNodePositions(treeVariable) == true) {hasErrors = true}
- return hasErrors
- }
- // checkNodeTypes function - called from definitionsHaveErrors() function
- // - checks for nodes with unknown types
- function checkNodeTypes(treeVariable) {
- collectionSize = treeVariable.length;
- var currentIndex = 1;
- var returnStatus = false;
- while (currentIndex <= collectionSize) {
- if ((treeVariable[currentIndex].type != 'root') && (treeVariable[currentIndex].type != 'page') && (treeVariable[currentIndex].type != 'folder')) {
- alert("Node with ID: " + treeVariable[currentIndex].id + " is of an unknown type: " + treeVariable[currentIndex].type + " (not a page, folder or root).")
- }
- currentIndex = currentIndex + 1;
- }
- return returnStatus
- }
- // checkForMultipleRoots function - called from definitionsHaveErrors() function
- // - checks if the menu infrastructure has multiple root nodes
- function checkForMultipleRoots(treeVariable) {
- collectionSize = treeVariable.length;
- currentIndex = 1;
- rootCount = 0;
- while (currentIndex <= collectionSize) {
- if ((treeVariable[currentIndex].type) == 'root') {rootCount = rootCount + 1}
- currentIndex = currentIndex + 1}
- if (rootCount == 1) {return false}
- else {if (rootCount == 0) {alert("ERROR: You have not defined a root node.")}
- else {alert("ERROR: You have defined more than one root node.")}
- return true}
- }
- // checkForOrphanNodes() function - called from definitionsHaveErrors() function
- // - checks if the menu infrastructure contains any nodes without defined parents
- function checkForOrphanNodes(treeVariable) {
- collectionSize = treeVariable.length;
- var currentIndex = 1;
- var returnStatus = false;
- while (currentIndex <= collectionSize) {
- if ((treeVariable[currentIndex].type) != 'root') {if (((treeVariable.itemIDExists(treeVariable[currentIndex].parentID)) == false) && (treeVariable[currentIndex].parentID != '')) {returnStatus = true;
- alert("ERROR: The parent node: " + treeVariable[currentIndex].parentID + " does not exist for node: " + treeVariable[currentIndex].id + ".")}
- if (treeVariable[currentIndex].parentID == '') {returnStatus = true;
- alert("ERROR: Node with ID: " + treeVariable[currentIndex].id + " has no parent, and is not the root node.")}
- if (treeVariable.itemWithID(treeVariable[currentIndex].parentID).type == 'page') {returnStatus = true; alert("ERROR: Node with ID: " + treeVariable[currentIndex].id + " has a parent (" + treeVariable[currentIndex].parentID + "), but this parent is a page (should be a folder or the root).")}
- }
- currentIndex = currentIndex + 1}
- return returnStatus
- }
- // checkForChildren() function - called from definitionsHaveErrors() function
- // - checks that all nodes (except pages) in the menu infrastructure have at least one child
- function checkForChildren(treeVariable) {
- collectionSize = treeVariable.length;
- var currentIndex = 1;
- var returnStatus = false;
- while (currentIndex <= collectionSize) {
- if ((treeVariable[currentIndex].type) != 'page') {
- if (checkParentID(treeVariable,treeVariable[currentIndex].id) == false) {returnStatus = true; alert("ERROR: Node with ID: " + treeVariable[currentIndex].id + " is a root node or a folder node (or an node of unknown type) without any defined children. The root node and any folder nodes MUST have at least one child node.")}
- }
- currentIndex = currentIndex + 1
- }
- return returnStatus
- }
- // checkParentID() function - checks the given tree for nodes with the given parent ID
- function checkParentID(treeVariable,parentCode) {
- collectionSize = treeVariable.length;
- var currentIndex = 1;
- var returnStatus = false;
- while (currentIndex <= collectionSize) {
- if ((treeVariable[currentIndex].parentID) == parentCode) {returnStatus = true}
- currentIndex = currentIndex + 1
- }
- return returnStatus
- }
- // checkNodePositions() function - checks the tree infrastructure for node positioning errors
- function checkNodePositions(treeVariable) {
- // 1. Make a collection of all folders and the root node
- expandableNodes = treeVariable.extractExpandableNodes()
- // 2. For each node in this collection, make a collection of all the nodes that
- // are children of that node.
- var currentIndex = 1;
- var collectionSize = expandableNodes.length;
- var returnStatus = false;
- while (currentIndex <= collectionSize) {
- var scanCollection = extractChildren(treeVariable,expandableNodes[currentIndex]);
- if (scanPositionErrors(scanCollection,expandableNodes[currentIndex].id) == true) {returnStatus = true}
- currentIndex = currentIndex + 1
- }
- return returnStatus
- }
- // scanPositionErrors() function - scans the given collection of children for positioning errors
- function scanPositionErrors(scanCollection,idOfParent) {
- var returnStatus = false;
- var currentIndex = 1;
- var collectionSize = scanCollection.length;
- // Check for nodes with positions less than 1
- while (currentIndex <= collectionSize) {
- if (scanCollection[currentIndex].position < 1) {returnStatus = true;
- alert("ERROR: Node with ID: " + scanCollection[currentIndex].id + " with parent: " + scanCollection[currentIndex].parentID + " has a illegal position value (less than 1).")}
- currentIndex = currentIndex + 1
- }
- currentIndex = 1
- while (currentIndex <= collectionSize) {
- if (scanCollection[currentIndex].position > collectionSize) {returnStatus = true;
- alert("ERROR: Node with ID: " + scanCollection[currentIndex].id + " with parent: " + scanCollection[currentIndex].parentID + " has a illegal position value (greater than branch maximum of " + collectionSize + " positions).")}
- currentIndex = currentIndex + 1
- }
- var loopNo = 1;
- while (loopNo <= collectionSize) {
- var currentIndex = 1;
- var positionFound = false;
- while (currentIndex <= collectionSize) {
- if (scanCollection[currentIndex].position == loopNo) {positionFound = true}
- currentIndex = currentIndex + 1
- }
- if (positionFound == false) {returnStatus = true; alert("ERROR: There is no node at position " + loopNo + " in branch " + idOfParent + ". Two or more nodes may have the same position value.")}
- loopNo = loopNo + 1
- }
- currentIndex = 1
- return returnStatus
- }
- function extractChildren(treeVariable,node) {
- var newCollection = new obj_collection();
- var currentIndex = 1;
- var collectionSize = treeVariable.length;
- nodeID = node.id;
- while (currentIndex <= collectionSize) {
- if ((treeVariable[currentIndex].parentID) == nodeID) {
- newCollection = newCollection.addItem(treeVariable[currentIndex])
- }
- currentIndex = currentIndex + 1
- }
- return newCollection
- }
- function extractAndSortChildren(treeVariable,node) {
- var childCollection = extractChildren(treeVariable,node);
- var newCollection = new obj_collection();
- var lengthOfCollection = childCollection.length;
- var currentIndex = 1;
- while (currentIndex <= lengthOfCollection) {
- var newNode = extractNodeWithPosition(childCollection,currentIndex)
- newCollection = newCollection.addItem(newNode)
- currentIndex = currentIndex + 1
- }
- return newCollection
- }
- function extractNodeWithPosition(collection,position) {
- var currentIndex = 1;
- var lengthOfCollection = collection.length;
- while (currentIndex <= lengthOfCollection) {
- if (collection[currentIndex].position == position) {var node = collection[currentIndex]}
- currentIndex = currentIndex + 1
- }
- return node
- }
- // DEFINEMENUITEMS function - general function - called from start of script to create the menu
- // infrastructure.
- //
- // 以下内容需要你设置,即左侧menu的内容,格式如下: uniqueID,displayName,parentID,typeOfNode,URL,altImage,positionInTree,targetFrame
- function defineMenuItems(treeVariable) {
- //root
- treeVariable = treeVariable.addItem(new obj_node('root','欢迎使用 iOffice.Net','','root','start.htm','',0,''));
- //我的办公室
- treeVariable = treeVariable.addItem(new obj_node('ioffice','我的办公室','root','folder','','',1,''));
- //人力资源
- treeVariable = treeVariable.addItem(new obj_node('mr','人力资源','ioffice','folder','','',1,''));
- //人力资源扩展
- treeVariable = treeVariable.addItem(new obj_node('smr','概述','mr','page','prg/mr/smr.htm','page.gif',1,''));
- treeVariable = treeVariable.addItem(new obj_node('mr1','机构信息','mr','page','prg/mr/branchset.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('mr2','部门信息','mr','page','prg/mr/dep.htm','page.gif',3,''));
- treeVariable = treeVariable.addItem(new obj_node('mr3','员工信息','mr','page','prg/mr/empinf.htm','page.gif',4,''));
- treeVariable = treeVariable.addItem(new obj_node('mr6','员工照片','mr','page','prg/mr/empphoto.htm','page.gif',5,''));
- treeVariable = treeVariable.addItem(new obj_node('mr5','搜索员工','mr','page','prg/mr/empseach.htm','page.gif',6,''));
- treeVariable = treeVariable.addItem(new obj_node('ps1','属性定义','mr','page','prg/set/psset.htm','page.gif',7,''));
- treeVariable = treeVariable.addItem(new obj_node('mr4','权限设置','mr','page','prg/mr/rightobjlst.htm','page.gif',8,''));
- //文件管理
- treeVariable = treeVariable.addItem(new obj_node('fm','文件管理','ioffice','folder','','',2,''));
- //文件管理扩展
- treeVariable = treeVariable.addItem(new obj_node('sfm','概述','fm','page','prg/fm/sfm.htm','page.gif',1,''));
- treeVariable = treeVariable.addItem(new obj_node('fm1','文件管理','fm','page','prg/fm/fm1.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('fm2','文件搜索','fm','page','prg/fm/fmseach.htm','page.gif',3,''));
- treeVariable = treeVariable.addItem(new obj_node('fm3','回 收 站','fm','page','prg/fm/fmrecycle.htm','page.gif',4,''));
- //网络邮件
- treeVariable = treeVariable.addItem(new obj_node('ml','网络邮件','ioffice','folder','','',3,''));
- //网络邮件扩展
- treeVariable = treeVariable.addItem(new obj_node('ml1','收 件 箱','ml','page','prg/ml/mailinboxs.htm','page.gif',1,''));
- treeVariable = treeVariable.addItem(new obj_node('ml2','撰写邮件','ml','page','prg/ml/sendmail.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('ml3','通 迅 簿','ml','page','prg/ml/commbook.htm','page.gif',3,''));
- treeVariable = treeVariable.addItem(new obj_node('ml4','通 迅 组','ml','page','prg/ml/commgroups.htm','page.gif',4,''));
- treeVariable = treeVariable.addItem(new obj_node('ml5','选项设置','ml','page','prg/ml/svroptions.htm','page.gif',5,''));
- //公文管理
- treeVariable = treeVariable.addItem(new obj_node('wm','公文管理','ioffice','folder','','',4,''));
- treeVariable = treeVariable.addItem(new obj_node('swm','概述','wm','page','prg/wm/swm.htm','page.gif',1,''));
- //我的批复
- treeVariable = treeVariable.addItem(new obj_node('wmp','我的批复','wm','folder','','',2,''));
- treeVariable = treeVariable.addItem(new obj_node('wm1','公文预览','wmp','page','prg/wm/docout.htm','page.gif',1,''));
- treeVariable = treeVariable.addItem(new obj_node('wm2','待批公文','wmp','page','prg/wm/fdocout.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('wm3','已批公文','wmp','page','prg/wm/docconfed.htm','page.gif',3,''));
- //公文履历
- treeVariable = treeVariable.addItem(new obj_node('wmh','公文履历','wm','folder','','',3,''));
- treeVariable = treeVariable.addItem(new obj_node('wm5','审毕公文','wmh','page','prg/wm/docover.htm','page.gif',1,''));
- treeVariable = treeVariable.addItem(new obj_node('wm6','被退公文','wmh','page','prg/wm/docreturn.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('wm7','撤销公文','wmh','page','prg/wm/docrecall.htm','page.gif',3,''));
- //我的申请
- treeVariable = treeVariable.addItem(new obj_node('wm8','发出公文','wm','page','prg/wm/docsend.htm','page.gif',4,''));
- //公文模板
- treeVariable = treeVariable.addItem(new obj_node('wm9','公文模板','wm','page','prg/set/bsdoctemp1.htm','page.gif',5,''));
- //代理设置
- treeVariable = treeVariable.addItem(new obj_node('wm10','代批人','wm','page','prg/wm/wmoption.htm','page.gif',6,''));
- //信息互递
- treeVariable = treeVariable.addItem(new obj_node('if','信息互递','ioffice','folder','','',5,''));
- //信息互递扩展
- treeVariable = treeVariable.addItem(new obj_node('sif','概述','if','page','prg/if/sif.htm','page.gif',1,''));
- treeVariable = treeVariable.addItem(new obj_node('if1','收到留言','if','page','prg/if/levmsg.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('if2','人员去向','if','page','prg/if/lyb.htm','page.gif',3,''));
- treeVariable = treeVariable.addItem(new obj_node('if3','公告板','if','page','prg/if/boardlist.htm','page.gif',5,''));
- treeVariable = treeVariable.addItem(new obj_node('if4','传阅板','if','page','prg/if/showmsglist.htm','page.gif',4,''));
- treeVariable = treeVariable.addItem(new obj_node('if5','电子会议室','if','page','prg/if/meetlist.htm','page.gif',6,''));
- treeVariable = treeVariable.addItem(new obj_node('if6','自由论坛','if','page','prg/if/freelist.htm','page.gif',7,''));
- //日程任务
- treeVariable = treeVariable.addItem(new obj_node('cp','日程任务','ioffice','folder','','',6,''));
- treeVariable = treeVariable.addItem(new obj_node('scp','概述','cp','page','prg/cp/scp.htm','page.gif',1,''));
- ///日程任务扩展
- treeVariable = treeVariable.addItem(new obj_node('cp1','我的日程','cp','page','prg/cp/schedule.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('cp2','部门日程','cp','page','prg/cp/depsch.htm','page.gif',3,''));
- treeVariable = treeVariable.addItem(new obj_node('cp3','工作进程','cp','page','prg/cp/roleprolist.htm','page.gif',4,''));
- treeVariable = treeVariable.addItem(new obj_node('cp4','任务管理','cp','page','prg/cp/rolelist.htm','page.gif',5,''));
- treeVariable = treeVariable.addItem(new obj_node('cp5','便 笺 本','cp','page','prg/cp/note.htm','page.gif',6,''));
- //控制面板
- treeVariable = treeVariable.addItem(new obj_node('sysset','控制面板','root','folder','','',2,''));
- //基本设置
- treeVariable = treeVariable.addItem(new obj_node('bs','基本设置','sysset','folder','','',1,''));
- treeVariable = treeVariable.addItem(new obj_node('sbs','概述','bs','page','prg/set/sbs.htm','page.gif',1,''));
- treeVariable = treeVariable.addItem(new obj_node('bs1','人力资源','bs','page','prg/set/basemr.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('bs2','邮件设置','bs','page','prg/set/baseml.htm','page.gif',3,''));
- treeVariable = treeVariable.addItem(new obj_node('bs3','公文管理','bs','page','prg/set/basewm.htm','page.gif',4,''));
- treeVariable = treeVariable.addItem(new obj_node('bs4','信息互递','bs','page','prg/set/baseif.htm','page.gif',5,''));
- treeVariable = treeVariable.addItem(new obj_node('bs5','日程任务','bs','page','prg/set/basecp.htm','page.gif',6,''));
- //treeVariable = treeVariable.addItem(new obj_node('bs6','任务状态','bs','page','default.htm','',5,''));
- //treeVariable = treeVariable.addItem(new obj_node('bs7','类型定义','bs','page','test.htm','',6,''));
- //treeVariable = treeVariable.addItem(new obj_node('bs8','执行动作','bs','page','test.htm','',7,''));
- //treeVariable = treeVariable.addItem(new obj_node('bs9','其他定义','bs','page','test.htm','',8,''));
- //属性定义
- //treeVariable = treeVariable.addItem(new obj_node('ps','属性定义','sysset','folder','','',2,''));
- //treeVariable = treeVariable.addItem(new obj_node('ps5','产品属性','ps','page','test.htm','',2,''));
- //treeVariable = treeVariable.addItem(new obj_node('ps6','订单属性','ps','page','test.htm','',3,''));
- //treeVariable = treeVariable.addItem(new obj_node('ps7','客户属性','ps','page','test.htm','',4,''));
- ///treeVariable = treeVariable.addItem(new obj_node('ps8','伙伴属性','ps','page','test.htm','',5,''));
- //系统设定扩展
- treeVariable = treeVariable.addItem(new obj_node('ss1','首页设置','sysset','page','prg/set/desktopset1.htm','page.gif',2,''));
- treeVariable = treeVariable.addItem(new obj_node('ss2','显示选项','sysset','page','prg/set/optionset.htm','page.gif',3,''));
- treeVariable = treeVariable.addItem(new obj_node('ss3','帐号维护','sysset','page','prg/set/logininfo.htm','page.gif',4,''));
- treeVariable = treeVariable.addItem(new obj_node('ss4','安全策略','sysset','page','prg/set/secpolicy.htm','page.gif',5,''));
- treeVariable = treeVariable.addItem(new obj_node('ss5','登录日志','sysset','page','prg/set/onlineper.htm','page.gif',6,''));
- treeVariable = treeVariable.addItem(new obj_node('ss6','操作日志','sysset','page','prg/set/ssactlog.htm','page.gif',7,''));
- }