{* Error and confirmation messages *}
{include file="messages.tpl"}

{strip}
{if $op_status eq 1}
<div class="success block">
	{l}Operation successful.{/l}
</div>
{elseif $op_status eq -1}
<div class="block">
   <div class="error">
      <h2>{l}Error{/l}</h2>
      <p>{l}Some errors occured during the operation.{/l}</p>
   </div>
</div>
{/if}

{foreach from=$list item=type key=key}

<div class="block">
   <form action="{$smarty.const.DOC_ROOT}/dir_widget_zones.php" method="post" id="multiselect_list" name="multiselect_list">
      <input type="hidden" name="submitAction" id="submitAction" value="" class="hidden" />
      <table class="list" style="width: 50%; margin-bottom: 20px;">
      <thead>
         <tr>
         	<th class="listHeader" colspan="{$columns|@count}">{$key|lower|capitalize:true} {l}Widgets{/l}</th>
            
         </tr>
         <tr>
            {foreach from=$columns key=col item=name}
               {if $col ne 'TITLE_URL'}
                  <th class="listHeader">{$name|escape|trim}</th>
               {/if}
            {/foreach}
         </tr>
      </thead>

      <tbody>
      	 {foreach from=$type item=row key=NAME}
         <tr class="{cycle values="odd,even"}">
            {foreach from=$columns key=col item=name}
               {assign var="val" value=$row.$col}
				{if $col eq 'WIDGETS'}
				<td style="width: 100px; text-align: center;">
					<span><a href="{$smarty.const.DOC_ROOT}/dir_widgets_per_zone.php?Z={$row.NAME}&T={$row.TYPE}" title="{l}Available widgets of type{/l}: {$row.TYPE|escape|trim}">{l}View Widgets{/l}</a></span>
				</td>
					{else}
					<td>
						{$row.$col|escape|trim|replace:"_":" "|lower|capitalize:true}
					</td>
					{/if}
				
            {/foreach}
         </tr>
         {foreachelse}
        <tr>
           <td colspan="{$col_count}" class="norec">{l}No records found.{/l}</td>
        </tr>
         {/foreach}
      </tbody>
      </table>
   </form>
</div>

{/foreach}

{/strip}
