{** * templates/controllers/grid/grid.tpl * * Copyright (c) 2014-2018 Simon Fraser University * Copyright (c) 2000-2018 John Willinsky * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. * * Grid HTML markup and construction *} {assign var=staticId value="component-"|concat:$grid->getId()} {assign var=gridId value=$staticId|concat:'-'|uniqid} {assign var=gridTableId value=$gridId|concat:"-table"} {assign var=gridActOnId value=$gridTableId}
{include file="controllers/grid/gridHeader.tpl"} {include file="controllers/grid/columnGroup.tpl" columns=$columns} {** build the column headers **} {foreach name=columns from=$columns item=column} {* @todo indent columns should be killed at their source *} {if $column->hasFlag('indent')} {php}continue;{/php} {/if} {if $column->hasFlag('alignment')} {assign var=alignment value=$column->getFlag('alignment')} {else} {assign var=alignment value=$smarty.const.COLUMN_ALIGNMENT_LEFT} {/if} {/foreach} {if $grid->getIsSubcomponent() && !is_a($grid, 'CategoryGridHandler')} {* Create two separate tables so that the body part can be scrolled independently from the header in a cross-browser compatible way using only CSS. *}
{$column->getLocalizedTitle()} {* TODO: Remove this stuff. Actions should not ever appear in the TH of a grid. *} {if $smarty.foreach.columns.last && $grid->getActions($smarty.const.GRID_ACTION_POSITION_LASTCOL)} {foreach from=$grid->getActions($smarty.const.GRID_ACTION_POSITION_LASTCOL) item=action} {include file="linkAction/linkAction.tpl" action=$action contextId=$staticId} {/foreach} {/if}
{include file="controllers/grid/columnGroup.tpl" columns=$columns} {/if} {foreach from=$gridBodyParts item=bodyPart} {$bodyPart} {foreachelse} {/foreach} 0} style="display: none;"{/if}> {** We need the last (=empty) line even if we have rows so that we can restore it if the user deletes all rows. **}
{translate key=$grid->getEmptyRowText()}
{if $grid->getIsSubcomponent() && !is_a($grid, 'CategoryGridHandler')}
{/if} {if $grid->getActions($smarty.const.GRID_ACTION_POSITION_BELOW) || $grid->getFootNote()} {/if}