From: Raphaël Barrois Date: Sun, 8 May 2011 23:25:05 +0000 (+0200) Subject: Use the new get_profile/get_user smarty modifiers in plviews to be able to handle... X-Git-Tag: xorg/1.1.1~13 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=977168f6915e290cf8d9351651b9d8a0c908ac70;p=platal.git Use the new get_profile/get_user smarty modifiers in plviews to be able to handle ProfileSets and UserSets natively. Signed-off-by: Raphaël Barrois --- diff --git a/templates/include/plview.groupmember.tpl b/templates/include/plview.groupmember.tpl index f22449b..ae538f3 100644 --- a/templates/include/plview.groupmember.tpl +++ b/templates/include/plview.groupmember.tpl @@ -33,7 +33,7 @@ {assign var=lostUsers value=false} {foreach from=$set item=user} {if $user->lost}{assign var=lostUsers value=true}{/if} - {include file="include/plview.groupmember.entry.tpl" user=$user} + {include file="include/plview.groupmember.entry.tpl" user=$user|get_user} {/foreach} diff --git a/templates/include/plview.listmember.tpl b/templates/include/plview.listmember.tpl index 6d9f75b..ef2976a 100644 --- a/templates/include/plview.listmember.tpl +++ b/templates/include/plview.listmember.tpl @@ -32,40 +32,41 @@ {/if} {assign var=current_key value=''} - {foreach from=$set item=user} - - - {if $order eq 'promo'} - {assign var=user_key value=$user->promo()} - {elseif $order eq 'name'} - {assign var=user_key value=$user->lastName()|string_format:'%.1s'|upper} - {else} - {assign var=user_key value=''} - {/if} - {if $user_key neq $current_key} - {assign var=current_key value=$user_key} - {$user_key} - {/if} - - - {if $user->hasProfile()} - {if $user->lost}{assign var=lostUsers value=true}{/if} - {profile user=$user} - {else} - {$user->displayName()} - {/if} - - {if t($delete)} - - {if t($user.uid)} - {icon name=user_edit title='Éditer'}  + {foreach from=$set item=obj} + {assign var=user value=$obj|get_user} + + + {if $order eq 'promo'} + {assign var=user_key value=$user->promo()} + {elseif $order eq 'name'} + {assign var=user_key value=$user->lastName()|string_format:'%.1s'|upper} + {else} + {assign var=user_key value=''} + {/if} + {if $user_key neq $current_key} + {assign var=current_key value=$user_key} + {$user_key} + {/if} + + + {if $user->hasProfile()} + {if $user->lost}{assign var=lostUsers value=true}{/if} + {profile user=$user} {else} - {icon name=null}  + {$user->displayName()} {/if} - {icon name=cross title='Retirer'} - {/if} - + {if t($delete)} + + {if t($user.uid)} + {icon name=user_edit title='Éditer'}  + {else} + {icon name=null}  + {/if} + {icon name=cross title='Retirer'} + + {/if} + {/foreach} diff --git a/templates/include/plview.minifiche.tpl b/templates/include/plview.minifiche.tpl index 4f29aaa..d5b7bf0 100644 --- a/templates/include/plview.minifiche.tpl +++ b/templates/include/plview.minifiche.tpl @@ -22,7 +22,7 @@
{foreach from=$set item=res} - {include file="include/minifiche.tpl" profile=$res} + {include file="include/minifiche.tpl" profile=$res|get_profile} {/foreach}
diff --git a/templates/include/plview.trombi.tpl b/templates/include/plview.trombi.tpl index 8213c95..1c46ad1 100644 --- a/templates/include/plview.trombi.tpl +++ b/templates/include/plview.trombi.tpl @@ -28,29 +28,34 @@ {section name=trombi loop=$set_keys start=0} {if $smarty.section.trombi.index % 3 == 1} - {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]} - - {include file="include/plview.trombi.entry.tpl" profile=$set[$key_prev]->profile() photo=true} - {include file="include/plview.trombi.entry.tpl" profile=$set[$key_cur]->profile() photo=true} - {include file="include/plview.trombi.entry.tpl" profile=$set[$key_next]->profile() photo=true} - - - {include file="include/plview.trombi.entry.tpl" profile=$set[$key_prev]->profile() photo=false} - {include file="include/plview.trombi.entry.tpl" profile=$set[$key_cur]->profile() photo=false} - {include file="include/plview.trombi.entry.tpl" profile=$set[$key_next]->profile() photo=false} - + {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} + + + {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} + + + {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} + {elseif ($smarty.section.trombi.index % 3 == 0) && ($smarty.section.trombi.last)} - {assign var=key_cur value=$set_keys[trombi]} - - {include file="include/plview.trombi.entry.tpl" profile=$set[$key_cur]->profile() photo=true} - - - - {include file="include/plview.trombi.entry.tpl" profile=$set[$key_cur]->profile() photo=false} - - + {assign var=key_cur value=$set_keys[trombi]} + {assign var=profile_cur value=$set[$key_cur]|get_profile} + + {include file="include/plview.trombi.entry.tpl" profile=$profile_cur photo=true} + + + + {include file="include/plview.trombi.entry.tpl" profile=$profile_cur photo=false} + + {/if} {/section}