From: Stéphane Jacob Date: Tue, 6 Jul 2010 17:56:58 +0000 (+0200) Subject: Displays country name instead of country code as flag title. X-Git-Tag: xorg/1.0.1~353 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6420023b0efea816bf0896fc1597f89a2863465c;p=platal.git Displays country name instead of country code as flag title. Signed-off-by: Stéphane Jacob --- diff --git a/classes/profile.php b/classes/profile.php index 0b22460..095d1ef 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -371,14 +371,15 @@ class Profile public function nationalities() { $nats = array(); + $countries = DirEnum::getOptions(DirEnum::COUNTRIES); if ($this->nationality1) { - $nats[] = $this->nationality1; + $nats[$this->nationality1] = $countries[$this->nationality1]; } if ($this->nationality2) { - $nats[] = $this->nationality2; + $nats[$this->nationality2] = $countries[$this->nationality2]; } if ($this->nationality3) { - $nats[] = $this->nationality3; + $nats[$this->nationality3] = $countries[$this->nationality3]; } return $nats; } diff --git a/templates/gadgets/ig-minifiche.tpl b/templates/gadgets/ig-minifiche.tpl index c5e8069..b88b872 100644 --- a/templates/gadgets/ig-minifiche.tpl +++ b/templates/gadgets/ig-minifiche.tpl @@ -51,8 +51,8 @@ {if !$dead && $registered}{/if}
- {foreach from=$profile->nationalities() item=nat} - {$nat}  + {foreach from=$profile->nationalities() item=country key=code} + {$code}  {/foreach} {$profile->promo()}{* *}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if} diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index 21fc745..6146791 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -60,8 +60,8 @@
- {foreach from=$profile->nationalities() item=nat} - {$nat}  + {foreach from=$profile->nationalities() item=country key=code} + {$code}  {/foreach} {$profile->promo()}{* *}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile}{/foreach}{* diff --git a/templates/profile/profile.tpl b/templates/profile/profile.tpl index 79abc50..19bd26a 100644 --- a/templates/profile/profile.tpl +++ b/templates/profile/profile.tpl @@ -154,8 +154,8 @@ function chgMainWinLoc(strPage) {/if}
- {foreach from=$profile->nationalities() item=nat} - {$nat}  + {foreach from=$profile->nationalities() item=country key=code} + {$code}  {/foreach} {$profile->promo()}