From: Thomas Minvielle Date: Mon, 14 Nov 2011 12:14:10 +0000 (+0100) Subject: adds links to the binets section of the profile X-Git-Tag: xorg/1.1.4~6 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7f3c6bf4213dbaf45883ffc354e2159f1dd20a75;p=platal.git adds links to the binets section of the profile --- diff --git a/classes/profile.php b/classes/profile.php index 48d209a..605a3ff 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -952,6 +952,17 @@ class Profile implements PlExportable return array(); } } + public function getFullBinets() + { + if ($this->visibility->isVisible(Visibility::EXPORT_PRIVATE)) { + return XDB::fetchAllAssoc('SELECT binet_id, text, url + FROM profile_binets AS pb + LEFT JOIN profile_binet_enum AS pbe ON (pbe.id = pb.binet_id) + WHERE pid = {?}', $this->id()); + } else { + return array(); + } + } public function getBinetsNames() { if ($this->visibility->isVisible(Visibility::EXPORT_PRIVATE)) { diff --git a/templates/profile/profile.tpl b/templates/profile/profile.tpl index f005f45..5f99005 100644 --- a/templates/profile/profile.tpl +++ b/templates/profile/profile.tpl @@ -50,9 +50,14 @@ $($.closeOnEsc);

À l'X…

{if $profile->section}
Section : {$profile->section}
{/if} - {assign var=binets value=$profile->getBinets()} + {assign var=binets value=$profile->getFullBinets()} {if $binets|@count}
Binet{if count($binets) > 1}s{/if} : - {', '|implode:$profile->getBinetsNames()}
{/if} +
+ {foreach from=$binets item=binet name=binets} + {if !$smarty.foreach.binets.first}, {/if} + {if $binet.url}{/if}{$binet.text}{if $binet.url}{/if} + {/foreach} +
{/if} {if $owner && $view->isVisible(#Visibility::EXPORT_AX#)} {assign var=groups value=$owner->groups(true,true)}