Changeset View
Changeset View
Standalone View
Standalone View
index.php
1 | <?php | 1 | <?php | ||
---|---|---|---|---|---|
2 | /* | | |||
3 | $selected_branch = $branch; | | |||
4 | $selected_language = $language; | | |||
5 | */ | | |||
6 | 2 | | |||
7 | $name="KDE Documentation Team"; | 3 | use App\Kernel; | ||
8 | $url="https://bugs.kde.org/enter_bug.cgi?format=guided&product=docs"; | 4 | use Symfony\Component\Debug\Debug; | ||
9 | $show_intro = false; | 5 | use Symfony\Component\HttpFoundation\Request; | ||
10 | /* | | |||
11 | * Read the _BIG_ arrays produced by the | | |||
12 | * doc production script | | |||
13 | */ | | |||
14 | include 'generated_used.inc.php'; | | |||
15 | 6 | | |||
16 | /* | 7 | require dirname(__DIR__).'/config/bootstrap.php'; | ||
17 | - Get the variables from the URL | | |||
18 | - Initialize to sane defaults if empty | | |||
19 | - Check the different levels of given | | |||
20 | parameters for existence. | | |||
21 | - Set to sane defaults if nonexistent | | |||
22 | */ | | |||
23 | include 'include/initialize.inc.php'; | | |||
24 | 8 | | |||
25 | /* | 9 | if ($_SERVER['APP_DEBUG']) { | ||
26 | Produce lists later used to iterate over | 10 | umask(0000); | ||
27 | the according level in the | | |||
28 | generated_used.inc.php array | | |||
29 | Generated variables: | | |||
30 | $branches (from generated_used.inc.php) | | |||
31 | $languagelist: An list of all languages | | |||
32 | $packagelist: An list of all packages | | |||
33 | */ | | |||
34 | include 'include/produce_lists.inc.php'; | | |||
35 | 11 | | |||
36 | // Compare branches (priority), used by usort()/uasort() | 12 | Debug::enable(); | ||
37 | function cmp_branches($b1, $b2) { | | |||
38 | $base_array = array('trunk5' => 0, 'stable5' => 1, 'trunk4' => 2, 'stable4' => 3); | | |||
39 | if (in_array($b1, $base_array) && in_array($b2, $base_array)) { | | |||
40 | return $base_array[$b1] - $base_array[$b2]; | | |||
41 | } | 13 | } | ||
42 | } | | |||
43 | | ||||
44 | /* | | |||
45 | Return the proper package/namespace for the specified application and | | |||
46 | branch, using the knowledge generated by the documentation | | |||
47 | generator. | | |||
48 | */ | | |||
49 | function get_namespace($application, $branch) | | |||
50 | { | | |||
51 | global $programs_multiplemodules; | | |||
52 | if ( array_key_exists($application, $programs_multiplemodules) ) { | | |||
53 | // multiple packages/namespaces: check in the special list of programs_docs | | |||
54 | // with multiple modules if there is specific module for the current branch. | | |||
55 | foreach ( $programs_multiplemodules[$application] as $s_branch => $s_module ) { | | |||
56 | if ( $s_branch == $branch ) { | | |||
57 | return $s_module; | | |||
58 | } | | |||
59 | } | | |||
60 | } else { | | |||
61 | global $modules_programs; | | |||
62 | // single module for all branches, find it | | |||
63 | foreach ( $modules_programs as $module => $module_apps ) { | | |||
64 | if ( in_array($application, $module_apps) ) { | | |||
65 | return $module; | | |||
66 | } | | |||
67 | } | | |||
68 | } | | |||
69 | } | | |||
70 | | ||||
71 | function build_url( $application='', $package='', $lang='', $branch='', $html_path='' ) | | |||
72 | { | | |||
73 | $params = array(); | | |||
74 | if ( strlen($branch) > 0 ) | | |||
75 | $params[] = "branch=".$branch; | | |||
76 | if ( strlen($lang) > 0 ) | | |||
77 | $params[] = "language=".$lang; | | |||
78 | if ( strlen($package) > 0 ) | | |||
79 | $params[] = "package=".$package; | | |||
80 | if ( strlen($application) > 0 ) | | |||
81 | $params[] = "application=".$application; | | |||
82 | if ( strlen($html_path) > 0 ) | | |||
83 | $params[] = "path=".$html_path; | | |||
84 | return "/index.php?" . implode('&', $params); | | |||
85 | } | | |||
86 | | ||||
87 | function build_path( $branch='', $lang='', $application='', $html_path='' ) | | |||
88 | { | | |||
89 | $package = get_namespace($application, $branch); | | |||
90 | return $branch . | | |||
91 | "/" . $lang . | | |||
92 | "/" . $package . | | |||
93 | "/" . $application . | | |||
94 | "/" . $html_path; | | |||
95 | } | | |||
96 | | ||||
97 | function language_for_application_exist( $app, $lang ) | | |||
98 | { | | |||
99 | global $programs_docs; | | |||
100 | return (array_key_exists($lang, $programs_docs[$app])); | | |||
101 | } | | |||
102 | | ||||
103 | function branch_exist( $app, $lang, $branch ) | | |||
104 | { | | |||
105 | global $programs_docs; | | |||
106 | // no translations for the specified application in the current language | | |||
107 | if ( !language_for_application_exist($app, $lang) ) { | | |||
108 | return ""; | | |||
109 | } | | |||
110 | // Handle old URL - compatibility with the old schema | | |||
111 | $compatibility_branches = array( | | |||
112 | "development" => array("trunk5", "trunk4"), | | |||
113 | "stable" => array("stable5", "stable4"), | | |||
114 | ); | | |||
115 | // Search in compatibility branches first | | |||
116 | if ( array_key_exists($branch, $compatibility_branches) ) { | | |||
117 | foreach ( $compatibility_branches[$branch] as $comp_branch ) { | | |||
118 | # echo "Looking for $comp_branch into ".var_dump($programs_docs[$app][$lang]); | | |||
119 | if ( in_array($comp_branch, $programs_docs[$app][$lang]) ) { | | |||
120 | return $comp_branch; | | |||
121 | } | | |||
122 | } | | |||
123 | } | | |||
124 | // Normal branch | | |||
125 | if ( in_array($branch, $programs_docs[$app][$lang]) ) { | | |||
126 | return $branch; | | |||
127 | } | | |||
128 | return ""; | | |||
129 | } | | |||
130 | | ||||
131 | if ( $selected_application != "" ) { | | |||
132 | $apps = array($selected_application); | | |||
133 | | ||||
134 | // If branch is specified and correct, jump to the documentation | | |||
135 | if ( $selected_branch != "" ) { | | |||
136 | if (!language_for_application_exist( $selected_application, $selected_language )) { | | |||
137 | $selected_language_nonexist = $selected_language; | | |||
138 | $selected_language = "en"; | | |||
139 | } | | |||
140 | $looked_branch = branch_exist( $selected_application, $selected_language, $selected_branch ); | | |||
141 | if ( $looked_branch != "" ) { | | |||
142 | header( "Location: /".build_path( $looked_branch, $selected_language, $selected_application, $html_path ) ); | | |||
143 | } else { | | |||
144 | $selected_branch_nonexist = $selected_branch; | | |||
145 | $selected_branch = ""; | | |||
146 | } | | |||
147 | } | | |||
148 | } elseif ( $selected_package != "" ) { | | |||
149 | $apps = $modules_programs[$selected_package]; | | |||
150 | } else { | | |||
151 | $show_intro = true; | | |||
152 | } | | |||
153 | | ||||
154 | /* This is the actual start of the page as the media framework knows it */ | | |||
155 | | ||||
156 | | ||||
157 | /* include('include/docs.inc'); */ | | |||
158 | | ||||
159 | $applications_list_json = json_encode(array_keys($programs_docs)); | | |||
160 | include('include/functions.inc'); | | |||
161 | include('include/header_docs.inc'); | | |||
162 | | ||||
163 | /* We are really printing HTML, WOW */ | | |||
164 | | ||||
165 | /* Build the menu */ | | |||
166 | | ||||
167 | echo "<!-- docs own magic starts to show here -->"; | | |||
168 | | ||||
169 | echo " | | |||
170 | <div id=\"menu\"> | | |||
171 | "; | | |||
172 | echo " | | |||
173 | <ul id=\"important\"> | | |||
174 | "; | | |||
175 | echo "<li><a href=\"http://userbase.kde.org/\">KDE UserBase</a></li>\n"; | | |||
176 | echo "<li><a href=\"http://forum.kde.org/\">KDE Community Forums</a></li>\n"; | | |||
177 | echo " | | |||
178 | </ul> | | |||
179 | "; | | |||
180 | | ||||
181 | | ||||
182 | | ||||
183 | | ||||
184 | echo " | | |||
185 | <form action='/docsearch/omega' method='GET'> | | |||
186 | <ul id=\"docs_search\"> | | |||
187 | <li> | | |||
188 | Language: | | |||
189 | <select name='B'> | | |||
190 | "; | | |||
191 | foreach ( $languagelist as $language ) { | | |||
192 | if ( $language != $selected_language ){ | | |||
193 | echo "\t<option value=\"L".$language."\">".$language."</option>"; | | |||
194 | } else { | | |||
195 | echo "\t<option value=\"L".$language."\" selected='selected'>".$language."</option>"; | | |||
196 | } | | |||
197 | } | | |||
198 | echo " | | |||
199 | </select> | | |||
200 | </li> | | |||
201 | <li> | | |||
202 | Documentation branch: | | |||
203 | <select name='B'> | | |||
204 | "; | | |||
205 | foreach ( $searchbranchlist as $sbranch ) { | | |||
206 | if ( $sbranch == "stable" ){ | | |||
207 | $sbranchname = "Released" ; | | |||
208 | } elseif ( $sbranch == "trunk" ){ | | |||
209 | $sbranchname = "Development" ; | | |||
210 | } else { | | |||
211 | $sbranchname = $sbranch ; | | |||
212 | } | | |||
213 | if ( $sbranch != $search_branch ){ | | |||
214 | echo "\t<option value=\"XBRANCHGENERIC".$sbranch."\">".$sbranchname."</option>"; | | |||
215 | } else { | | |||
216 | echo "\t<option value=\"XBRANCHGENERIC".$sbranch."\" selected='selected'>".$sbranchname."</option>"; | | |||
217 | } | | |||
218 | } | | |||
219 | echo " | | |||
220 | </select> | | |||
221 | </li> | | |||
222 | <li> | | |||
223 | Match: | | |||
224 | <select name='DEFAULTOP'> | | |||
225 | <option value='and' checked>All words</option> | | |||
226 | <option value='or'>Any word</option> | | |||
227 | </select> | | |||
228 | </li> | | |||
229 | <li> | | |||
230 | Words: | | |||
231 | <input type='search' name='P' value='' class=\"text_input\" /> | | |||
232 | </li> | | |||
233 | <li class=\"search_button\"> | | |||
234 | <input type='submit' value='Search'/> | | |||
235 | </li> | | |||
236 | </ul> | | |||
237 | <input type='hidden' name='DEFAULTOP' value='and'> | | |||
238 | <input type='hidden' name='xFILTERS' value='--O'> | | |||
239 | </form> | | |||
240 | "; | | |||
241 | | ||||
242 | | ||||
243 | // end of search block | | |||
244 | | ||||
245 | echo " | | |||
246 | <p class=\"intro\">This server contains the complete user documentation for KDE (except the playground module).</p> | | |||
247 | <p class=\"intro\">You can select the release and language of the documentation you are searching for. Not all languages have all documentation translated.</p> | | |||
248 | <p class=\"intro\">The API documentation is available at <a href=\"http://api.kde.org/\">api.kde.org</a>.</p> | | |||
249 | | ||||
250 | <p>"; | | |||
251 | | ||||
252 | | ||||
253 | if (isset($name) && isset($url)) { | | |||
254 | $contact = i18n_var("Maintained by ") . " <a href=\"$url\">$name</a><br />\n"; | | |||
255 | } else { | | |||
256 | $contact = i18n_var("Maintained by <a href=\"mailto:webmaster@kde.org\">kde.org Webmaster</a><br />\n"); | | |||
257 | } | | |||
258 | | ||||
259 | print $contact; | | |||
260 | | ||||
261 | echo "</p><p id=\"legal\">"; | | |||
262 | i18n("KDE and K Desktop Environment are trademarks of"); | | |||
263 | echo " <a href=\"http://www.kde.org/areas/kde-ev/\" title=\""; | | |||
264 | i18n("Homepage of the KDE non-profit Organization"); | | |||
265 | echo "\">"; | | |||
266 | i18n("KDE e.V."); | | |||
267 | echo "</a> | <a href=\"http://www.kde.org/contact/impressum.php\">"; | | |||
268 | i18n("Legal"); | | |||
269 | echo "</a> | | |||
270 | </p> | | |||
271 | | ||||
272 | </div> | | |||
273 | "; | | |||
274 | | ||||
275 | echo "<script type=\"text/javascript\"> | | |||
276 | function formSubmit() { | | |||
277 | document.forms.selectionform.submit(); | | |||
278 | } | | |||
279 | </script>"; | | |||
280 | | ||||
281 | echo "<div id='navigation'>"; | | |||
282 | | ||||
283 | echo " | | |||
284 | <form name=\"applicationform\" action='/index.php' method='get'> | | |||
285 | <ul id=\"applicationform\" class=\"ui-widget\"> | | |||
286 | <li> | | |||
287 | Application Name:<br /> | | |||
288 | <input type='text' id='applicationlist' name='application' class=\"text_input\" /> | | |||
289 | <input type='hidden' name='language' value='$selected_language' /> | | |||
290 | <input type='submit' value='Open' id=\"openbutton\"/> | | |||
291 | </li> | | |||
292 | </ul> | | |||
293 | </form> | | |||
294 | 14 | | |||
295 | "; | 15 | if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) { | ||
296 | 16 | Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST); | |||
297 | echo " | | |||
298 | <form name=\"selectionform\" action='/index.php' method='get'> | | |||
299 | <input type='hidden' name='application' value='$selected_application' /> | | |||
300 | <input type='hidden' name='package' value='$selected_package' /> | | |||
301 | <ul id=\"selectionform\"> | | |||
302 | <li> | | |||
303 | Language:<br /> | | |||
304 | <select name='language' onchange=\"formSubmit()\"> | | |||
305 | "; | | |||
306 | foreach ( $languagelist as $language ) { | | |||
307 | if ( $language != $selected_language ){ | | |||
308 | echo "\t<option value=\"".$language."\">".$language."</option>"; | | |||
309 | } else { | | |||
310 | echo "\t<option value=\"".$language."\" selected='selected'>".$language."</option>"; | | |||
311 | } | | |||
312 | } | | |||
313 | echo " | | |||
314 | </select> | | |||
315 | </li> | | |||
316 | <li id=\"applybutton\"> | | |||
317 | <input type='submit' value='Apply'/> | | |||
318 | <script type=\"text/javascript\"> | | |||
319 | if (document.getElementById) { | | |||
320 | document.getElementById(\"applybutton\").style.display=\"none\"; | | |||
321 | } | | |||
322 | </script> | | |||
323 | </li> | | |||
324 | </ul> | | |||
325 | </form> | | |||
326 | "; | | |||
327 | | ||||
328 | echo "<ul class=\"packagemenu\">\n"; | | |||
329 | foreach ( $packagelist as $package ) { | | |||
330 | $package_class = ( $package == $selected_package )?" class=\"current\"":""; | | |||
331 | echo "\t<li".$package_class.">" . | | |||
332 | "<a href=\"". build_url( '', $package, $selected_language ) . "\">" . | | |||
333 | $package. "</a>" . | | |||
334 | "</li>\n"; | | |||
335 | } | | |||
336 | echo "</ul>\n"; | | |||
337 | | ||||
338 | echo "</div>"; // id=navigation | | |||
339 | | ||||
340 | /* | | |||
341 | Check for packages/dirctories with subdirectories | | |||
342 | Used to produce the i.e. kcontrol break out boxes. | | |||
343 | */ | | |||
344 | | ||||
345 | include 'include/staticappdata.inc.php'; | | |||
346 | | ||||
347 | /* Introduced because of the kocontrol/* */ | | |||
348 | echo "<div id=\"appswrapper\">"; | | |||
349 | | ||||
350 | if ($selected_application_nonexist != "") { | | |||
351 | echo " | | |||
352 | <div class=\"error\"> | | |||
353 | <p>The application <strong>$selected_application_from_user</strong> | | |||
354 | could not be found. Please check if you entered the name correctly, or use the | | |||
355 | navigation on the left to access the complete KDE User Documentation.</p> | | |||
356 | </div> | | |||
357 | "; | | |||
358 | } | | |||
359 | | ||||
360 | if ($selected_branch_nonexist != "") { | | |||
361 | echo " | | |||
362 | <div class=\"error\"> | | |||
363 | <p>The branch <strong>$selected_branch_nonexist</strong> | | |||
364 | is not available for the specified application/language.</p> | | |||
365 | </div> | | |||
366 | "; | | |||
367 | } | | |||
368 | | ||||
369 | if ($selected_language_nonexist != "") { | | |||
370 | echo " | | |||
371 | <div class=\"error\"> | | |||
372 | <p>The requested language <strong>$selected_language_nonexist</strong> | | |||
373 | could not be found. US English was used instead.</p> | | |||
374 | </div> | | |||
375 | "; | | |||
376 | } | | |||
377 | | ||||
378 | if ($selected_package_nonexist != "") { | | |||
379 | echo " | | |||
380 | <div class=\"error\"> | | |||
381 | <p>The package <strong>$selected_package_nonexist</strong> | | |||
382 | could not be found. </p> | | |||
383 | </div> | | |||
384 | "; | | |||
385 | } | | |||
386 | | ||||
387 | if (isset($url_nonexist)) { | | |||
388 | echo " | | |||
389 | <div class=\"error\"> | | |||
390 | <p>The file <strong>$url_nonexist</strong> could not be found. | | |||
391 | Please check if you entered the URL correctly, or use the navigation on the left | | |||
392 | to access the complete KDE User Documentation.</p> | | |||
393 | <p>If you reached this page from another part of the KDE Documentation website or from an other KDE website, | | |||
394 | please <a href=\"mailto:kde-doc-english@kde.org\">notify the KDE Documentation | | |||
395 | Team</a> and report the page where you found the wrong link, so we can fix the problem.</p> | | |||
396 | </div> | | |||
397 | "; | | |||
398 | } | | |||
399 | | ||||
400 | | ||||
401 | if ( $show_intro ) { | | |||
402 | | ||||
403 | include ("intro.inc.html"); | | |||
404 | | ||||
405 | } else { | | |||
406 | #kdepimlibs has no applications | | |||
407 | if ( (in_array($selected_package, $package_no_application_array) ) == false ) { | | |||
408 | echo "<h3>Module: $selected_package</h3>"; | | |||
409 | echo "<ul class=\"apps\" | | |||
410 | id=\"apps$selected_language$selected_package\" | | |||
411 | style=\"display:;\">"; | | |||
412 | } | | |||
413 | foreach ( $apps as $application ) { | | |||
414 | | ||||
415 | /* If the check for a subdir is positive, the subdir is added to the | | |||
416 | subdir_array which is handled below */ | | |||
417 | foreach ( $check_array as $check_string ) { | | |||
418 | $check = strpos( $application, $check_string ); | | |||
419 | if ( $check === false ) { | | |||
420 | $applicationname = $application; | | |||
421 | $checktest = false; | | |||
422 | } else { | | |||
423 | $checktest = true; | | |||
424 | $subdir_array[]=$application; | | |||
425 | break; | | |||
426 | } | | |||
427 | } | | |||
428 | | ||||
429 | /* Identity is important here */ | | |||
430 | if ( $checktest === true ) { | | |||
431 | continue; | | |||
432 | } | 17 | } | ||
433 | 18 | | |||
434 | /* Ignore the oddities defined above */ | 19 | if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) { | ||
435 | foreach ( $ignore_array as $ignore_string ) { | 20 | Request::setTrustedHosts([$trustedHosts]); | ||
436 | $test_string = $selected_package . "/" . $application; | | |||
437 | if ( $test_string == $ignore_string ) { | | |||
438 | $breaktest = true; | | |||
439 | break; | | |||
440 | } else { | | |||
441 | $breaktest = false; | | |||
442 | } | 21 | } | ||
443 | } | | |||
444 | | ||||
445 | if ( $breaktest === true ) { | | |||
446 | continue; | | |||
447 | } | | |||
448 | | ||||
449 | if ( $application == "kcontrol" or $application == "kcontrol5") { | | |||
450 | /* If there ever is a kcontrol docbook outside kdebase | | |||
451 | file_exists must be used. | | |||
452 | */ | | |||
453 | continue; | | |||
454 | } | | |||
455 | /* | | |||
456 | catch docs which are there but have no index.docbook | | |||
457 | or are otherwise broken | | |||
458 | */ | | |||
459 | $total_branches = $programs_docs[$applicationname][$selected_language]; | | |||
460 | if(isset($appdisplayname_array[$applicationname])) { | | |||
461 | $appdisplayname = $appdisplayname_array[$applicationname]; | | |||
462 | } else { | | |||
463 | $appdisplayname = $applicationname; | | |||
464 | } | | |||
465 | if ( $total_branches > 0 ) { | | |||
466 | $app_branches = $programs_docs[$applicationname][$selected_language]; | | |||
467 | usort( $app_branches, 'cmp_branches' ); | | |||
468 | echo "<li class=\"appbox\">$appdisplayname<ul>"; | | |||
469 | foreach ( $app_branches as $available_branch ) { | | |||
470 | $candidate_html = build_path( $available_branch, $selected_language, $application, 'index.html' ); | | |||
471 | if ( file_exists( $candidate_html ) ) { | | |||
472 | echo "<li class=\"appbranch\">"; | | |||
473 | | ||||
474 | echo "<a href='/".$candidate_html."' >".$branch_description[$available_branch]."</a>"; | | |||
475 | | ||||
476 | $candidate_pdf = build_path( $available_branch, $selected_language, $application, $application.".pdf" ); | | |||
477 | if ( file_exists( $candidate_pdf ) ) { | | |||
478 | echo " <a href='/".$candidate_pdf."' class='pdf_link'>(PDF)</a>\n"; | | |||
479 | } | | |||
480 | echo "</li>"; | | |||
481 | } | | |||
482 | } | | |||
483 | echo "</ul></li>\n"; | | |||
484 | } else { | | |||
485 | echo "<li class=\"appbox\"><span class=\"notfinished\">".$appdisplayname."</span>". | | |||
486 | "<div class=\"notfinished\">No documentation available for this language</div></li>"; | | |||
487 | } | | |||
488 | } | | |||
489 | #kdepimlibs has no applications | | |||
490 | if ( (in_array($selected_package, $package_no_application_array) ) == false ) { | | |||
491 | echo "</ul>"; | | |||
492 | } | | |||
493 | /* Needed for breaking up the subboxes (see kdebase)*/ | | |||
494 | $previous_dir=""; | | |||
495 | | ||||
496 | /* Iterate over the subdir_array produced | | |||
497 | above and break it into according boxes | | |||
498 | */ | | |||
499 | foreach ( $subdir_array as $application ) { | | |||
500 | $current_dir = substr( $application, 0, strpos( $application, '/' ) ); | | |||
501 | 22 | | |||
502 | if ( $current_dir != $previous_dir ) { | 23 | $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); | ||
503 | if ( $previous_dir != "" ) { | 24 | $request = Request::createFromGlobals(); | ||
504 | echo "</ul>"; | 25 | $response = $kernel->handle($request); | ||
505 | } | 26 | $response->send(); | ||
506 | echo "<h3>". $appdisplayname_array[$current_dir] ."</h3>"; | 27 | $kernel->terminate($request, $response); | ||
507 | echo "<ul class=\"apps\" | | |||
508 | id=\"apps$selected_language$selected_package$current_dir\" | | |||
509 | style=\"display:;\">"; | | |||
510 | } | | |||
511 | | ||||
512 | $applicationname = str_replace( '/', '', strstr( $application, '/' ) ); | | |||
513 | | ||||
514 | $app_branches = $programs_docs[$application][$selected_language]; | | |||
515 | usort( $app_branches, 'cmp_branches' ); | | |||
516 | echo "<li class=\"appbox\">$appdisplayname_array[$applicationname]<ul>"; | | |||
517 | foreach ( $app_branches as $available_branch ) { | | |||
518 | $candidate_html = build_path( $available_branch, $selected_language, $application, 'index.html' ); | | |||
519 | if ( file_exists( $candidate_html ) ) { | | |||
520 | echo "<li class=\"appbranch\">"; | | |||
521 | | ||||
522 | echo "<a href='/".$candidate_html. "' >". | | |||
523 | "<span class=\"subdocs\">". $branch_description[$available_branch] ."</span>"."</a>"; | | |||
524 | $candidate_pdf = build_path( $available_branch, $selected_language, | | |||
525 | $application, $applicationname.".pdf" ); | | |||
526 | if ( file_exists( $candidate_pdf ) ) { | | |||
527 | echo " <a href='/".$candidate_pdf."' class='pdf_link_sub'>(PDF)</a>\n"; | | |||
528 | } | | |||
529 | echo "</li>"; | | |||
530 | } | | |||
531 | } | | |||
532 | echo "</ul></li>\n"; | | |||
533 | | ||||
534 | $previous_dir = $current_dir; | | |||
535 | } | | |||
536 | echo "</ul>"; | | |||
537 | } | | |||
538 | | ||||
539 | /* END appswrapper */ | | |||
540 | echo "</div>"; | | |||
541 | echo "<!-- docs own magic ends here -->" | | |||
542 | ?> | | |||
543 | | ||||
544 | <?php | | |||
545 | include("include/doc_footer.inc"); | | |||
546 | ?> | |