-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleShow.php
More file actions
executable file
·85 lines (64 loc) · 2.01 KB
/
ModuleShow.php
File metadata and controls
executable file
·85 lines (64 loc) · 2.01 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
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
<?php
include_once("sk.php");
include_once("GetPut.php");
include_once("ThingLib.php");
include_once("vendor/erusev/parsedown/Parsedown.php");
global $FACTION;
$GM = Access('GM');
if (!$GM && !$FACTION) {
Error_Page("Sorry you need to be a GM or a Player to access this");
}
dostaffhead("Modules");
$Techs = Get_Techs();
$TNames = NamesList($Techs);
$Mods = Get_ModuleTypes();
function Msort($a,$b) {
return $a['Name'] <=> $b['Name'];
}
uasort($Mods,'Msort');
if (isset($_REQUEST['f'])) {
$Fid = $_REQUEST['f'];
} else if (isset($_REQUEST['F'])) {
$Fid = $_REQUEST['F'];
} else {
$Fid = 0;
}
if ($FACTION) {
$Fid = $FACTION['id'];
} else {
$FACTION = Get_Faction($Fid);
}
// if (!Access('GM') && $FACTION['TurnState'] > 2) Player_Page();
//var_dump($Techs); exit;
$TechFacts = [];
if ($Fid) {
$TechFacts = Get_Faction_Techs($Fid);
}
$Parsedown = new Parsedown();
if ($GM) {
if (isset($_REQUEST['FORCE'])) {
$GM=false;
} else {
echo "<h2><a href=ModuleShow.php?F=$Fid&FORCE>This Page in Player Mode</a></h2>";
}
}
echo "<h1>Modules</h1>\n";
echo "Click on Modules name to Toggle showing the definition and examples or <button type=button onclick=SeeAll('MDesc')>Expand All</button>\n<p>";
foreach ($Mods as $Mid=>$M) {
if ($M['Leveled'] & MOD_NEEDTECH) {
if (!Has_Tech($Fid,$M['BasedOn'])) continue;
}
echo "<div class=TechDesc><h2 onclick=Toggle('MDesc$Mid')>" . $M['Name'] . "</h2>\n";
if ($M['BasedOn']) echo "Based On: " . ($TNames[$M['BasedOn']]??'Unknown');
if ($M['MinShipLevel']) echo " - Min Ship Level: " . $M['MinShipLevel'];
if ($GM && ($M['Leveled'] & 16)!=0) echo " - <span class=red>Restricted</span>";
echo "<p><div id=MDesc$Mid hidden>";
if ($M['Description']) {
echo $Parsedown->text(stripslashes($M['Description']));
} else {
echo "Description not yet written - inform the GMs...";
}
echo "</div></div><p>";
}
dotail();
echo "<p>";