2004-05-17 02:14:54 +00:00
|
|
|
<?php
|
|
|
|
//
|
2004-05-18 19:58:35 +00:00
|
|
|
// "$Id: html.php,v 1.7 2004/05/18 19:58:35 mike Exp $"
|
2004-05-17 02:14:54 +00:00
|
|
|
//
|
|
|
|
// PHP functions for standardized HTML output...
|
|
|
|
//
|
|
|
|
// This file should be included using "include_once"...
|
|
|
|
//
|
|
|
|
// Contents:
|
|
|
|
//
|
|
|
|
// html_header() - Show the standard page header and navbar...
|
|
|
|
// html_footer() - Show the standard footer for a page.
|
|
|
|
// html_start_links() - Start of series of hyperlinks.
|
|
|
|
// html_end_links() - End of series of hyperlinks.
|
|
|
|
// html_link() - Show a single hyperlink.
|
|
|
|
// html_links() - Show an array of links.
|
|
|
|
// html_start_box() - Start a rounded, shaded box.
|
|
|
|
// html_end_box() - End a rounded, shaded box.
|
|
|
|
// html_start_table() - Start a rounded, shaded table.
|
|
|
|
// html_end_table() - End a rounded, shaded table.
|
|
|
|
// html_start_row() - Start a table row.
|
|
|
|
// html_end_row() - End a table row.
|
|
|
|
//
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
//
|
|
|
|
// Include necessary headers...
|
|
|
|
//
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
include_once "globals.php";
|
|
|
|
include_once "auth.php";
|
|
|
|
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
//
|
|
|
|
// Search keywords...
|
|
|
|
//
|
|
|
|
|
|
|
|
$html_keywords = array(
|
|
|
|
"documentation",
|
|
|
|
"functions",
|
|
|
|
"library",
|
|
|
|
"linux",
|
|
|
|
"macos x",
|
|
|
|
"mini-xml",
|
|
|
|
"mxml",
|
|
|
|
"mxmldoc",
|
|
|
|
"software",
|
|
|
|
"unix",
|
|
|
|
"windows",
|
|
|
|
"xml"
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_header()' - Show the standard page header and navbar...
|
|
|
|
//
|
|
|
|
|
|
|
|
function // O - User information
|
|
|
|
html_header($title = "") // I - Additional document title
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
global $html_keywords, $argc, $argv, $PHP_SELF, $LOGIN_USER;
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
// Check for a logout on the command-line...
|
|
|
|
if ($argc == 1 && $argv[0] == "logout")
|
|
|
|
{
|
|
|
|
auth_logout();
|
|
|
|
$argc = 0;
|
|
|
|
}
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
// Common stuff...
|
|
|
|
print("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN' "
|
|
|
|
."'http://www.w3.org/TR/REC-html40/loose.dtd'>\n");
|
|
|
|
print("<html>\n");
|
|
|
|
print("<head>\n");
|
|
|
|
|
|
|
|
// Title...
|
|
|
|
if ($title != "")
|
|
|
|
$html_title = "$title -";
|
|
|
|
else
|
|
|
|
$html_title = "";
|
|
|
|
|
|
|
|
print(" <title>$html_title Mini-XML</title>\n"
|
|
|
|
." <meta http-equiv='Pragma' content='no-cache'/>\n"
|
|
|
|
." <meta http-equiv='Content-Type' content='text/html; "
|
|
|
|
."charset=iso-8859-1'/>\n"
|
|
|
|
." <link rel='stylesheet' type='text/css' href='style.css'/>\n");
|
|
|
|
|
|
|
|
// Search engine keywords...
|
|
|
|
reset($html_keywords);
|
|
|
|
|
|
|
|
list($key, $val) = each($html_keywords);
|
|
|
|
print("<meta name='keywords' content='$val");
|
|
|
|
|
|
|
|
while (list($key, $val) = each($html_keywords))
|
|
|
|
print(",$val");
|
|
|
|
|
|
|
|
print("'/>\n");
|
|
|
|
|
|
|
|
print("</head>\n"
|
|
|
|
."<body>\n");
|
|
|
|
|
|
|
|
// Standard navigation stuff...
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<p><table width='100%' height='100%' border='0' cellspacing='0' "
|
|
|
|
."cellpadding='0'>\n"
|
|
|
|
."<tr class='header' height='40'>"
|
|
|
|
."<td valign='top'><img src='images/top-left.gif' width='15' height='15' "
|
|
|
|
."alt=''/></td>"
|
2004-05-18 01:39:00 +00:00
|
|
|
."<td><img src='images/logo.gif' width='39' height='32' "
|
|
|
|
."alt='Mini-XML' align='middle'/> </td>"
|
|
|
|
."<td width='100%'>[ <a href='index.php'>Home</a> | "
|
2004-05-18 03:39:38 +00:00
|
|
|
."<a href='articles.php'>Articles</a> | "
|
2004-05-17 02:14:54 +00:00
|
|
|
."<a href='documentation.php'>Documentation</a> | "
|
|
|
|
."<a href='software.php'>Download</a> | "
|
2004-05-17 20:28:52 +00:00
|
|
|
."<a href='str.php'>Support</a> ]</td>"
|
|
|
|
."<td align='right'>[ ");
|
|
|
|
|
|
|
|
|
|
|
|
if ($LOGIN_USER)
|
|
|
|
print("<a href='account.php'>$LOGIN_USER</a>");
|
|
|
|
else
|
|
|
|
print("<a href='login.php'>Login</a>");
|
|
|
|
|
|
|
|
print(" ]</td>"
|
|
|
|
."<td valign='top'><img src='images/top-right.gif' width='15' height='15' "
|
|
|
|
."alt=''/></td>"
|
2004-05-17 02:14:54 +00:00
|
|
|
."</tr>\n");
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<tr class='page' height='100%'><td></td>"
|
2004-05-18 01:39:00 +00:00
|
|
|
."<td colspan='3' valign='top'>"
|
2004-05-17 20:28:52 +00:00
|
|
|
."<table width='100%' height='100%' border='0' cellpadding='5' "
|
|
|
|
."cellspacing='0'><tr><td valign='top'>");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_footer()' - Show the standard footer for a page.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
|
|
|
html_footer()
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
print("</td></tr></table></td><td></td></tr>\n");
|
2004-05-17 03:23:06 +00:00
|
|
|
print("<tr class='header'>"
|
2004-05-17 20:28:52 +00:00
|
|
|
."<td valign='bottom'><img src='images/bottom-left.gif' width='15' "
|
|
|
|
."height='15' alt=''/></td>"
|
2004-05-18 01:39:00 +00:00
|
|
|
."<td colspan='3'><small> <br />"
|
2004-05-17 20:28:52 +00:00
|
|
|
."Copyright 2003-2004 by Michael Sweet. This library is free "
|
2004-05-17 02:14:54 +00:00
|
|
|
."software; you can redistribute it and/or modify it "
|
|
|
|
."under the terms of the GNU Library General Public "
|
|
|
|
."License as published by the Free Software Foundation; "
|
|
|
|
."either version 2 of the License, or (at your option) "
|
2004-05-17 20:28:52 +00:00
|
|
|
."any later version.<br /> </small></td>"
|
|
|
|
."<td valign='bottom'><img src='images/bottom-right.gif' width='15' "
|
|
|
|
."height='15' alt=''/></td>"
|
2004-05-17 02:14:54 +00:00
|
|
|
."</tr>\n");
|
|
|
|
print("</table></p>\n");
|
|
|
|
print("</body>\n"
|
|
|
|
."</html>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_start_links()' - Start of series of hyperlinks.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
|
|
|
html_start_links($center = 0) // I - 1 for centered, 0 for in-line
|
|
|
|
{
|
|
|
|
global $html_firstlink;
|
|
|
|
|
|
|
|
$html_firstlink = 1;
|
|
|
|
|
|
|
|
if ($center)
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<p class='center' align='center'>[ ");
|
|
|
|
else
|
|
|
|
print("<p>[ ");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_end_links()' - End of series of hyperlinks.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
2004-05-17 20:28:52 +00:00
|
|
|
html_end_links()
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
print(" ]</p>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_link()' - Show a single hyperlink.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
|
|
|
html_link($text, // I - Text for hyperlink
|
|
|
|
$link) // I - URL for hyperlink
|
|
|
|
{
|
|
|
|
global $html_firstlink;
|
|
|
|
|
|
|
|
if ($html_firstlink)
|
|
|
|
$html_firstlink = 0;
|
|
|
|
else
|
|
|
|
print(" | ");
|
|
|
|
|
|
|
|
$safetext = str_replace(" ", " ", $text);
|
|
|
|
|
|
|
|
print("<a href='$link'>$safetext</a>");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_links()' - Show an array of links.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
2004-05-17 20:28:52 +00:00
|
|
|
html_links($links) // I - Associated array of hyperlinks
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
reset($links);
|
|
|
|
while (list($key, $val) = each($links))
|
2004-05-17 20:28:52 +00:00
|
|
|
html_link($key, $val);
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_start_table()' - Start a rounded, shaded table.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_table($headings) // I - Array of heading strings
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
global $html_row, $html_cols;
|
|
|
|
|
|
|
|
print("<p><table width='100%' border='0' cellpadding='0' cellspacing='0'>"
|
|
|
|
."<tr class='header'><th align='left' valign='top'>"
|
2004-05-17 20:28:52 +00:00
|
|
|
."<img src='images/top-left.gif' width='16' height='16' "
|
2004-05-17 02:14:54 +00:00
|
|
|
."alt=''/></th>");
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
$add_html_cols = 0; // Add to html_cols after display if colspan is used.
|
2004-05-17 02:14:54 +00:00
|
|
|
$html_row = 0;
|
|
|
|
$html_cols = sizeof($headings);
|
|
|
|
|
|
|
|
reset($headings);
|
|
|
|
for ($i = 0; $i < $html_cols; $i ++)
|
|
|
|
{
|
|
|
|
//
|
|
|
|
// Headings can be in the following forms:
|
|
|
|
//
|
|
|
|
// Mix and match as needed:
|
|
|
|
//
|
|
|
|
// "xxxxxxxx" -- Just a column heading.
|
|
|
|
// "xxxxxxxx:aa" -- Heading with align.
|
|
|
|
// "xxxxxxxx::cc" -- Heading with a colspan.
|
|
|
|
// "xxxxxxxx:::ww" -- Heading with a width.
|
|
|
|
// "xxxxxxxx:cc:ww" -- Heading with colspan and width.
|
|
|
|
// "xxxxxxxx:aa:cc:ww" -- Heading with align, colspan and width.
|
|
|
|
//
|
|
|
|
// etc, etc.
|
|
|
|
//
|
|
|
|
|
|
|
|
$s_header = "";
|
|
|
|
$s_colspan = "";
|
|
|
|
$s_width = "";
|
|
|
|
$s_align = "";
|
|
|
|
|
|
|
|
if (strstr( $headings[$i], ":" ))
|
|
|
|
{
|
|
|
|
$data = explode( ":", $headings[$i] );
|
|
|
|
|
|
|
|
$s_header = $data[0];
|
|
|
|
|
|
|
|
if (ISSET($data[1]))
|
|
|
|
{
|
|
|
|
$align = $data[1];
|
|
|
|
$s_align = "align=$align";
|
|
|
|
}
|
2004-05-17 20:28:52 +00:00
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($data[2] > 0)
|
|
|
|
{
|
|
|
|
$colspan = $data[2];
|
|
|
|
$s_colspan = "colspan=$colspan";
|
|
|
|
if ($colspan > 1)
|
2004-05-17 20:28:52 +00:00
|
|
|
$add_html_cols += ($colspan - 1);
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
2004-05-17 20:28:52 +00:00
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($data[3] > 0)
|
|
|
|
{
|
|
|
|
$width = $data[3];
|
|
|
|
$s_width = "width=$width%";
|
|
|
|
}
|
|
|
|
}
|
2004-05-17 20:28:52 +00:00
|
|
|
else
|
|
|
|
$s_header = $headings[$i];
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
if (strlen($s_header))
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<th $s_align $s_colspan $s_width>$s_header</th>");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
print("<th $s_colspan $s_width> </th>");
|
|
|
|
}
|
|
|
|
}
|
2004-05-17 20:28:52 +00:00
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
$html_cols += $add_html_cols;
|
|
|
|
|
|
|
|
print("<th align='right' valign='top'>"
|
2004-05-17 20:28:52 +00:00
|
|
|
."<img src='images/top-right.gif' "
|
2004-05-17 02:14:54 +00:00
|
|
|
."width='16' height='16' alt=''/></th></tr>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_end_table()' - End a rounded, shaded table.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
2004-05-17 20:28:52 +00:00
|
|
|
html_end_table()
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
global $html_cols;
|
|
|
|
|
|
|
|
print("<tr class='header'><th align='left' valign='bottom'>"
|
2004-05-17 20:28:52 +00:00
|
|
|
."<img src='images/bottom-left.gif' width='16' height='16' "
|
2004-05-17 02:14:54 +00:00
|
|
|
."alt=''/></th>"
|
|
|
|
."<th colspan='$html_cols'> </th>"
|
2004-05-17 20:28:52 +00:00
|
|
|
."<th align='right' valign='bottom'><img src='images/bottom-right.gif' "
|
2004-05-17 02:14:54 +00:00
|
|
|
."width='16' height='16' alt=''/></th></tr>\n"
|
|
|
|
."</table></p>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_start_row()' - Start a table row.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_row($classname = "") // I - HTML class to use
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
global $html_row;
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($classname == "")
|
|
|
|
$classname = "data$html_row";
|
|
|
|
|
|
|
|
print("<tr class='$classname'><td> </td>");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 'html_end_row()' - End a table row.
|
|
|
|
//
|
|
|
|
|
|
|
|
function
|
|
|
|
html_end_row()
|
|
|
|
{
|
|
|
|
global $html_row;
|
|
|
|
|
|
|
|
$html_row = 1 - $html_row;
|
|
|
|
|
|
|
|
print("</td><td> </td></tr>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|