mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-27 22:42:57 +00:00
1d2c2c1726
rewrite documentation.php (I'll have to rethink it due to the slow rendering in netscape) add a link to the docs form the 0.5 section of files.php
62 lines
1.4 KiB
PHP
62 lines
1.4 KiB
PHP
<? // Preamble>
|
|
$pageName = "Command Documentation for " . $program;
|
|
$focused = "none"; // Dock icon name to gets a border
|
|
require("parts/preamble.php"); // Load most of document
|
|
?>
|
|
|
|
<?
|
|
have ('cmd');
|
|
|
|
function printRow ($name, $description)
|
|
{
|
|
echo '<TR vAlign="top"><TD>' . $name . '</TD><TD>' . $description . '</TD></TR>';
|
|
}
|
|
|
|
function printArray ($cmd_list, $program)
|
|
{
|
|
tableBoxHeader ('black', tableHeadColor);
|
|
tableTitle ("cmds available in " . $program, 2, tableHeadColor);
|
|
|
|
printRow ('name', 'description');
|
|
|
|
$description = '';
|
|
while (list (, $cmd) = each ($cmd_list)) {
|
|
$pos = strpos ($cmd, ' :');
|
|
if ($pos > 0) {
|
|
if ($description) {
|
|
printRow ($name, $description);
|
|
$description = '';
|
|
}
|
|
$name = trim (substr ($cmd, 0, $pos - 1));
|
|
} else {
|
|
if ($description) {
|
|
$description = $description . '<BR>' . trim ($cmd);
|
|
} else {
|
|
$description = trim ($cmd);
|
|
}
|
|
}
|
|
}
|
|
if ($description) {
|
|
printRow ($name, $description);
|
|
$description = '';
|
|
}
|
|
|
|
tableBoxFooter ();
|
|
}
|
|
|
|
function printCmdlist ($program)
|
|
{
|
|
$cmd_list = file ('doc/' . $program . '-cmd.txt');
|
|
printArray ($cmd_list, $program);
|
|
}
|
|
|
|
if (strchr ($program, '.') || strchr ($program, '/') || !is_file ('doc/' . $program . '-cmd.txt')) {
|
|
echo 'no such program.';
|
|
} else {
|
|
printCmdlist ($program);
|
|
}
|
|
?>
|
|
|
|
<?
|
|
require("parts/postamble.php"); // Finish this sucker up
|
|
?>
|