Moved nextmatchs over to template blocks

This commit is contained in:
jengo 2001-08-04 02:47:19 +00:00
parent 11ebee5fa9
commit 263a96944f
23 changed files with 147 additions and 154 deletions

View File

@ -30,11 +30,23 @@
{ {
var $maxmatches; var $maxmatches;
var $action; var $action;
var $template;
function nextmatchs() function nextmatchs()
{ {
global $phpgw_info, $menuaction; global $phpgw_info, $menuaction;
$this->template = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$this->template->set_file(array(
'_nextmatchs' => 'nextmatchs.tpl'
));
$this->template->set_block('_nextmatchs','nextmatchs');
$this->template->set_block('_nextmatchs','filter');
$this->template->set_block('_nextmatchs','form');
$this->template->set_block('_nextmatchs','icon');
$this->template->set_block('_nextmatchs','link');
$this->template->set_block('_nextmatchs','search');
if(isset($phpgw_info['user']['preferences']['common']['maxmatchs']) && if(isset($phpgw_info['user']['preferences']['common']['maxmatchs']) &&
intval($phpgw_info['user']['preferences']['common']['maxmatchs']) > 0) intval($phpgw_info['user']['preferences']['common']['maxmatchs']) > 0)
{ {
@ -54,7 +66,6 @@
/*! /*!
@function set_icon @function set_icon
@abstract ? @abstract ?
@param $tpl ?
@param $align ? @param $align ?
@param $img_src ? @param $img_src ?
@param $label ? @param $label ?
@ -62,24 +73,17 @@
function set_icon($align,$img,$label) function set_icon($align,$img,$label)
{ {
global $phpgw; global $phpgw;
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_file(
Array(
'link' => 'nextmatchs_link.tpl'
)
);
$var = Array( $var = array(
'align' => $align, 'align' => $align,
'img' => $phpgw->common->image('phpgwapi',$img), 'img' => $phpgw->common->image('phpgwapi',$img),
'label' => lang($label) 'label' => lang($label)
); );
$tpl->set_var($var); $this->template->set_var($var);
return $tpl->fp('out','link'); return $this->template->fp('out','link');
} }
/*! /*!
@function page @function page
@abstract ? @abstract ?
@ -99,7 +103,6 @@
/*! /*!
@function set_link @function set_link
@abstract ? @abstract ?
@param $tpl ?
@param $img_src ? @param $img_src ?
@param $label ? @param $label ?
@param $link ? @param $link ?
@ -109,13 +112,6 @@
{ {
global $phpgw; global $phpgw;
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_file(
Array(
'_out' => 'nextmatchs_form.tpl'
)
);
$hidden = ''; $hidden = '';
while(list($var,$value) = each($extravars)) while(list($var,$value) = each($extravars))
{ {
@ -125,16 +121,17 @@
} }
} }
$var = Array( $var = array(
'align' => $align, 'align' => $align,
'action' => ($this->action?$this->page():$phpgw->link($link)), 'action' => ($this->action?$this->page():$phpgw->link($link)),
'hidden' => $hidden, 'hidden' => $hidden,
'img' => $phpgw->common->image('phpgwapi',$img) 'img' => $phpgw->common->image('phpgwapi',$img)
); );
$tpl->set_var($var); $this->template->set_var($var);
return $tpl->fp('out','_out'); return $this->template->fp('_out','form');
} }
/*! /*!
@function show_tpl @function show_tpl
@abstract ? @abstract ?
@ -152,14 +149,8 @@
{ {
global $filter, $qfield, $start, $order, $sort, $query, $phpgw, $phpgw_info; global $filter, $qfield, $start, $order, $sort, $query, $phpgw, $phpgw_info;
$start = $localstart; $start = $localstart;
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_file(
Array(
'nextmatchs' => 'nextmatchs.tpl'
)
);
$var = Array( $var = array(
'form_action' => ($this->action?$this->page($extra):$phpgw->link($sn, $extra)), 'form_action' => ($this->action?$this->page($extra):$phpgw->link($sn, $extra)),
'filter_value' => $filter, 'filter_value' => $filter,
'qfield' => $qfield, 'qfield' => $qfield,
@ -174,8 +165,8 @@
'filter' => ($filter_obj?$this->filter($filter_obj,$yours):''), 'filter' => ($filter_obj?$this->filter($filter_obj,$yours):''),
'right' => $this->right($sn,$start,$total,$extra) 'right' => $this->right($sn,$start,$total,$extra)
); );
$tpl->set_var($var); $this->template->set_var($var);
return $tpl->fp('out','nextmatchs'); return $this->template->fp('out','nextmatchs');
} }
function split_extras($extravars,$extradata) function split_extras($extravars,$extradata)
@ -322,12 +313,6 @@
function search($search_obj=0) function search($search_obj=0)
{ {
global $query; global $query;
$tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_file(
Array(
'search' => 'nextmatchs_search.tpl'
)
);
$_query = stripslashes($query); $_query = stripslashes($query);
@ -338,14 +323,14 @@
$_query = ereg_replace('"','',$_query); $_query = ereg_replace('"','',$_query);
} }
$var = Array( $var = array(
'query_value' => stripslashes($_query), 'query_value' => stripslashes($_query),
'searchby' => $this->searchby($search_obj), 'searchby' => $this->searchby($search_obj),
'lang_search' => lang('Search') 'lang_search' => lang('Search')
); );
$tpl->set_var($var); $this->template->set_var($var);
return $tpl->fp('out','search'); return $this->template->fp('out','search');
} /* search() */ } /* search() */
/*! /*!
@ -408,12 +393,6 @@
function filter($filter_obj,$yours=0) function filter($filter_obj,$yours=0)
{ {
global $filter, $phpgw, $phpgw_info; global $filter, $phpgw, $phpgw_info;
$tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_file(
Array(
'filter' => 'nextmatchs_filter.tpl'
)
);
if (is_long($filter_obj)) if (is_long($filter_obj))
{ {
@ -458,11 +437,11 @@
} }
$str = '<select name="filter" onChange="this.form.submit()">'."\n" . $str . '</select>'."\n"; $str = '<select name="filter" onChange="this.form.submit()">'."\n" . $str . '</select>'."\n";
$tpl->set_var('select',$str); $this->template->set_var('select',$str);
$tpl->set_var('lang_filter',lang('Filter')); $this->template->set_var('lang_filter',lang('Filter'));
} }
return $tpl->fp('out','filter'); return $this->template->fp('out','filter');
} /* filter() */ } /* filter() */
/*! /*!

View File

@ -1,3 +1,4 @@
<!-- BEGIN nextmatchs -->
<form method="POST" action="{form_action}"> <form method="POST" action="{form_action}">
<input type="hidden" name="filter" value="{filter_value}"> <input type="hidden" name="filter" value="{filter_value}">
<input type="hidden" name="qfield" value="{qfield_value}"> <input type="hidden" name="qfield" value="{qfield_value}">
@ -17,4 +18,37 @@
<br> <br>
</form> </form>
<!-- END nextmatchs -->
<!-- BEGIN filter -->
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>
<!-- END filter -->
<!-- BEGIN form -->
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="0">
<form>
</td>
<!-- END form -->
<!-- BEGIN icon -->
<td width="2%" align="{align}">&nbsp;{_link}</td>
<!-- END icon -->
<!-- BEGIN link -->
<td width="2%" align="{align}"><img src="{img}" border="0" width="12" height="12" alt="{label}"></td>
<!-- END link -->
<!-- BEGIN search -->
<td>
<input type="text" name="query" value="{query_value}">&nbsp;{searchby}<input type="submit" name="Search" value="{lang_search}">
</td>
<!-- END search -->

View File

@ -1 +0,0 @@
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>

View File

@ -1,5 +0,0 @@
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="0">
<form>
</td>

View File

@ -1 +0,0 @@
<td width="2%" align="{align}">&nbsp;{link}</td>

View File

@ -1 +0,0 @@
<td width="2%" align="{align}"><img src="{img}" border="0" width="12" height="12" alt="{label}"></td>

View File

@ -1,3 +0,0 @@
<td>
<input type="text" name="query" value="{query_value}">&nbsp;{searchby}<input type="submit" name="Search" value="{lang_search}">
</td>

View File

@ -1,67 +1,91 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<!-- BEGIN login_form --> <!-- BEGIN login_form -->
<HEAD> <html>
<head>
<title>{website_title}</title>
</head>
<body bgcolor="AAAAAA" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0" background="phpgwapi/templates/idsociety/images/content_spacer_middle.gif">
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META name="AUTHOR" content="phpGroupWare http://www.phpgroupware.org">
<META NAME="description" CONTENT="phpGroupWare login screen">
<META NAME="keywords" CONTENT="phpGroupWare login screen">
<TITLE>{website_title} - Login</TITLE> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
</HEAD> <tr>
<td>
<BODY bgcolor="#FFFFFF">
<p>&nbsp;</p>
<CENTER>{lang_message}</CENTER>
<p>&nbsp;</p>
<TABLE bgcolor="000000" border="0" cellpadding="0" cellspacing="0" width="40%" align="CENTER"> <form method="post" action="{login_url}">
<TR> <table border="0" align="CENTER" width="40%" cellpadding="0" cellspacing="0">
<TD> <tr>
<TABLE border="0" width="100%" bgcolor="486591" cellpadding="2" cellspacing="1"> <td align="center">
<TR bgcolor="486591">
<TD align="LEFT" valign="MIDDLE"> <table border="0" cellspacing="0" cellpadding="0" width="100%" background="phpgwapi/templates/idsociety/images/middle_line_spacer.gif">
<A href="http://www.phpgroupware.org"><img src="phpgwapi/templates/{template_set}/images/logo.gif" alt="phpGroupWare" border="0"></a> <tr>
</TD> <td colspan="3" align="center">{cd}</td>
</TR> </tr>
<TR bgcolor="e6e6e6">
<TD valign="BASELINE">
<FORM method="post" action="{login_url}"> <tr>
<TABLE border="0" align="CENTER" bgcolor="486591" width="100%" cellpadding="0" cellspacing="0"> <td align="right"><font color="000000">{lang_username}:&nbsp;</font></td>
<TR bgcolor="e6e6e6"> <td align="right"><input name="login" value="{cookie}"></td>
<TD colspan="2" align="CENTER"> <td width="20%" rowspan="3">&nbsp;</td>
{cd} </tr>
</TD>
</TR> <tr>
<TR bgcolor="e6e6e6"> <td align="right"><font color="000000">{lang_password}:&nbsp;</font></td>
<TD align="RIGHT"><font color="000000">{lang_username}:&nbsp;</font></TD> <td align="right"><input name="passwd" type="password"></td>
<TD><input name="login" value="{cookie}"></TD> </tr>
</TR>
<TR bgcolor="e6e6e6"> <tr>
<TD align="RIGHT"><font color="000000">{lang_password}:&nbsp;</font></TD> <td colspan="2" align="right">
<TD><input name="passwd" type="password"></TD> <input name="submit" type="image" src="phpgwapi/templates/idsociety/images/login.gif" border="0">
</TR> </td>
<TR bgcolor="e6e6e6"> </tr>
<TD colspan="2" align="CENTER"> </table>
<input type="submit" value="{lang_login}" name="submit">
</TD> </td>
</TR> </tr>
<TR bgcolor="e6e6e6">
<TD colspan="2" align="RIGHT"> <tr bgcolor="e6e6e6">
<td align="right">
<font color="000000" size="-1">{version}</font> <font color="000000" size="-1">{version}</font>
</TD> </td>
</TR> </tr>
</TABLE> </table>
</FORM> </form>
</TD> </td>
</TR> </tr>
</TABLE> </table>
</TD>
</TR>
</TABLE>
<!-- END login_form --> <!--
</HTML> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td height="30%" valign="bottom" align="center" background="img/main_spacer.gif">
<form method="post" action="{login_url}">
<table border="0" cellpadding="0" cellspacing="0" width="60%" height="69" align="center">
<tr>
<td align="right" valign="top" background="img/middle_line_spacer.gif">
<img src="img/little_spacer.gif">
<br><font size="2" color="#FFFFFF" face="verdana, arial, times new roman">{lang_username}</font>
<input name="login" value="{cookie}">
<br><font size="2" color="#FFFFFF" face="verdana, arial, times new roman">{lang_password}</font>
<input name="passwd" type="password">
<br><input name="submit" type="image" src="phpgwapi/templates/idsociety/images/login.gif" border="0">
</td>
</form>
<td width="5" background="img/middle_line_spacer.gif"><spacer type="block" width="5"></spacer></TD>
</tr>
</table>
</td>
</tr>
<tr>
<td height="70%" background="img/main_spacer.gif"><spacer type="block" width="1"></spacer>
</td>
</tr>
</table> -->
</body>
</html>
<!-- END login_form -->

View File

@ -1 +0,0 @@
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>

View File

@ -1,5 +0,0 @@
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="0">
<form>
</td>

View File

@ -1 +0,0 @@
<td width="2%" align="{align}">&nbsp;{link}</td>

View File

@ -1 +0,0 @@
<td width="2%" align="{align}"><img src="{img}" border="0" width="12" height="12" alt="{label}"></td>

View File

@ -1,3 +0,0 @@
<td>
<input type="text" name="query" value="{query_value}">&nbsp;{searchby}<input type="submit" name="Search" value="{lang_search}">
</td>

View File

@ -1 +0,0 @@
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>

View File

@ -1,5 +0,0 @@
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="0">
<form>
</td>

View File

@ -1 +0,0 @@
<td width="2%" align="{align}">&nbsp;{link}</td>

View File

@ -1 +0,0 @@
<td width="2%" align="{align}"><img src="{img}" border="0" width="12" height="12" alt="{label}"></td>

View File

@ -1,3 +0,0 @@
<td>
<input type="text" name="query" value="{query_value}">&nbsp;{searchby}<input type="submit" name="Search" value="{lang_search}">
</td>

View File

@ -1 +0,0 @@
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>

View File

@ -1,5 +0,0 @@
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="0">
<form>
</td>

View File

@ -1 +0,0 @@
<td width="2%" align="{align}">&nbsp;{link}</td>

View File

@ -1 +0,0 @@
<td width="2%" align="{align}"><img src="{img}" border="0" width="12" height="12" alt="{label}"></td>

View File

@ -1,3 +0,0 @@
<td>
<input type="text" name="query" value="{query_value}">&nbsp;{searchby}<input type="submit" name="Search" value="{lang_search}">
</td>