// Preamble
$pageName = "CVAR Documentation for " . $program;
require "parts/preamble.php"; // Load most of document
have ('cvar');
function printRow ($flags, $name, $description)
{
echo '
' . $flags . ' | ' . $name . ' | ' . $description . ' |
';
}
function printArray ($cvar_list, $program)
{
tableBoxHeader ('black', tableHeadColor);
tableTitle ("cvars available in " . $program, 3, tableHeadColor);
printRow ('flags', 'name', 'description');
while (list (, $cvar) = each ($cvar_list)) {
$flags = str_replace (' ', ' ', substr ($cvar, 0, 4));
$pos = strpos ($cvar, ':');
$name = trim (substr ($cvar, 5, $pos - 6));
$description = trim (substr ($cvar, $pos + 1));
printRow ($flags, $name, $description);
}
tableBoxFooter ();
}
function printCvarlist ($program)
{
$cvar_list = file ('doc/' . $program . '-cvar.txt');
printArray ($cvar_list, $program);
}
if (strchr ($program, '.') || strchr ($program, '/') || !is_file ('doc/' . $program . '-cvar.txt')) {
echo 'no such program.';
} else {
tableBoxHeader ('black', tableHeadColor);
tableTitle ("cvar flags", 2, tableHeadColor);
echo 'r | read only. Must be set on command line or in the config file. |
';
echo '* | Archived. Will be saved to config.cfg. |
';
echo 'u | Userinfo. Changes will be sent to the server. |
';
echo 's | Serverinfo. Changes will be sent to the clients. |
';
tableBoxFooter ();
echo '';
printCvarlist ($program);
}
?>