corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 <?php
2  
3 //=============================================================================
4 // System : Sandcastle Help File Builder (PHP port)
5 // Author : Latif Khalifa <latifer@streamgrid.net>, All rights reserved
6 // Copyright (c) 2011, Latif Khalifa <latifer@streamgrid.net>
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14  
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17  
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 // THE SOFTWARE.
25 //
26 // Based on C# version by Eric Woodruff (Eric@EWoodruff.us) from code by Ferdinand Prantl
27 // Copyright 2008, Eric Woodruff, All rights reserved
28  
29 $lcTOC = "";
30 $toc = DOMDocument::load("WebTOC.xml");
31 $navToc = new DOMXpath($toc);
32 $root = $navToc->query("*");
33  
34 foreach ($root as $node) {
35  
36 if ($node->hasChildNodes()) {
37 $id = $node->getAttribute("Id");
38 $title = $node->getAttribute("Title");
39 $url = $node->getAttribute("Url");
40  
41 if ($url) {
42 $target = " target=\"TopicContent\"";
43 } else {
44 $url = "#";
45 $target = "";
46 }
47  
48 $lcTOC .= sprintf("<div class=\"TreeNode\">\r\n" .
49 "<img class=\"TreeNodeImg\" " .
50 "onclick=\"javascript: Toggle(this);\" " .
51 "src=\"Collapsed.gif\"/><a class=\"UnselectedNode\" " .
52 "onclick=\"javascript: return Expand(this);\" " .
53 "href=\"%s\"%s>%s</a>\r\n" .
54 "<div id=\"%s\" class=\"Hidden\"></div>\r\n</div>\r\n",
55 $url, $target, htmlentities($title), $id);
56 } else {
57  
58 $title = $node->getAttribute("Title");
59 $url = $node->getAttribute("Url");
60  
61 if (!$url)
62 $url = "about:blank";
63  
64 $lcTOC .= sprintf("<div class=\"TreeItem\">\r\n" .
65 "<img src=\"Item.gif\"/>" .
66 "<a class=\"UnselectedNode\" " .
67 "onclick=\"javascript: return SelectNode(this);\" " .
68 "href=\"%s\" target=\"TopicContent\">%s</a>\r\n" .
69 "</div>\r\n",
70 $url, htmlentities($title));
71  
72 }
73  
74 }
75  
76 // var_dump($lcTOC);
77 //die();
78 ?>
79  
80 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
81 <html>
82  
83 <head>
84 <title>OpenMetaverse Protocol Library Developers API Documentation - Table of Content</title>
85 <link rel="stylesheet" href="TOC.css">
86 <script type="text/javascript" src="TOC_php.js"></script>
87 </head>
88  
89 <body onload="javascript: Initialize();" onresize="javascript: ResizeTree();">
90 <form id="IndexForm" runat="server">
91  
92 <div id="TOCDiv" class="TOCDiv">
93  
94 <div id="divSearchOpts" class="SearchOpts" style="height: 80px; display: none;">
95 <img class="TOCLink" onclick="javascript: ShowHideSearch(false);"
96 src="CloseSearch.png" height="17" width="17" alt="Hide search" style="float: right;"/>
97 Keyword(s) for which to search:
98 <input id="txtSearchText" type="text" style="width: 100%;"
99 onkeypress="javascript: return OnSearchTextKeyPress(event);" /><br />
100  
101 <!--input id="chkSortByTitle" type="checkbox" /><label for="chkSortByTitle">&nbsp;Sort results by title</label><br /-->
102  
103 <input type="button" value="Search" onclick="javascript: return PerformSearch();" />
104 </div>
105  
106 <div id="divIndexOpts" class="IndexOpts" style="height: 25px; display: none;">
107 <img class="TOCLink" onclick="javascript: ShowHideIndex(false);"
108 src="CloseSearch.png" height="17" width="17" alt="Hide index" style="float: right;"/>
109 Keyword Index
110 </div>
111  
112 <div id="divNavOpts" class="NavOpts" style="height: 20px;">
113 <img class="TOCLink" onclick="javascript: SyncTOC();" src="SyncTOC.gif"
114 height="16" width="16" alt="Sync to TOC"/>
115 <img class="TOCLink" onclick="javascript: ExpandOrCollapseAll(true);"
116 src="ExpandAll.bmp" height="16" width="16" alt="Expand all "/>
117 <img class="TOCLink" onclick="javascript: ExpandOrCollapseAll(false);"
118 src="CollapseAll.bmp" height="16" width="16" alt="Collapse all" />
119 <img class="TOCLink" onclick="javascript: ShowHideIndex(true);"
120 src="Index.gif" height="16" width="16" alt="Index" />
121 <img class="TOCLink" onclick="javascript: ShowHideSearch(true);"
122 src="Search.gif" height="16" width="16" alt="Search" />
123 </div>
124  
125 <div class="Tree" id="divSearchResults" style="display: none;"
126 onselectstart="javascript: return false;">
127 </div>
128  
129 <div class="Tree" id="divIndexResults" style="display: none;"
130 onselectstart="javascript: return false;">
131 </div>
132  
133 <div class="Tree" id="divTree" onselectstart="javascript: return false;">
134 <?php echo $lcTOC ?>
135 </div>
136  
137 </div>
138  
139 <div id="TOCSizer" class="TOCSizer" onmousedown="OnMouseDown(event)" onselectstart="javascript: return false;"></div>
140  
141 <iframe id="TopicContent" name="TopicContent" class="TopicContent" src="html/R_Project.htm">
142 This page uses an IFRAME but your browser does not support it.
143 </iframe>
144  
145 </form>
146  
147 </body>