|
1 | | -<? |
2 | | - |
| 1 | +<? |
| 2 | + |
3 | 3 | $pages = array( |
4 | | - |
5 | | - 'Cover' => array('/', 0), |
6 | | - |
7 | | - 'Exhibition' => array('/exhibition/', 1), |
8 | | - |
9 | | - 'Learning' => array('/learning/', 1), |
10 | | - 'Tutorials' => array('/learning/', 2), |
11 | | - 'Basics' => array('/learning/basics/', 2), |
12 | | - 'Topics' => array('/learning/topics/', 2), |
13 | | - '3D' => array('/learning/3d/', 2), |
14 | | - 'Library' => array('/learning/library/', 2), |
15 | | - 'Books' => array('/learning/books/', 2), |
16 | | - |
17 | | - 'Reference' => array('/reference/', 1), |
18 | | - 'Language' => array('/reference/', 2), |
19 | | - 'A-Z' => array('/reference/alpha.html', 2), |
20 | | - 'Libraries' => array('/reference/libraries/', 2), |
21 | | - 'Tools' => array('/reference/tools/', 2), |
22 | | - 'Environment' => array('/reference/environment/', 2), |
23 | | - |
24 | | - 'Download' => array('/download/', 1), |
25 | | - |
26 | | - 'Shop' => array('/shop/', 1), |
| 4 | + |
| 5 | + 'Cover' => array('/', 0), |
| 6 | + |
| 7 | + 'Exhibition' => array('/exhibition/', 1), |
| 8 | + |
| 9 | + 'Learning' => array('/learning/', 1), |
| 10 | + 'Tutorials' => array('/learning/', 2), |
| 11 | + 'Basics' => array('/learning/basics/', 2), |
| 12 | + 'Topics' => array('/learning/topics/', 2), |
| 13 | + '3D' => array('/learning/3d/', 2), |
| 14 | + 'Library' => array('/learning/library/', 2), |
| 15 | + 'Books' => array('/learning/books/', 2), |
| 16 | + |
| 17 | + 'Reference' => array('/reference/', 1), |
| 18 | + 'Language' => array('/reference/', 2), |
| 19 | + 'A-Z' => array('/reference/alpha.html', 2), |
| 20 | + 'Libraries' => array('/reference/libraries/', 2), |
| 21 | + 'Tools' => array('/reference/tools/', 2), |
| 22 | + 'Environment' => array('/reference/environment/', 2), |
27 | 23 |
|
28 | | - 'About' => array('/about/', 1), |
29 | | - 'Overview' => array('/about/', 2), |
30 | | - 'People' => array('/about/people/', 2), |
31 | | - 'Patrons' => array('/about/patrons/', 2), |
32 | | - |
33 | | - 'FAQ' => array('http://wiki.processing.org/w/FAQ', 1), |
34 | | - |
35 | | - ); |
36 | | - |
37 | | - |
38 | | -function navigation($section = '') |
39 | | -{ |
40 | | - global $lang; |
41 | | - global $translation; |
42 | | - $tr = $translation->navigation; |
43 | | - |
44 | | - $abo = array('About', 'Overview', 'People', 'Patrons'); |
| 24 | + 'Download' => array('/download/', 1), |
| 25 | + |
| 26 | + 'Shop' => array('/shop/', 1), |
| 27 | + |
| 28 | + 'About' => array('/about/', 1), |
| 29 | + 'Overview' => array('/about/', 2), |
| 30 | + 'People' => array('/about/people/', 2), |
| 31 | + 'Patrons' => array('/about/patrons/', 2), |
| 32 | + |
| 33 | + 'FAQ' => array('http://wiki.processing.org/w/FAQ', 1), |
| 34 | + |
| 35 | + ); |
| 36 | + |
| 37 | + |
| 38 | +function navigation($section = '') |
| 39 | +{ |
| 40 | + global $lang; |
| 41 | + global $translation; |
| 42 | + $tr = $translation->navigation; |
| 43 | + |
| 44 | + $abo = array('About', 'Overview', 'People', 'Patrons'); |
45 | 45 | $ref = array('Reference', 'Language', 'A-Z', 'Libraries', 'Tools', 'Environment'); |
46 | | - $learn = array('Learning', 'Tutorials', 'Basics', 'Topics', '3D', 'Library', 'Books'); |
47 | | - |
48 | | - $html = "\t\t\t".'<div id="navigation">'."\n"; |
49 | | - |
| 46 | + $learn = array('Learning', 'Tutorials', 'Basics', 'Topics', '3D', 'Library', 'Books'); |
| 47 | + |
| 48 | + $html = "\t\t\t".'<div id="navigation">'."\n"; |
| 49 | + |
50 | 50 | $id = (in_array($section, $ref) || in_array($section, $learn) || |
51 | | - in_array($section, $abo)) ? 'mainnav' : 'mainnav_noSub'; |
52 | | - |
53 | | - $html .= "\t\t\t\t".'<div class="navBar" id="'.$id.'">'."\n"; |
54 | | - |
| 51 | + in_array($section, $abo)) ? 'mainnav' : 'mainnav_noSub'; |
| 52 | + |
| 53 | + $html .= "\t\t\t\t".'<div class="navBar" id="'.$id.'">'."\n"; |
| 54 | + |
55 | 55 | $html .= "\t\t\t\t\t" . l('Cover', $section == 'Cover') . " \\\n"; |
56 | 56 | $html .= "\t\t\t\t\t" . l('Exhibition', $section == 'Exhibition') . " \\\n"; |
57 | 57 | $html .= "\t\t\t\t\t" . l('Reference', in_array($section, $ref)) . " \\\n"; |
58 | 58 | $html .= "\t\t\t\t\t" . l('Learning', in_array($section, $learn)) . " \\\n"; |
59 | 59 | $html .= "\t\t\t\t\t" . l('Download', $section == 'Download') . " \\\n"; |
60 | 60 | $html .= "\t\t\t\t\t" . l('Shop', $section == 'Shop') . " \\\n"; |
61 | 61 | $html .= "\t\t\t\t\t" . l('About', in_array($section, $abo)) . " \n"; |
62 | | - |
| 62 | + |
63 | 63 | $html .= "\t\t\t\t\t" . "<a href=\"http://code.google.com/p/processing\"" . 'class="faq"' . ">»Code</a>\n"; |
64 | | - $html .= "\t\t\t\t\t" . "<a href=\"http://wiki.processing.org\"" . 'class="wiki"' . ">»Wiki</a>\n"; |
65 | | - $html .= "\t\t\t\t\t" . "<a href=\"http://forum.processing.org\"" . 'class="forum"' . ">»Forum</a>\n"; |
66 | | - $html .= "\t\t\t\t\t" . "<a href=\"http://feed.processing.org\"" . 'class="feed"' . ">»Feed</a>\n"; |
67 | | - |
| 64 | + $html .= "\t\t\t\t\t" . "<a href=\"http://wiki.processing.org\"" . 'class="wiki"' . ">»Wiki</a>\n"; |
| 65 | + $html .= "\t\t\t\t\t" . "<a href=\"http://forum.processing.org\"" . 'class="forum"' . ">»Forum</a>\n"; |
| 66 | + $html .= "\t\t\t\t\t" . "<a href=\"http://feed.processing.org\"" . 'class="feed"' . ">»Feed</a>\n"; |
| 67 | + |
68 | 68 | $html .= "\t\t\t\t</div>\n"; |
69 | | - |
70 | | - if (in_array($section, $abo)) { |
71 | | - $html .= "\t\t\t\t" . '<div class="navBar abo" id="subNav">' . "\n"; |
72 | | - |
73 | | - $html .= "\t\t\t\t\t" . l('Overview', $section == 'Overview') . " \\\n"; |
74 | | - $html .= "\t\t\t\t\t" . l('People', $section == 'People') . " \\\n"; |
75 | | - $html .= "\t\t\t\t\t" . l('Patrons', $section == 'Patrons') . " \n"; |
76 | | - $html .= "\t\t\t\t</div>\n"; |
77 | | - |
78 | | - } else if (in_array($section, $ref)) { |
79 | | - $html .= "\t\t\t\t" . '<div class="navBar" id="subNav">' . "\n"; |
80 | | - |
81 | | - if ($lang == 'en') { |
| 69 | + |
| 70 | + if (in_array($section, $abo)) { |
| 71 | + $html .= "\t\t\t\t" . '<div class="navBar abo" id="subNav">' . "\n"; |
| 72 | + |
| 73 | + $html .= "\t\t\t\t\t" . l('Overview', $section == 'Overview') . " \\\n"; |
| 74 | + $html .= "\t\t\t\t\t" . l('People', $section == 'People') . " \\\n"; |
| 75 | + $html .= "\t\t\t\t\t" . l('Patrons', $section == 'Patrons') . " \n"; |
| 76 | + $html .= "\t\t\t\t</div>\n"; |
| 77 | + |
| 78 | + } else if (in_array($section, $ref)) { |
| 79 | + $html .= "\t\t\t\t" . '<div class="navBar" id="subNav">' . "\n"; |
| 80 | + |
| 81 | + if ($lang == 'en') { |
82 | 82 | $html .= "\t\t\t\t\t" . l('Language', $section == 'Language') . " ("; |
83 | | - $html .= l('A-Z', $section == 'A-Z') . ") \\\n"; |
| 83 | + $html .= l('A-Z', $section == 'A-Z') . ") \\\n"; |
84 | 84 | $html .= "\t\t\t\t\t" . l('Libraries', $section == 'Libraries') . " \\\n"; |
85 | | - $html .= "\t\t\t\t\t" . l('Tools', $section == 'Tools') . " \\\n"; |
86 | | - $html .= "\t\t\t\t\t" . l('Environment', $section == 'Environment') . " \n"; |
87 | | - } |
88 | | - |
89 | | - $html .= "\t\t\t\t</div>\n"; |
90 | | - |
91 | | - } else if (in_array($section, $learn)) { |
92 | | - $html .= "\t\t\t\t" . '<div class="navBar learning" id="subNav">' . "\n"; |
93 | | - |
94 | | - $html .= "\t\t\t\t\t" . l('Tutorials', $section == 'Tutorials') . " \\\n Examples: "; |
95 | | - $html .= "\t\t\t\t\t" . l('Basics', $section == 'Basics') . ", \n"; |
96 | | - $html .= "\t\t\t\t\t" . l('Topics', $section == 'Topics') . ", \n"; |
97 | | - $html .= "\t\t\t\t\t" . l('3D', $section == '3D') . ", \n"; |
98 | | - $html .= "\t\t\t\t\t" . l('Library', $section == 'Library') . " \\\n"; |
99 | | - $html .= "\t\t\t\t\t" . l('Books', $section == 'Books') . " \n"; |
100 | | - $html .= "\t\t\t\t</div>\n"; |
101 | | - } |
102 | | - |
103 | | - return $html . "\t\t\t</div>\n"; |
104 | | -} |
105 | | - |
106 | | -function l($s, $c) |
107 | | -{ |
108 | | - global $pages; |
109 | | - return "<a href=\"{$pages[$s][0]}\"" . ($c ? ' class="active"' : '') . ">$s</a>"; |
110 | | -} |
111 | | - |
112 | | -function short_nav($section) |
113 | | -{ |
114 | | - $html = "\t\t\t".'<div id="navigation">'."\n"; |
115 | | - $html .= "\t\t\t\t".'<div class="navBar" id="mainnav_noSub">'."\n"; |
116 | | - |
117 | | - $html .= "\t\t\t\t\t<a href=\"http://processing.org/\"" . ($section == 'Cover' ? ' class="active"' : '') . ">Cover</a> \\ \n"; |
118 | | - $html .= "\t\t\t\t\t<a href=\"/reference/index.html\"" . ($section == 'Language' ? ' class="active"' : '') . ">Language</a> \\ \n"; |
| 85 | + $html .= "\t\t\t\t\t" . l('Tools', $section == 'Tools') . " \\\n"; |
| 86 | + $html .= "\t\t\t\t\t" . l('Environment', $section == 'Environment') . " \n"; |
| 87 | + } |
| 88 | + |
| 89 | + $html .= "\t\t\t\t</div>\n"; |
| 90 | + |
| 91 | + } else if (in_array($section, $learn)) { |
| 92 | + $html .= "\t\t\t\t" . '<div class="navBar learning" id="subNav">' . "\n"; |
| 93 | + |
| 94 | + $html .= "\t\t\t\t\t" . l('Tutorials', $section == 'Tutorials') . " \\\n Examples: "; |
| 95 | + $html .= "\t\t\t\t\t" . l('Basics', $section == 'Basics') . ", \n"; |
| 96 | + $html .= "\t\t\t\t\t" . l('Topics', $section == 'Topics') . ", \n"; |
| 97 | + $html .= "\t\t\t\t\t" . l('3D', $section == '3D') . ", \n"; |
| 98 | + $html .= "\t\t\t\t\t" . l('Library', $section == 'Library') . " \\\n"; |
| 99 | + $html .= "\t\t\t\t\t" . l('Books', $section == 'Books') . " \n"; |
| 100 | + $html .= "\t\t\t\t</div>\n"; |
| 101 | + } |
| 102 | + |
| 103 | + return $html . "\t\t\t</div>\n"; |
| 104 | +} |
| 105 | + |
| 106 | +function l($s, $c) |
| 107 | +{ |
| 108 | + global $pages; |
| 109 | + return "<a href=\"{$pages[$s][0]}\"" . ($c ? ' class="active"' : '') . ">$s</a>"; |
| 110 | +} |
| 111 | + |
| 112 | +function short_nav($section) |
| 113 | +{ |
| 114 | + $html = "\t\t\t".'<div id="navigation">'."\n"; |
| 115 | + $html .= "\t\t\t\t".'<div class="navBar" id="mainnav_noSub">'."\n"; |
| 116 | + |
| 117 | + $html .= "\t\t\t\t\t<a href=\"http://processing.org/\"" . ($section == 'Cover' ? ' class="active"' : '') . ">Cover</a> \\ \n"; |
| 118 | + $html .= "\t\t\t\t\t<a href=\"/reference/index.html\"" . ($section == 'Language' ? ' class="active"' : '') . ">Language</a> \\ \n"; |
119 | 119 | $html .= "\t\t\t\t\t<a href=\"/reference/libraries/index.html\"" . ($section == 'Libraries' ? ' class="active"' : '') . ">Libraries</a> \\ \n"; |
120 | | - $html .= "\t\t\t\t\t<a href=\"/reference/tools/index.html\"" . ($section == 'Tools' ? ' class="active"' : '') . ">Tools</a> \\ \n"; |
121 | | - $html .= "\t\t\t\t\t<a href=\"/reference/environment/index.html\"" . ($section == 'Environment' ? ' class="active"' : '') . ">Environment</a>\n"; |
122 | | - |
123 | | - $html .= "\t\t\t\t</div>\n"; |
124 | | - $html .= "\t\t\t</div>\n"; |
125 | | - |
126 | | - return $html; |
127 | | -} |
128 | | - |
129 | | -function local_nav($section, $rel_path='') |
130 | | -{ |
131 | | - $html = "\t\t\t".'<div id="navigation">'."\n"; |
132 | | - $html .= "\t\t\t\t".'<div class="navBar" id="mainnav_noSub">'."\n"; |
133 | | - |
| 120 | + $html .= "\t\t\t\t\t<a href=\"/reference/tools/index.html\"" . ($section == 'Tools' ? ' class="active"' : '') . ">Tools</a> \\ \n"; |
| 121 | + $html .= "\t\t\t\t\t<a href=\"/reference/environment/index.html\"" . ($section == 'Environment' ? ' class="active"' : '') . ">Environment</a>\n"; |
| 122 | + |
| 123 | + $html .= "\t\t\t\t</div>\n"; |
| 124 | + $html .= "\t\t\t</div>\n"; |
| 125 | + |
| 126 | + return $html; |
| 127 | +} |
| 128 | + |
| 129 | +function local_nav($section, $rel_path='') |
| 130 | +{ |
| 131 | + $html = "\t\t\t".'<div id="navigation">'."\n"; |
| 132 | + $html .= "\t\t\t\t".'<div class="navBar" id="mainnav_noSub">'."\n"; |
| 133 | + |
134 | 134 | $html .= "\t\t\t\t\t<a href=\"{$rel_path}index.html\"" . ($section == 'Language' ? ' class="active"' : '') . ">Language</a> ("; |
135 | | - $html .= "<a href=\"{$rel_path}alpha.html\"" . ($section == 'A-Z' ? ' class="active"' : '') . ">A-Z</a>) \\ \n"; |
| 135 | + $html .= "<a href=\"{$rel_path}alpha.html\"" . ($section == 'A-Z' ? ' class="active"' : '') . ">A-Z</a>) \\ \n"; |
136 | 136 | $html .= "\t\t\t\t\t<a href=\"{$rel_path}libraries/index.html\"" . ($section == 'Libraries' ? ' class="active"' : '') . ">Libraries</a> \\ \n"; |
137 | | - $html .= "\t\t\t\t\t<a href=\"{$rel_path}tools/index.html\"" . ($section == 'Tools' ? ' class="active"' : '') . ">Tools</a> \\ \n"; |
138 | | - $html .= "\t\t\t\t\t<a href=\"{$rel_path}environment/index.html\"" . ($section == 'Environment' ? ' class="active"' : '') . ">Environment</a>\n"; |
139 | | - |
140 | | - $html .= "\t\t\t\t</div>\n"; |
141 | | - $html .= "\t\t\t</div>\n"; |
142 | | - |
143 | | - return $html; |
144 | | -} |
145 | | - |
146 | | -function reference_nav($current = '') |
147 | | -{ |
148 | | - global $lang; |
149 | | - global $translation; |
150 | | - global $LANGUAGES; |
151 | | - $tr = $translation->navigation; |
152 | | - |
153 | | - $html = "<a href=\"index.html\">$tr[abridged]</a>"; |
154 | | - if ($LANGUAGES[$lang][2]) { |
155 | | - $html .= " (<a href=\"index_alpha.html\">$tr[az]</a>)"; |
156 | | - } |
157 | | - $html .= " \ <a href=\"index_ext.html\">$tr[complete]</a>"; |
158 | | - if ($LANGUAGES[$lang][2]) { |
159 | | - $html .= " (<a href=\"index_alpha_ext.html\">$tr[az]</a>)"; |
160 | | - } |
161 | | - $html .= " \ <a href=\"changes.html\">$tr[changes]</a>"; |
162 | | - return $html; |
163 | | -} |
164 | | - |
165 | | -function language_nav($current) |
166 | | -{ |
167 | | - global $LANGUAGES; |
168 | | - global $FINISHED; |
169 | | - if (count($FINISHED) < 2) { return ''; } |
170 | | - |
171 | | - $html = "\t".'Language: <select name="nav" size="1" class="refnav" onChange="javascript:gogo(this)">'."\n"; |
172 | | - foreach ($FINISHED as $code) { |
173 | | - if ($LANGUAGES[$code][3] != '' ) { |
174 | | - $sel = ($current == $code) ? ' selected="selected"' : ''; |
175 | | - $html .= "\t\t<option value=\"{$LANGUAGES[$code][3]}\"$sel>{$LANGUAGES[$code][0]}</option>\n"; |
176 | | - } |
177 | | - } |
178 | | - $html .= "\t</select>\n"; |
179 | | - return $html; |
180 | | -} |
181 | | - |
182 | | -function library_nav($current=null) |
183 | | -{ |
184 | | - $html = "\n\t<span class=\"lib-nav\">\n"; |
185 | | - $html .= "\t\t<a href=\"../index.html\">Libraries</a>\n"; |
186 | | - if ($current) { |
187 | | - $html .= "\t\t \ <a href=\"index.html\">".ucfirst($current)."</a>\n"; |
188 | | - } |
189 | | - $html .= "\t</span>\n"; |
190 | | - return $html; |
191 | | -} |
192 | | - |
193 | | -function examples_nav($current) { |
194 | | - // $html = "\n\t<div id=\"examples-nav\">\n"; |
195 | | -} |
196 | | -?> |
| 137 | + $html .= "\t\t\t\t\t<a href=\"{$rel_path}tools/index.html\"" . ($section == 'Tools' ? ' class="active"' : '') . ">Tools</a> \\ \n"; |
| 138 | + $html .= "\t\t\t\t\t<a href=\"{$rel_path}environment/index.html\"" . ($section == 'Environment' ? ' class="active"' : '') . ">Environment</a>\n"; |
| 139 | + |
| 140 | + $html .= "\t\t\t\t</div>\n"; |
| 141 | + $html .= "\t\t\t</div>\n"; |
| 142 | + |
| 143 | + return $html; |
| 144 | +} |
| 145 | + |
| 146 | +function reference_nav($current = '') |
| 147 | +{ |
| 148 | + global $lang; |
| 149 | + global $translation; |
| 150 | + global $LANGUAGES; |
| 151 | + $tr = $translation->navigation; |
| 152 | + |
| 153 | + $html = "<a href=\"index.html\">$tr[abridged]</a>"; |
| 154 | + if ($LANGUAGES[$lang][2]) { |
| 155 | + $html .= " (<a href=\"index_alpha.html\">$tr[az]</a>)"; |
| 156 | + } |
| 157 | + $html .= " \ <a href=\"index_ext.html\">$tr[complete]</a>"; |
| 158 | + if ($LANGUAGES[$lang][2]) { |
| 159 | + $html .= " (<a href=\"index_alpha_ext.html\">$tr[az]</a>)"; |
| 160 | + } |
| 161 | + $html .= " \ <a href=\"changes.html\">$tr[changes]</a>"; |
| 162 | + return $html; |
| 163 | +} |
| 164 | + |
| 165 | +function language_nav($current) |
| 166 | +{ |
| 167 | + global $LANGUAGES; |
| 168 | + global $FINISHED; |
| 169 | + if (count($FINISHED) < 2) { return ''; } |
| 170 | + |
| 171 | + $html = "\t".'Language: <select name="nav" size="1" class="refnav" onChange="javascript:gogo(this)">'."\n"; |
| 172 | + foreach ($FINISHED as $code) { |
| 173 | + if ($LANGUAGES[$code][3] != '' ) { |
| 174 | + $sel = ($current == $code) ? ' selected="selected"' : ''; |
| 175 | + $html .= "\t\t<option value=\"{$LANGUAGES[$code][3]}\"$sel>{$LANGUAGES[$code][0]}</option>\n"; |
| 176 | + } |
| 177 | + } |
| 178 | + $html .= "\t</select>\n"; |
| 179 | + return $html; |
| 180 | +} |
| 181 | + |
| 182 | +function library_nav($current=null) |
| 183 | +{ |
| 184 | + $html = "\n\t<span class=\"lib-nav\">\n"; |
| 185 | + $html .= "\t\t<a href=\"../index.html\">Libraries</a>\n"; |
| 186 | + if ($current) { |
| 187 | + $html .= "\t\t \ <a href=\"index.html\">".ucfirst($current)."</a>\n"; |
| 188 | + } |
| 189 | + $html .= "\t</span>\n"; |
| 190 | + return $html; |
| 191 | +} |
| 192 | + |
| 193 | +function examples_nav($current) { |
| 194 | + // $html = "\n\t<div id=\"examples-nav\">\n"; |
| 195 | +} |
| 196 | +?> |
0 commit comments