-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhelp.php
More file actions
44 lines (35 loc) · 1.07 KB
/
help.php
File metadata and controls
44 lines (35 loc) · 1.07 KB
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
<?php
/*
* Created on 15.10.2017
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include('Classes/Parsedown.php');
function getHelpMenue() {
$dir = 'info';
$files = scandir($dir);
?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-info-circle "></i> Hilfe <span class="caret"></span></a>
<ul class="dropdown-menu">
<?php
foreach ($files as $file) {
if (preg_match ( '/.md$/', $file )) {
$fileDisp = str_replace( ".md", "", $file);
$fileDisp = str_replace( "_", " ", $fileDisp);
echo "<li><a href=\"#\" onclick=\"showHelpMessage('$file'); return false;\">$fileDisp</a></li>";
}
}
?>
</ul>
</li>
<?php
}
function getHelpMessage($file) {
$file = base64_decode($file);
$content = file_get_contents('info/'.$file);
$Parsedown = new Parsedown();
echo $Parsedown->text($content);
}
?>