first installment of code that actually generates some html. docbook template file will follow

This commit is contained in:
seek3r 2001-12-25 00:00:23 +00:00
parent c1b0ce4001
commit 193c99f669
2 changed files with 94 additions and 2 deletions

View File

@ -142,8 +142,6 @@
* limiting and selecting what to print *
\**************************************************************************/
include ('../phpgwapi/inc/class.Template.inc.php');
if (!isset($GLOBALS['HTTP_GET_VARS']['object_type']))
{
$GLOBALS['object_type'] = 'function';
@ -314,5 +312,40 @@
{
$doc_array = Array($GLOBALS['HTTP_GET_VARS']['object'] => $GLOBALS['special_request']);
}
include ('../phpgwapi/inc/class.Template.inc.php');
$curdir = getcwd();
$GLOBALS['template'] = new template($curdir);
$output_format = 'html';
$GLOBALS['template']->set_file(array('tpl_file' => 'inlinedocparser_'.$output_format.'.tpl',));
$GLOBALS['template']->set_block('tpl_file','border_top');
$GLOBALS['template']->set_block('tpl_file', 'group');
$GLOBALS['template']->set_block('tpl_file', 'object');
$GLOBALS['template']->set_block('tpl_file','border_bottom');
$GLOBALS['template']->set_block('tpl_file','abstract');
$GLOBALS['template']->set_block('tpl_file','params');
$GLOBALS['template']->set_block('tpl_file','param_entry');
$GLOBALS['template']->fp('doc','border_top',True);
reset($doc_array);
while(list($group_key, $group_value) = each($doc_array))
{
$GLOBALS['template']->set_var('group_name',$group_key);
/* This is where most of the work in creating the output gets done */
while(list($object_key, $object_value) = each($group_value))
{
$GLOBALS['template']->set_var('object_name',$object_key);
// while(list($object_key, $object_value) = each($group_value))
// {
// }
$GLOBALS['template']->fp('group_contents','object',True);
}
$GLOBALS['template']->fp('doc','group',True);
}
$GLOBALS['template']->fp('doc','border_bottom',True);
$GLOBALS['template']->pfp('out', 'doc');
array_print($doc_array);
?>

View File

@ -0,0 +1,59 @@
<!-- BEGIN submit_button -->
<input tabindex="{button_tabindex}" type="submit" value="{button_value}" name="{button_name}" class="blacktext">&nbsp;
<!-- END submit_button -->
<!-- BEGIN border_top -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META name="AUTHOR" content="phpGroupWare inline documentation parser http://www.phpgroupware.org">
<META NAME="description" CONTENT="phpGroupWare documentation">
<META NAME="keywords" CONTENT="phpGroupWare documentation">
<TITLE>Local setup - Login</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- END border_top -->
<!-- BEGIN group -->
<H1>{group_name}</H1>
{group_contents}
<P>
<!-- END group -->
<!-- BEGIN object -->
<H2>{object_name}</H2>
{object_contents}
<BR>
<!-- END object -->
<!-- BEGIN reference_list_of_types -->
'abstract','param','example','syntax','result','description','discussion','author','copyright','package','access'
<!-- END reference_list_of_types -->
<!-- BEGIN abstract -->
<R>Abstract: {abstract}</P>
<!-- END abstract -->
<!-- BEGIN params -->
<TABLE border="1">
<TR>
<TD>Name</TD>
<TD>Details</TD>
</TR>
{param_entry}
</TABLE>
<!-- END params -->
<!-- BEGIN param_entry -->
<tr>
<td>{name}</td>
<td>{details}</td>
</tr>
<!-- END param_entry -->
<!-- BEGIN border_bottom -->
</BODY>
</HTML>
<!-- END border_bottom -->