Use the new get_profile/get_user smarty modifiers in plviews to be able to handle...
[platal.git] / templates / include / plview.trombi.tpl
index f4127d3..1c46ad1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 </p>
 {else}
 <table cellpadding="0" cellspacing="2" style="width: 100%">
-  {section name=trombi loop=$set start=0}
+  {section name=trombi loop=$set_keys start=0}
   {if $smarty.section.trombi.index % 3 == 1}
-  <tr>
-    <td class="center" style="vertical-align: middle">
-      <a href="{$mainsiteurl}profile/{$set[trombi.index_prev].hruid}" class="popup2">
-        <img src="photo/{$set[trombi.index_prev].hruid}" width="110" alt=" [ PHOTO ] " />
-      </a>
-      {if $trombi_with_admin && hasPerm('admin')}
-      <a href="{$mainsiteurl}admin/trombino/{$set[trombi.index_prev].user_id}">{icon name=wrench title="[admin]"}</a>
-      {/if}
-    </td>
-    <td class="center" style="vertical-align: middle">
-      <a href="{$mainsiteurl}profile/{$set[trombi].hruid}" class="popup2">
-        <img src="photo/{$set[trombi].hruid}" width="110" alt=" [ PHOTO ] " />
-      </a>
-      {if $trombi_with_admin && hasPerm('admin')}
-      <a href="{$mainsiteurl}admin/trombino/{$set[trombi].user_id}">{icon name=wrench title="[admin]"}</a>
-      {/if}
-    </td>
-    <td class="center" style="vertical-align: middle">
-    {if $set[trombi.index_next]}
-      <a href="{$mainsiteurl}profile/{$set[trombi.index_next].hruid}" class="popup2">
-        <img src="photo/{$set[trombi.index_next].hruid}" width="110" alt=" [ PHOTO ] " />
-      </a>
-      {if $trombi_with_admin && hasPerm('admin')}
-      <a href="{$mainsiteurl}admin/trombino/{$set[trombi.index_next].user_id}">{icon name=wrench title="[admin]"}</a>
-      {/if}
-    {/if}
-    </td>
-  </tr>
-  <tr>
-    <td class="center" style="vertical-align: bottom; padding-bottom: 15px">
-      <a href="{$mainsiteurl}profile/{$set[trombi.index_prev].hruid}" class="popup2">
-        <span {if $set[trombi.index_prev].name_tooltip}class="hinted"
-        title="{$set[trombi.index_prev].name_tooltip}"{/if}>{$set[trombi.index_prev].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_prev].promo_display}){/if}
-      </a>
-    </td>
-    <td class="center" style="vertical-align: bottom; padding-bottom: 15px">
-      <a href="{$mainsiteurl}profile/{$set[trombi].hruid}" class="popup2">
-        <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo_display}){/if}
-      </a>
-    </td>
-    <td class="center" style="vertical-align: bottom; padding-bottom: 15px">
-    {if $set[trombi.index_next]}
-      <a href="{$mainsiteurl}profile/{$set[trombi.index_next].hruid}" class="popup2">
-        <span {if $set[trombi.index_next].name_tooltip}class="hinted" title="{$set[trombi.index_next].name_tooltip}"{/if}>{$set[trombi.index_next].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_next].promo_display}){/if}
-      </a>
-    {/if}
-    </td>
-  </tr>
+    {assign var=key_prev value=$set_keys[trombi.index_prev]}
+    {assign var=key_cur  value=$set_keys[trombi]}
+    {assign var=key_next value=$set_keys[trombi.index_next]}
+    {assign var=profile_prev value=$set[$key_prev]|get_profile}
+    {assign var=profile_cur value=$set[$key_cur]|get_profile}
+    {assign var=profile_next value=$set[$key_next]|get_profile}
+
+    <tr>
+      {include file="include/plview.trombi.entry.tpl" profile=$profile_prev photo=true}
+      {include file="include/plview.trombi.entry.tpl" profile=$profile_cur photo=true}
+      {include file="include/plview.trombi.entry.tpl" profile=$profile_next photo=true}
+    </tr>
+    <tr>
+      {include file="include/plview.trombi.entry.tpl" profile=$profile_prev photo=false}
+      {include file="include/plview.trombi.entry.tpl" profile=$profile_cur photo=false}
+      {include file="include/plview.trombi.entry.tpl" profile=$profile_next photo=false}
+    </tr>
   {elseif ($smarty.section.trombi.index % 3 == 0) && ($smarty.section.trombi.last)}
-  <tr>
-    <td class="center" style="vertical-align: middle; padding-bottom: 15px">
-      <a href="{$mainsiteurl}profile/{$set[trombi].hruid}" class="popup2">
-        <img src="photo/{$set[trombi].hruid}" width="110" alt=" [ PHOTO ] " />
-      </a>
-      {if $trombi_with_admin && hasPerm('admin')}
-      <a href="{$mainsiteurl}admin/trombino/{$set[trombi].user_id}">{icon name=wrench title="[admin]"}</a>
-      {/if}
-    </td>
-    <td></td><td></td>
-  </tr>
-  <tr style="margin-top: 0; padding-top: 0">
-    <td class="center" style="vertical-align: bottom">
-      <a href="{$mainsiteurl}profile/{$set[trombi].hruid}" class="popup2">
-      <a href="{$mainsiteurl}profile/{$set[trombi].forlife}" class="popup2">
-        <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo_display}){/if}
-      </a>
-    </td>
-    <td></td><td></td>
-  </tr>
+    {assign var=key_cur  value=$set_keys[trombi]}
+    {assign var=profile_cur value=$set[$key_cur]|get_profile}
+    <tr>
+      {include file="include/plview.trombi.entry.tpl" profile=$profile_cur photo=true}
+      <td></td><td></td>
+    </tr>
+    <tr style="margin-top: 0; padding-top: 0">
+      {include file="include/plview.trombi.entry.tpl" profile=$profile_cur photo=false}
+      <td></td><td></td>
+    </tr>
   {/if}
   {/section}
 </table>