首页 > 后端开发 > php教程 > 下面是原码_PHP

下面是原码_PHP

ringa_lee
发布: 2023-02-28 10:52:02
原创
1246 人浏览过

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

function Folder(folderDescription, hreference,parentid,target) {

   //constant data;

 

   this.desc = folderDescription;

   this.parentid=parentid;

   this.hreference = hreference;

   this.target=target;

   this.id = index;

   this.navObj = 0;

   this.iconImg = 0;

   this.nodeImg = 0;

   this.isLastNode = 0;

 

   // dynamic data

   this.isRoot = true;

   this.isOpen = true;

   this.iconSrc=imageURL+"ftv2folderopen.gif";

   this.iconRoot =imageURL+"ftv2folderopen.gif";

 

   this.children = new Array;

   this.nChildren = 0;

 

   // methods

   this.initialize = initializeFolder;

   this.setState = setStateFolder;

   this.addChild = addChild;

 

   this.createIndex = createEntryIndex;

   this.hide = hideFolder;

   this.display = display;

   this.renderOb = drawFolder;

   this.totalHeight = totalHeight;

   this.subEntries = folderSubEntries;

   this.outputLink = outputFolderLink;

 

}

 

 

function setStateFolder(isOpen) {

   var subEntries;

   var totalHeight;

   var fIt = 0;

   var i = 0;

 

   if(isOpen == this.isOpen)

       return;

 

   if(browserVersion == 2) {

       totalHeight = 0

       for(i = 0; i < this.nChildren; i++)

           totalHeight = totalHeight + this.children[i].navObj.clip.height;

       subEntries = this.subEntries();

 

       if(this.isOpen)

           totalHeight = 0 - totalHeight;

 

       for(fIt = this.id + subEntries + 1; fIt < nEntries; fIt++)

           indexOfEntries[fIt].navObj.moveBy(0, totalHeight);

   }

 

   this.isOpen = isOpen;

   propagateChangesInState(this);

}

 

 

function propagateChangesInState(folder) {

 

   var i = 0;

   if(folder.isOpen) {

       if(folder.nodeImg) {

           if(folder.isLastNode)

               folder.nodeImg.src = imageURL+"ftv2mlastnode.gif";

           else

               folder.nodeImg.src = imageURL+"ftv2mnode.gif";

       }

 

       if(this.isRoot)

           folder.iconImg.src = imageURL+"ftv2_mail.gif";

       else

           folder.iconImg.src = imageURL+"ftv2folderopen.gif";

 

       for(i = 0; i < folder.nChildren; i++)

           folder.children[i].display();

   }

   else {

       if(folder.nodeImg) {

           if(folder.isLastNode)

 

               folder.nodeImg.src = imageURL+"ftv2plastnode.gif";

           else

               folder.nodeImg.src = imageURL+"ftv2pnode.gif";

       }

 

       if(this.isRoot)

           folder.iconImg.src = imageURL+"ftv2_mail.gif";

       else

           folder.iconImg.src = imageURL+"ftv2folderclosed.gif";

 

       for(i = 0; i < folder.nChildren; i++)

           folder.children[i].hide();

   }

}

 

function hideFolder() {

    if(browserVersion == 1) {

        if(this.navObj.style.display == "none")

            return;

 

        this.navObj.style.display = "none";

    }

    else {

        if(this.navObj.visibility == "hiden")

            return;

 

        this.navObj.visibility = "hiden";

    }

 

    this.setState(0);

}

 

 

function initializeFolder(level, lastNode, leftSide) {

    var i = 0;

    var j = 0;

 

    var numberOfFolders;

    var numberOfDocs;

 

    nc = this.nChildren;

    this.createIndex();

 

    var nc;

    var auxEv = "";

 

    if(browserVersion > 0)

        auxEv = "";

    else

        auxEv = "";

 

    if(level > 0) {

        if(lastNode) { //the last &#39;brother&#39; in the children array

           this.renderOb(leftSide + auxEv + "");

           leftSide = leftSide + "";

           this.isLastNode = 1;

        }

        else {

            this.renderOb(leftSide + auxEv + "");

            leftSide = leftSide + "";

            this.isLastNode = 0;

        }

    }

    else {

        this.renderOb("");

    }

 

    if(nc > 0) {

        level = level + 1;

        for(i = 0; i < this.nChildren; i++) {

            if(i == this.nChildren-1)

                this.children[i].initialize(level, 1, leftSide);

            else

                this.children[i].initialize(level, 0, leftSide);

        }

    }

}

 

 

function drawFolder(leftSide) {

    if(browserVersion == 2) {

        if(!doc.yPos)

          doc.yPos = 8;

 

        doc.write("");

    }

 

    if(browserVersion == 1) {

        this.navObj = doc.all["folder"+this.id];

        this.iconImg = doc.all["folderIcon"+this.id]

        this.nodeImg = doc.all["nodeIcon"+this.id]

    }

    else if(browserVersion == 2) {

        this.navObj = doc.layers["folder"+this.id];

        this.iconImg = this.navObj.document.images["folderIcon"+this.id];

        this.nodeImg = this.navObj.document.images["nodeIcon"+this.id];

        doc.yPos = doc.yPos + this.navObj.clip.height;

    }

}

登录后复制

   

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板