0)
$str = str_repeat(" ", $_indent_level) . $str;
if($v > 0)
$_indent_level += $v;
return $str . "\n";
}
function do_html_tr($t, $arr, $class, $extra)
{
if(strlen($class))
$class = " class=\"$class\"";
/* $extra contains parameters to
, such as valign="top" */
if(strlen($extra))
$extra = " $extra";
$str = do_indent("
", 1);
for($i = 0; $i < sizeof($arr); $i++)
{
/* If it is not an array, it contains the entire table cell. If it
is an array, [0] holds the main content and [1] the options like
valign="top" */
if(is_array($arr[$i]))
{
$val = $arr[$i][0];
$extra = " ".$arr[$i][1];
}
else
{
$val = $arr[$i];
$extra = "";
}
if (! $val)
{
$val = " ";
}
if(stristr($val, "<$t"))
{
$str .= do_indent($val);
}
else
{
$str .= do_indent("<$t$class$extra> ".trim($val)." $t>", 0);
}
}
$str .= do_indent("
", -1);
return $str;
}
// HTML TR
function html_tr($arr, $class = "", $extra = "")
{
return do_html_tr("td", $arr, $class, $extra);
}
// HTML TABLE
function html_table_begin($extra = "")
{
return do_indent("", 1);
}
function html_table_end()
{
return do_indent("
", -1);
}
// HTML HTML
function html_begin()
{
return do_indent("", 1);
}
function html_end()
{
return do_indent("", -1);
}
// HTML HEAD
function html_head($title, $stylesheet = 0)
{
$str = do_indent("", 1);
$str .= do_indent(" $title ", 0);
if($stylesheet)
$str .= do_indent("", 0);
$str .= do_indent("", -1);
return $str;
}
// HTML BODY
function html_body_begin()
{
return do_indent("", 1);
}
function html_body_end()
{
return do_indent("", -1);
}
// HTML A HREF
function html_ahref($label, $url, $extra = "")
{
$label = stripslashes($label);
if (!$label and $url)
{
return do_indent(" $url ");
}
else if (!$label)
{
return do_indent(" ");
}
else
{
return do_indent(" $label ");
}
}
function html_imagebutton($text, $url, $extra = "")
{
static $i = 1;
$i++;
$img1 = apidb_url("util/button.php?text=".urlencode($text)."&pressed=0");
$img2 = apidb_url("util/button.php?text=".urlencode($text)."&pressed=1");
$java = "onMouseDown = 'document.img$i.src = \"$img2\"; return true;' ";
$java .= "onMouseUp = 'document.img$i.src = \"$img1\"; return true;' ";
return "\n\n
\n";
}
function html_frame_start($title = "", $width = "", $extra = "", $innerPad = 0)
{
if ($width) { $width = 'width="'.$width.'"'; }
$str = ''."\n";
if ($title)
{
$str .= '
|
';
}
$str .= '
 |
|
 |
';
return $str;
}
function html_select($name, $values, $default = null, $descs = null)
{
$str = "\n";
return $str;
}
function html_back_link($howmany = 1, $url = "")
{
if (!$url)
{
$url = 'javascript:history.back('.$howmany.');';
}
return ' << Back
'."\n";
}
function p()
{
return "\n
\n";
}
function add_br($text = "")
{
$text = ereg_replace("\n","
\n",$text);
return $text;
}
function make_dll_option_list($varname, $dllid = -1)
{
$db = new ApiDB();
echo "\n";
}
function make_inx_option_list($varname, $inx = null)
{
$list = array("yes", "no", "stub", "unknown");
echo "\n";
}
/* Displays a note box */
function html_note($shTitle, $shBody)
{
$shRet = '';
$shRet .= '
';
$shRet .= $shTitle;
$shRet .= '
';
$shRet .= '
';
$shRet .= $shBody;
$shRet .= '
';
return $shRet;
}
function html_radiobuttons($aIds, $aOptions, $sName, $sDefault = '', $bLineBreaks = true)
{
$shRet = '';
for($i = 0; $i < sizeof($aIds); $i++)
{
if($aIds[$i] == $sDefault)
$shChecked = ' checked="checked"';
else
$shChecked = '';
$shRet .= ' " . $aOptions[$i];
if($bLineBreaks)
$shRet .= '
';
}
return $shRet;
}
function html_checkbox($sName, $sValue, $shText, $bChecked)
{
if($bChecked)
$sSelected = ' checked="checked"';
else
$sSelected = '';
return " $shText\n";
}
function html_checkboxes($sName, $aValues, $aTexts, $aSelected)
{
$shRet = '';
for($i = 0; $i < sizeof($aValues); $i++)
$shRet .= html_checkbox($sName.$i, $aValues[$i], $aTexts[$i], $aSelected[$i]).'
';
return $shRet;
}
function html_read_input_series($sName, $aInput, $iCount)
{
$aRet = array();
for($i = 0; $i < $iCount; $i++)
{
$aRet[] = getInput($sName.$i, $aInput);
}
return $aRet;
}
?>