Location: PHPKode > projects > OpenNitro > trunk/Nitro/Defaults/Templates/Listing.tpl
{*
// +---------------------------------------------------------------------------+
// | Nitro :: Defaults :: Templates :: List                                    |
// +---------------------------------------------------------------------------+
// | Copyright (c) 2006 June Systems BV                                        |
// +---------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or modify it   |
// | under the terms of the GNU Lesser General Public License as published by  |
// | the Free Software Foundation; either version 2.1 of the License, or (at   |
// | your option) any later version.                                           |
// |                                                                           |
// | This library is distributed in the hope that it will be useful, but       |
// | WITHOUT ANY WARRANTY; without even the implied warranty of                |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser   |
// | General Public License for more details.                                  |
// |                                                                           |
// | You should have received a copy of the GNU Lesser General Public License  |
// | along with this library; if not, write to the Free Software Foundation,   |
// | Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA            |
// +---------------------------------------------------------------------------+
// | Authors: Jesper Avôt <hide@address.com>                        |
// +---------------------------------------------------------------------------+
//
// $Id: Listing.tpl 229 2008-04-17 09:20:31Z oli $
//
// Nitro's default List template
//
*}
{if $inDiv}
<div name="{$inDiv}" id="{$inDiv}">
{/if}
<table width="{$TableWidth}" cellpadding="0" cellspacing="0" border="0">
	{if $Title}
	<tr>
		<td style="text-align: center;">
			<strong>{$Title}</strong>
		</td>
	</tr>
	<tr>
		<td>&nbsp</td>
	</tr>
	{/if}
	
	{if $ListActions|count > 0}
	<tr>
		<td style="text-align: right;">
			{foreach from=$ListActions item=LAData name=LAName}
				{if !$smarty.foreach.LAName.first}
				&nbsp;&nbsp;
				{/if}
				<strong>
					{if $LAData.useA}<a href="{if $LAData.URL neq ""}{$LAData.URL}{else}#{/if}"{if $LAData.onClickAction} onclick="{$LAData.onClickAction}"{/if}{if $LAData.Style} style="{$LAData.Style}"{/if}{if $LAData.Title} title="{$LAData.Title}"{/if}>{/if}{$LAData.Type}{if $LAData.useA}</a>{/if}
				</strong>
			{/foreach}
			&nbsp;&nbsp;
			{$Navigation}
		</td>
	</tr>
	{/if}
	
	<tr>
		<td>
			<form name="{$ListID}" id="{$ListID}" action="{$URL}" method="post">
			<table width="100%" cellpadding="4" cellspacing="0" border="0" class="TableDefault">
				
				{* Top td's *}
				<tr>
					{foreach from=$Columns item=ColumnName key=ColumnID name=Column}
					<td class="TableColumnHeader" style="border-bottom: 1px solid black;{if !$smarty.foreach.Column.first} border-left: 1px solid black;{/if}">
						{if $smarty.foreach.Column.first}<a name="Block_0">{/if}
						<strong>
							{$ColumnName.0}
						</strong>
						{if $smarty.foreach.Column.first}</a>{/if}
					</td>
					{/foreach}
					
					{foreach from=$Actions item=ActionLable key=ActionKey}
					<td class="TableColumnHeader" style="border-bottom: 1px solid black; border-left: 1px solid black;">
						<strong>
							{$ActionLable}
						</strong>
					</td>
					{/foreach}
				</tr>

				{* Rows *}
				{foreach from=$Rows item=Row name=ListRows key=RowID}
					{if $RepeatHeader && !($smarty.foreach.ListRows.iteration|fmod:$RepeatHeader)}
						{* Top td's *}
						<tr>
							{foreach from=$Columns item=ColumnName key=ColumnID name=Column}
							<td class="TableColumnHeader" style="border-top: 1px solid black; border-bottom: 1px solid black;{if !$smarty.foreach.Column.first} border-left: 1px solid black;{/if}">
								{if $smarty.foreach.Column.first}<a name="Block_0">{/if}
								<strong>
									{$ColumnName.0}
								</strong>
							</td>
							{/foreach}
							
							{foreach from=$Actions item=ActionLable key=ActionKey}
							<td class="TableColumnHeader" style="border-top: 1px solid black; border-bottom: 1px solid black; border-left: 1px solid black;">
								<strong>
									{$ActionLable}
								</strong>
							</td>
							{/foreach}
						</tr>
					{/if}
					
					<tr{if $EnableRowHighlighting && !$Row->Data[$ColumnID]|strstr:"<!--Filter-->"} onmouseover="this.style.backgroundColor = '#FFD4A8';" onmouseout="this.style.backgroundColor = '';" {/if}id="row_{$RowID}">
					{foreach from=$Columns item=ColumnName key=ColumnID name=Column}
						{if $RepeatHeader}
							{assign var="Block" value=$smarty.foreach.ListRows.iteration/$RepeatHeader|floor}
						{else}
							{assign var="Block" value=1}
						{/if}
						
						{if $EnableColumnHighlighting && !$Row->Data[$ColumnID]|strstr:"<!--Filter-->"}
							<td onmouseover="HighlightColumn('td_{$ColumnID}_{$Block}', '#FFD4A8'); this.style.backgroundColor = '#FFA851;'" onmouseout="HighlightColumn('TD_{$ColumnID}_{$Block}', ''); this.style.backgroundColor = '';" id="td_{$ColumnID}_{$Block}" style="{if !$smarty.foreach.Column.first}border-left: 1px solid black;{/if}{if $Row->Data[$ColumnID]|strstr:"<!--Filter-->"} border-bottom: 1px solid black;{/if}" width="{$ColumnWidths[$ColumnID]}">
						{else}
							<td style="{if !$smarty.foreach.Column.first}border-left: 1px solid black;{/if}{if $ColumnName.1} text-align: center;{/if}{if $Row->Data[$ColumnID]|strstr:"<!--Filter-->"} border-bottom: 1px solid black;{/if} {if $ColumnPaddings[$ColumnID]}padding:{$ColumnPaddings[$ColumnID]};{/if}" width="{$ColumnWidths[$ColumnID]}">
						{/if}
						{if $Row->Data[$ColumnID]}
							{if $ColumnWidths[$ColumnID]}
								<div style="overflow: hidden" title="{NitroStripTags String=$Row->Data[$ColumnID]}" style="width: {$ColumnWidths[$ColumnID]};">
									<nobr>
										{$Row->Data[$ColumnID]}
									</nobr>
								</div>
							{else}
								{$Row->Data[$ColumnID]}
							{/if}
						{else}
							&nbsp;
						{/if}
						
						</td>
					{/foreach}
					
					{foreach from=$Actions key=ActionID item=Action}
						<td style="border-left: 1px solid black;{if $Row->ActionCenter[$ActionID]} text-align: center;{/if}{if $Row->Data[$ColumnID]|strstr:"<!--Filter-->"} border-bottom: 1px solid black;{/if}">
						{if $Row->ActionName[$ActionID]}
							{if $Row->ActionNoLink[$ActionID]}
								{$Row->ActionName[$ActionID]}
							{else}
								<a href="{if $Row->ActionURL[$ActionID] neq ""}{$Row->ActionURL[$ActionID]}{else}#{/if}"{if $Row->ActionOnClick[$ActionID]} onclick="document.getElementById('row_{$RowID}').style.backgroundColor = ''; {$Row->ActionOnClick[$ActionID]}"{/if}{if $Row->ActionTitle[$ActionID]} title="{$Row->ActionTitle[$ActionID]}"{/if}{if $Row->ActionStyle[$ActionID]} style="{$Row->ActionStyle[$ActionID]}"{/if}>{$Row->ActionName[$ActionID]}</a>
							{/if}
						{else}
							&nbsp;
						{/if}
						</td>
					{/foreach}
					</tr>
				{/foreach}
			</table>
			</form>
		</td>
	</tr>
</table>
{if $inDiv}
</div>
{/if}
Return current item: OpenNitro