*
*/
$_indent_level = 0;
$_trcolor = 0;
// Set the current Indent Level
function do_indent ($str, $v = 0)
{
global $_indent_level;
if($v < 0)
$_indent_level += $v;
if($_indent_level > 0)
$str = str_repeat(" ", $_indent_level) . $str;
if($v > 0)
$_indent_level += $v;
return $str;
}
// HTML BR
function html_br ($count = 1)
{
return do_indent(str_repeat(" \n", $count));
}
// HTML A HREF
function html_ahref ($label, $url, $extra = "")
{
$label = stripslashes($label);
if (!$label and $url)
{
if (ereg("@",$url))
{
return do_indent(" $url ");
}
else
{
return do_indent(" $url ");
}
}
else if (!$label)
{
return do_indent(" ");
}
else
{
return do_indent(" $label ");
}
}
// HTML echo a string
function html_echo ($str)
{
return do_indent($str);
}
// HTML B (bold)
function html_b ($str)
{
return do_indent("$str ");
}
// HTML SMALL (small text)
function html_small ($str)
{
return do_indent("$str ");
}
// HTML P
function html_p ($str = " ", $extra = null)
{
return do_indent("
$str
");
}
// HTML blockquote
function html_blockquote ($str = " ", $extra = null)
{
return do_indent("$str ");
}
// Draw a Colored Pixel Line
function html_line ($width = "100%", $height = 1, $color = "grey")
{
global $file_root;
return ' ';
}
function html_frame_start ($title = "", $width = "", $cellPad = 5, $cellSpc = 1, $color = "color2", $extra = "")
{
global $file_root;
global $_indent_level;
$_indent_level++;
if ($width) { $width = 'width="'.$width.'"'; }
$str = "\n".''."\n";
$str .= '
'."\n";
if ($title) {
$str .= ' '."\n";
}
$str .= ''."\n";
$str .= ''."\n";
return $str;
}
function html_frame_end ($text = "")
{
global $file_root;
global $_trcolor;
global $_indent_level;
$_indent_level--;
$str .= '
'."\n";
$str .= ' '."\n";
if ($text)
{
$str .= ' '."\n";
}
$str .= "
\n
\n\n";
$_trcolor = 0;
return $str;
}
function html_round_frame_start ($title = "", $width = "", $extra = "", $innerPad = 5)
{
global $file_root;
if ($width) { $width = 'width="'.$width.'"'; }
$str = "\n".''."\n";
$str .= '
'."\n";
if($title) {
$str .= ' '."\n";
}
$str .= ''."\n";
$str .= ''."\n";
return $str;
}
function html_round_frame_end ($text = "")
{
global $file_root;
$str .= '
'."\n";
if ($text)
{
$str .= ' '."\n";
}
$str .= "
\n
\n\n";
return $str;
}
function html_frame_row_color ($text = " ")
{
global $_trcolor;
if ($_trcolor % 2 == 1) { $trcolor = 'color2'; } else { $trcolor = 'color1'; }
$str = ''.$text.' '."\n";
$_trcolor++;
return $str;
}
function html_frame_row ($text = " ", $extra = null)
{
$str = ''.$text.' '."\n";
return $str;
}
function html_frame_tr ($td = " ", $color = "color2", $extra = null)
{
$str = ''."\n".$td.' '."\n";
return do_indent($str);
}
function html_frame_td ($txt = " ", $extra = null)
{
$str = ''.$txt.' '."\n";
return do_indent($str);
}
function html_frame_row_form ($name = " ", $field = " ")
{
$str = ' '."\n";
$str .= ' '.$field.' '."\n";
return $str;
}
function html_frame_row_form_title ($name = " ")
{
$str = ' '."\n";
return $str;
}
function html_select ($name, $values, $default = null, $descs = null)
{
$str = "\n";
while(list($idx, $value) = each($values))
{
$desc = $value;
if($descs)
$desc = $descs[$idx];
if($value == $default)
$str .= " $desc\n";
else
$str .= " $desc\n";
}
$str .= " \n";
return $str;
}
function html_back_link ($howmany = 1, $url = "")
{
if (!$url)
{
$url = 'javascript:history.back('.$howmany.');';
}
return ' << Back
'."\n";
}
function html_form_start ($script, $name, $method = "post")
{
$str = ''."\n";
}
function html_form_input_text ($name, $size = 20, $value = "")
{
$str = ' '."\n";
return $str;
}
function html_form_input_password ($name, $size = 20, $value = "")
{
$str = ' '."\n";
return $str;
}
function html_form_input_hidden ($name, $value = "")
{
$str = ' '."\n";
return $str;
}
function html_form_input_textarea ($name, $cols = 20, $rows = 5, $value = "")
{
$str = ''."\n";
return $str;
}
function html_form_input_select ($name, $options, $selected = "")
{
$str = ''."\n";
while(list($key, $val) = each($options))
{
if ($key == $selected)
{
$str .= ''.$val.' '."\n";
} else {
$str .= ''.$val.' '."\n";
}
}
$str .= ' '."\n";
return $str;
}
function html_form_input_checkbox ($name, $checked = null)
{
if ($checked == 1)
$str = ' '."\n";
else
$str = ' '."\n";
return $str;
}
function html_form_submit ($value = "")
{
$str = ' '."\n";
return $str;
}
function html_form_js_button ($url = null)
{
global $PHP_SELF;
if (!$url) { $url = $PHP_SELF; }
$str = ' '."\n";
return $str;
}
function html_add_br ($text = "")
{
$text = ereg_replace("\n"," \n",$text);
return $text;
}
// url-ify urls
function html_urlify ($text)
{
$text = htmlspecialchars($text);
$urlreg = "([a-zA-Z]+://([^\t\r\n ]+))";
if (ereg($urlreg,$text))
{
$text = ereg_replace($urlreg, " \\2 ", $text);
}
$emailreg = "([a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+)";
if (ereg($emailreg,$text))
{
$text = ereg_replace($emailreg, "\\1 ", $text);
}
return $text;
}
// simple httpd header redirect
function redirect ($url = ".")
{
header("Location: ".$url);
}
function html_header ($title, $extra = "")
{
global $file_root;
?>
=$title?>
=$extra?>
}
function html_footer ()
{
?>
LucasArts, Monkey Island, Maniac Mansion, Full Throttle,
The Dig, LOOM, and probably lots of other things are
registered trademarks of
LucasArts, Inc. .
All other trademarks and registered trademarks are
owned by their respective companies.
ScummVM is not affiliated in any way with LucasArts, Inc.
}
?>