some changes to be compatible with seek3r new template-system

This commit is contained in:
Ralf Becker 2002-06-01 10:10:14 +00:00
parent 198abc90cc
commit 100f5bc159
5 changed files with 124 additions and 136 deletions

View File

@ -70,8 +70,8 @@
); );
$this->html = CreateObject('infolog.html'); $this->html = CreateObject('infolog.html');
$this->template = CreateObject('phpgwapi.Template', $this->template = $GLOBALS['phpgw']->template;
$GLOBALS['phpgw']->common->get_tpl_dir('infolog')); $this->template->set_root($GLOBALS['phpgw']->common->get_tpl_dir('infolog')); // for the hooks to work
$this->categories = CreateObject('phpgwapi.categories'); $this->categories = CreateObject('phpgwapi.categories');
$this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
} }
@ -252,6 +252,8 @@
function infoHeaders( $do_sort_header=0,$sort=0,$order=0,$cat_id=0) function infoHeaders( $do_sort_header=0,$sort=0,$order=0,$cat_id=0)
{ {
$headers['th_bg'] = $GLOBALS['phpgw_info']['theme']['th_bg']; $headers['th_bg'] = $GLOBALS['phpgw_info']['theme']['th_bg'];
$headers['row_off'] = $GLOBALS['phpgw_info']['theme']['row_off'];
$headers['row_on'] = $GLOBALS['phpgw_info']['theme']['row_on'];
$fields = array( $fields = array(
'type' => 'Type', 'type' => 'Type',
@ -335,7 +337,6 @@
if (!$for_include) if (!$for_include)
{ {
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
} }
if ($action == '') if ($action == '')
{ {
@ -345,7 +346,10 @@
$t = $this->template; $html = $this->html; $t = $this->template; $html = $this->html;
$t->set_file(array( 'info_list_t' => 'list.tpl' )); $t->set_file(array( 'info_list_t' => 'list.tpl' ));
$t->set_block('info_list_t','projdetails','projdetailshandle');
$t->set_block('info_list_t','info_headers');
$t->set_block('info_list_t','info_list','list'); $t->set_block('info_list_t','info_list','list');
$t->set_block('info_list_t','get_list');
if ($cat_filter) $cat_id = $cat_filter; if ($cat_filter) $cat_id = $cat_filter;
@ -422,6 +426,7 @@
$t->set_var( $this->infoHeaders( !$for_include,$sort,$order,$cat_id )); $t->set_var( $this->infoHeaders( !$for_include,$sort,$order,$cat_id ));
$t->set_var(h_lang_sub,lang('Sub')); $t->set_var(h_lang_sub,lang('Sub'));
$t->set_var(h_lang_action,lang('Action')); $t->set_var(h_lang_action,lang('Action'));
$t->parse('info_headers','info_headers');
// -------------- end header declaration ----------------- // -------------- end header declaration -----------------
$ids = $this->bo->readIdArray($order,$sort,$filter,$cat_id,$query, $ids = $this->bo->readIdArray($order,$sort,$filter,$cat_id,$query,
@ -444,14 +449,12 @@
// project description if subprojectlist // project description if subprojectlist
// ========================================== // ==========================================
$t->set_block('info_list_t','projdetails','projdetailshandle');
switch ($action) switch ($action)
{ {
case 'sp': // details of parent case 'sp': // details of parent
$t->set_var( $this->infoHeaders( )); $t->set_var( $this->infoHeaders( ));
$t->set_var( $this->formatInfo( $action_id )); $t->set_var( $this->formatInfo( $action_id ));
$t->parse('projdetailshandle','projdetails',True); $t->parse('projdetails','projdetailshandle');
break; break;
case 'addr': case 'addr':
case 'proj': case 'proj':
@ -494,7 +497,7 @@
if (intval($for_include) == 2) if (intval($for_include) == 2)
{ {
$t->set_block('info_list_t','info_headers','headershandle'); $t->set_var('info_headers','');
} }
while (list($id,$parent) = each($ids)) while (list($id,$parent) = each($ids))
{ {
@ -559,7 +562,7 @@
'filter' => $filter,'action' => 'sp'))); 'filter' => $filter,'action' => 'sp')));
} }
$t->parse('list','info_list',True); $t->parse('info_list','list',True);
// -------------- end record declaration ------------------------ // -------------- end record declaration ------------------------
} }
@ -576,11 +579,11 @@
if (intval($for_include) == 2) if (intval($for_include) == 2)
{ {
return $t->fp('out','info_list_t',true); return $t->fp('out','get_list',true);
} }
else else
{ {
$t->pfp('out','info_list_t',true); $t->pfp('out','get_list',true);
} }
} }
@ -648,7 +651,6 @@
if ($fileerror) $error[]=$fileerror; if ($fileerror) $error[]=$fileerror;
} }
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$t->set_file(array('info_add_file' => 'add_file.tpl')); $t->set_file(array('info_add_file' => 'add_file.tpl'));
$t->set_var( $this->setStyleSheet( )); $t->set_var( $this->setStyleSheet( ));
@ -869,17 +871,11 @@
)); ));
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$t->set_file(array('info_edit' => 'form.tpl')); $t->set_file(array('info_edit_t' => 'form.tpl'));
$t->set_block('info_edit_t','info_edit');
// ==================================================================== $t->set_block('info_edit_t','add');
// create two seperate blocks, addblock will be cut off from template $t->set_block('info_edit_t','edit');
// editblock contains the buttons and forms for edit
// ====================================================================
$t->set_block('info_edit', 'add', 'addhandle');
$t->set_block('info_edit', 'edit', 'edithandle');
$t->set_block('info_edit', 'subpro', 'subprohandle');
if (is_array($error)) if (is_array($error))
{ {
@ -890,6 +886,7 @@
{ {
case 'sp': case 'sp':
$info_action = 'InfoLog - New Subproject'; $info_action = 'InfoLog - New Subproject';
$t->set_block('info_edit_t', 'subpro');
break; break;
case 'new': case 'addr': case 'proj': case 'event': case 'new': case 'addr': case 'proj': case 'event':
$info_action = 'InfoLog - New'; $info_action = 'InfoLog - New';
@ -897,7 +894,9 @@
$this->bo->so->data['info_type'] = $info_type; $this->bo->so->data['info_type'] = $info_type;
break; break;
default: default:
$info_action = 'InfoLog - Edit'; break; $info_action = 'InfoLog - Edit';
$is_edit = True;
break;
} }
$t->set_var('lang_info_action',lang($info_action) . $t->set_var('lang_info_action',lang($info_action) .
($query_addr ? ' - '.lang('Search for:')." '$query_addr'" : '')); ($query_addr ? ' - '.lang('Search for:')." '$query_addr'" : ''));
@ -1002,11 +1001,8 @@
{ {
$t->set_var('delete_button',$html->submit_button('delete','Delete')); $t->set_var('delete_button',$html->submit_button('delete','Delete'));
} }
$t->set_var('edithandle',''); $t->parse('buttons',$is_edit ? 'edit' : 'add');
$t->set_var('addhandle','');
$t->set_var('subprohandle','');
$t->pfp('out','info_edit'); $t->pfp('out','info_edit');
$t->pfp('edithandle','edit');
} }
function delete( ) function delete( )
@ -1038,7 +1034,6 @@
else else
{ {
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$t->set_file(array( 'info_delete' => 'delete.tpl' )); $t->set_file(array( 'info_delete' => 'delete.tpl' ));
@ -1107,9 +1102,10 @@
} }
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$this->template->set_file(array('info_admin' => 'admin.tpl')); $this->template->set_file(array('info_admin_t' => 'admin.tpl'));
$this->template->set_block('info_admin_t', 'admin_line');
$this->template->set_block('info_admin_t', 'info_admin');
$this->template->set_var(Array( $this->template->set_var(Array(
'title' => lang('InfoLog').' - '.lang('configuration'), 'title' => lang('InfoLog').' - '.lang('configuration'),
@ -1122,7 +1118,6 @@
'lang_trans' => lang('path on (web-)serverside<br>eg. /var/samba/Share'), 'lang_trans' => lang('path on (web-)serverside<br>eg. /var/samba/Share'),
'lang_ip' => lang('reg. expr. for local IP\'s<br>eg. ^192\\.168\\.1\\.') 'lang_ip' => lang('reg. expr. for local IP\'s<br>eg. ^192\\.168\\.1\\.')
)); ));
$this->template->set_block('info_admin', 'admin_line', 'admin_linehandle');
$i = 0; @reset($this->bo->link_pathes); $i = 0; @reset($this->bo->link_pathes);
do { do {
@ -1134,7 +1129,7 @@
'val_trans' => $this->html->input("trans[$i]",$trans), 'val_trans' => $this->html->input("trans[$i]",$trans),
'val_ip' => $this->html->input("ip[$i]",$this->bo->send_file_ips[$valid]) 'val_ip' => $this->html->input("ip[$i]",$this->bo->send_file_ips[$valid])
)); ));
$this->template->parse('admin_linehandle','admin_line',True); $this->template->parse('admin_lines','admin_line',True);
++$i; ++$i;
} while ($valid); } while ($valid);
@ -1169,11 +1164,12 @@
$GLOBALS['phpgw']->common->phpgw_exit(); $GLOBALS['phpgw']->common->phpgw_exit();
} }
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$t = $this->template; $html = $this->html; $t = $this->template; $html = $this->html;
$t->set_file(array('info_prefs' => 'preferences.tpl')); $t->set_file(array('info_prefs_t' => 'preferences.tpl'));
$t->set_block('info_prefs_t','pref_line');
$t->set_block('info_prefs_t','info_prefs');
$vars = Array( $vars = Array(
'title' => lang('InfoLog preferences'), 'title' => lang('InfoLog preferences'),
@ -1184,8 +1180,6 @@
); );
$t->set_var($vars); $t->set_var($vars);
$t->set_block('info_prefs', 'pref_line', 'pref_linehandle');
while (list($pref,$lang) = each($prefs)) while (list($pref,$lang) = each($prefs))
{ {
$t->set_var('bg_nm_color',$this->nextmatchs->alternate_row_color()); $t->set_var('bg_nm_color',$this->nextmatchs->alternate_row_color());
@ -1204,7 +1198,7 @@
$t->set_var('data',$html->checkbox($pref, $t->set_var('data',$html->checkbox($pref,
$GLOBALS['phpgw_info']['user']['preferences']['infolog'][$pref])); $GLOBALS['phpgw_info']['user']['preferences']['infolog'][$pref]));
} }
$t->parse('pref_linehandle','pref_line',True); $t->parse('pref_lines','pref_line',True);
} }
$t->pfp('out','info_prefs'); $t->pfp('out','info_prefs');
} }

View File

@ -1,7 +1,16 @@
<!-- BEGIN admin_line -->
<tr bgcolor="{bg_nm_color}">
<td>{num}:</td>
<td>{val_valid}</td>
<td>{val_trans}</td>
<td>{val_ip}</td>
</tr>
<!-- END admin_line -->
<!-- BEGIN info_admin -->
<p><b>{title}:</b><hr><p> <p><b>{title}:</b><hr><p>
<form action="{action_url}" method="POST"> <form action="{action_url}" method="POST">
<table border="0"> <table border="0">
<!-- BEGIN admin_header -->
<tr bgcolor="{bg_h_color}"> <tr bgcolor="{bg_h_color}">
<td colspan="4">{text}</td> <td colspan="4">{text}</td>
</tr> </tr>
@ -11,15 +20,8 @@
<td>{lang_trans}</td> <td>{lang_trans}</td>
<td>{lang_ip}</td> <td>{lang_ip}</td>
</tr> </tr>
<!-- END admin_header --> {admin_lines}
<!-- BEGIN admin_line -->
<tr bgcolor="{bg_nm_color}">
<td>{num}:</td>
<td>{val_valid}</td>
<td>{val_trans}</td>
<td>{val_ip}</td>
</tr>
<!-- END admin_line -->
</table> </table>
<p>{save_button} &nbsp; {done_button} <p>{save_button} &nbsp; {done_button}
</form> </form>
<!-- END info_admin -->

View File

@ -1,28 +1,47 @@
<!-- BEGIN add -->
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td height="35" width="50%">
<div align="center">
<input type="submit" name="add" value="{lang_addsubmitb}">
</div>
</td>
<td height="35" width="50%">
<div align="center">
<input type="reset" name="reset" value="{lang_addresetb}">
</div>
</td>
</tr>
</table>
<!-- END add -->
<!-- BEGIN edit -->
<table width="90%" border="0">
<tr valing=bottom height=100>
<td>{edit_button}</td>
<td>{cancel_button}</td>
<td width="80%" align=right>{delete_button}</td>
</tr>
</table>
<!-- END edit -->
<!-- BEGIN info_edit -->
{doSearchFkt} {doSearchFkt}
{info_css} {info_css}
<p class=action>{lang_info_action}<br> <p class=action>{lang_info_action}<br>
<hr noshade width="98%" align="center" size="1"> <hr noshade width="98%" align="center" size="1">
<center>{error_list}</center> <center>{error_list}</center>
<center> <center>
<form method="POST" name="EditorForm" action="{actionurl}" enctype="multipart/form-data"> <form method="POST" name="EditorForm" action="{actionurl}" enctype="multipart/form-data">
{common_hidden_vars} {common_hidden_vars}
<table width="90%" border="0" cellspacing="0" cellpadding="2"> <table width="90%" border="0" cellspacing="0" cellpadding="2">
<!-- BEGIN subpro -->
<tr>
<td colspan="2">{lang_project}:</td>
<td colspan="2">{lang_projdesc}</td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<!-- END subpro -->
<tr> <tr>
<td>{lang_type}:</td> <td>{lang_type}:</td>
<td width="40%">{type_list}</td> <td width="40%">{type_list}</td>
<td>{lang_owner}:</td> <td>{lang_owner}:</td>
<td>{owner_info}</td> <td>{owner_info}</td>
</tr> </tr>
@ -78,7 +97,7 @@
<tr> <tr>
<td width="15%">{lang_start_date}:</td> <td width="15%">{lang_start_date}:</td>
<td width="40%">{start_select_date}</td> <td width="40%">{start_select_date}</td>
<td width="15%">{lang_selfortoday}</td> <td width="15%">{lang_selfortoday}</td>
<td>{selfortoday}</td> <td>{selfortoday}</td>
</tr> </tr>
@ -86,7 +105,7 @@
<tr> <tr>
<td>{lang_end_date}:</td> <td>{lang_end_date}:</td>
<td>{end_select_date}</td> <td>{end_select_date}</td>
<td>{lang_dur_days}</td> <td>{lang_dur_days}</td>
<td><input name="dur_days" size="3" maxlength="2" value="">&nbsp;{dur_days}</td> <td><input name="dur_days" size="3" maxlength="2" value="">&nbsp;{dur_days}</td>
</tr> </tr>
@ -96,14 +115,14 @@
<tr> <tr>
<td>{lang_status}:</td> <td>{lang_status}:</td>
<td>{status_list}</td> <td>{status_list}</td>
<td>{lang_category}</td> <td>{lang_category}</td>
<td><select name="info_cat"><option value="0">{lang_none}</option>{cat_list}</select></td> <td><select name="info_cat"><option value="0">{lang_none}</option>{cat_list}</select></td>
</tr> </tr>
<tr> <tr>
<td>{lang_priority}:</td> <td>{lang_priority}:</td>
<td>{priority_list}</td> <td>{priority_list}</td>
<td>{lang_confirm}</td> <td>{lang_confirm}</td>
<td>{confirm_list}</td> <td>{confirm_list}</td>
</tr> </tr>
@ -111,45 +130,14 @@
<tr> <tr>
<td>{lang_responsible}:</td> <td>{lang_responsible}:</td>
<td>{responsible_list}</td> <td>{responsible_list}</td>
<td>{lang_access_type}:</td> <td>{lang_access_type}:</td>
<td>{access_list}</td> <td>{access_list}</td>
</tr> </tr>
</table> </table>
<!-- BEGIN add --> {buttons}
</form>
<table width="90%" border="0" cellspacing="0" cellpadding="0"> </center>
<tr valign="bottom"> <!-- END info_edit -->
<td height="35" width="50%">
<div align="center">
<input type="submit" name="add" value="{lang_addsubmitb}">
</div>
</td>
<td height="35" width="50%">
<div align="center">
<input type="reset" name="reset" value="{lang_addresetb}">
</div>
</td>
</tr>
</table>
</form>
</center>
</html>
<!-- END add -->
<!-- BEGIN edit -->
<table width="90%" border="0">
<tr valing=bottom height=100>
<td>{edit_button}</td>
<td>{cancel_button}</td>
<td width="80%" align=right>{delete_button}</td>
</tr>
</table>
</form>
</center>
</html>
<!-- END edit -->

View File

@ -1,22 +1,3 @@
<!-- InfoLog Start -->
{info_css}
<table width=98%>
<tr>
<td>
<span class=action>{lang_info_action}</span>
</td><td align=center>
{total_matchs}
</td><td align=right>
<span class=action>{add_icons}</span>
</td>
</tr>
</table>
<hr noshade width="98%" align="center" size="1">
<center>
<!-- BEGIN projdetails --> <!-- BEGIN projdetails -->
<table width=95% border=0 cellspacing=1 cellpadding=3> <table width=95% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor="{th_bg}"> <tr bgcolor="{th_bg}">
@ -28,7 +9,7 @@
<td width="10%" class=list>{lang_owner}<br>{lang_datemodified}</td> <td width="10%" class=list>{lang_owner}<br>{lang_datemodified}</td>
<td width="10%" class=list>{lang_responsible}</td> <td width="10%" class=list>{lang_responsible}</td>
</tr> </tr>
<tr bgcolor="{th_bg}" valign="top"> <tr bgcolor="{row_on}" valign="top">
<td class=list>{type}</td> <td class=list>{type}</td>
<td class=list>{status}</td> <td class=list>{status}</td>
<td class=list>{subject}<br>{des}{filelinks}</td> <td class=list>{subject}<br>{des}{filelinks}</td>
@ -39,11 +20,6 @@
</table><p> </table><p>
<!-- END projdetails --> <!-- END projdetails -->
<!-- next_matchs Start -->
{next_matchs}
<!-- next_matchs Ende -->
<table width=95% border=0 cellspacing=1 cellpadding=3>
<!-- BEGIN info_headers --> <!-- BEGIN info_headers -->
<tr bgcolor="{th_bg}"> <tr bgcolor="{th_bg}">
<td width="2%" class=list>{lang_type}</td> <td width="2%" class=list>{lang_type}</td>
@ -74,6 +50,33 @@
</tr> </tr>
<!-- END info_list --> <!-- END info_list -->
<!-- BEGIN get_list -->
{info_css}
<table width=98%>
<tr>
<td>
<span class=action>{lang_info_action}</span>
</td><td align=center>
{total_matchs}
</td><td align=right>
<span class=action>{add_icons}</span>
</td>
</tr>
</table>
<hr noshade width="98%" align="center" size="1">
<center>
{projdetails}
<!-- next_matchs Start -->
{next_matchs}
<!-- next_matchs Ende -->
<table width=95% border=0 cellspacing=1 cellpadding=3>
{info_headers}
{info_list}
</table> </table>
<!-- next_matchs_end Start --> <!-- next_matchs_end Start -->
@ -88,5 +91,4 @@
<td>{back2projects}</td> <td>{back2projects}</td>
</tr> </tr>
</table> </table>
<!-- END get_list -->
<!- InfoLog Ende -->

View File

@ -1,17 +1,19 @@
<p><b>{title}:</b><hr><p>
<form action="{action_url}" method="POST">
<table border="0" align="center" width="90%">
<!-- BEGIN pref_header -->
<tr bgcolor="{bg_h_color}">
<td colspan="2">{text}</td>
</tr>
<!-- END pref_header -->
<!-- BEGIN pref_line --> <!-- BEGIN pref_line -->
<tr bgcolor="{bg_nm_color}"> <tr bgcolor="{bg_nm_color}">
<td align="right">{field}</td> <td align="right">{field}</td>
<td align="center">{data}</td> <td align="center">{data}</td>
</tr> </tr>
<!-- END pref_line --> <!-- END pref_line -->
<!-- BEGIN info_prefs -->
<p><b>{title}:</b><hr><p>
<form action="{action_url}" method="POST">
<table border="0" align="center" width="90%">
<tr bgcolor="{bg_h_color}">
<td colspan="2">{text}</td>
</tr>
{pref_lines}
</table> </table>
<center>{save_button}</center> <center>{save_button}</center>
</form> </form>
<!-- END info_prefs -->