Switch to templates

This commit is contained in:
Miles Lott 2001-04-28 03:18:36 +00:00
parent 1eb72fb0ba
commit 41781e486a
3 changed files with 23 additions and 66 deletions

View File

@ -1,11 +1,11 @@
<!-- BEGIN view header -->
{view_header}
{header}
<!-- END view header -->
<!-- BEGIN view columns-->
{cols}
<!-- END view columns -->
{footer}
<!-- BEGIN view -->
<TABLE border="0" cellpadding="1" cellspacing="1">
<TR>

View File

@ -1,49 +0,0 @@
<!-- BEGIN view header -->
{view_header}
<!-- END view header -->
<!-- BEGIN view columns-->
{cols}
<!-- END view columns -->
<!-- BEGIN view -->
<TABLE border="0" cellpadding="1" cellspacing="1">
<TR>
<TD align="left">
{edit_link}
<input type="hidden" name="ab_id" value="{ab_id}">
{edit_button}
</form>
</TD>
<TD align="left">
{copy_link}
<input type="hidden" name="sort" value="{sort}">
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="fields" value="{copy_fields}">
<input type="submit" name="submit" value="{lang_copy}">
</form>
</TD>
<TD align="left">
{vcard_link}
<input type="hidden" name="ab_id" value="{ab_id}">
<input type="hidden" name="sort" value="{sort}">
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="submit" name="VCardform" value="{lang_vcard}">
</form>
</TD>
<TD align="left">
{done_link}
<input type="hidden" name="sort" value="{sort}">
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="submit" name="Doneform" value="{lang_done}">
</form>
</TD>
</TR>
</TABLE>
<!-- END view -->

View File

@ -43,7 +43,12 @@
}
$t = new Template($phpgw->common->get_tpl_dir("addressbook"));
$t->set_file(array( "view" => "view.tpl"));
$t->set_file(array(
"view" => "view.tpl",
"view_header" => "view_header.tpl",
"view_row" => "view_row.tpl",
"view_footer" => "view_footer.tpl"
));
while ($column = each($this->stock_contact_fields)) {
if (isset($phpgw_info["user"]["preferences"]["addressbook"][$column[0]]) &&
@ -88,12 +93,11 @@
$access_check = lang('public');
}
$view_header = "<p>&nbsp;<b>" . lang("Address book - view") . $noprefs . "</b><hr><p>";
$view_header .= '<table border="0" cellspacing="2" cellpadding="2" width="80%" align="center">';
$t->set_var('lang_viewpref',lang("Address book - view") . $noprefs);
reset($columns_to_display);
while ($column = each($columns_to_display)) { // each entry column
$columns_html .= "<tr><td><b>" . display_name($colname[$column[0]]) . "</b>:</td>";
$t->set_var('display_col',display_name($colname[$column[0]]));
$ref=$data="";
$coldata = $fields[0][$column[0]];
// Some fields require special formatting.
@ -110,7 +114,8 @@
} else { // But these do not
$ref=""; $data=$coldata;
}
$columns_html .= "<td>" . $ref . $data . "</td>";
$t->set_var('ref_data',$ref . $data);
$t->parse("cols","view_row",True);
}
$cat = CreateObject('phpgwapi.categories');
@ -125,14 +130,13 @@
if (!$catname) { $catname = lang('none'); }
$columns_html .= '<tr><td colspan="4">&nbsp;</td></tr>'
. '<tr><td><b>' . lang("Record owner") . '</b></td><td>'
. $phpgw->common->grab_owner_name($record_owner) . '</td></tr>'
. '<tr><td><b>' . lang("Record access") . '</b></td><td>'
. $access_check . '</b></td></tr>'
. '<tr><td><b>' . lang("Category") . '</b></td><td>'
. $catname . '</b></td></tr>'
. '</td></td></table>';
$t->set_var('lang_owner',lang("Record owner"));
$t->set_var('owner',$phpgw->common->grab_owner_name($record_owner));
$t->set_var('lang_access',lang("Record access"));
$t->set_var('access',$access_check);
$t->set_var('lang_category',lang("Category"));
$t->set_var('catname',$catname);
$t->set_var('columns',$columns_html);
$sfields = rawurlencode(serialize($fields[0]));
@ -168,8 +172,10 @@
$t->set_var("filter",$filter);
$t->set_var("start",$start);
$t->set_var("cat_id",$cat_id);
$t->set_var("view_header",$view_header);
$t->set_var("cols",$columns_html);
$t->parse("header","view_header");
$t->parse("footer","view_footer");
$t->set_var("lang_ok",lang("ok"));
$t->set_var("lang_done",lang("done"));
$t->set_var("lang_copy",lang("copy"));