From 6420023b0efea816bf0896fc1597f89a2863465c Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 6 Jul 2010 19:56:58 +0200 Subject: [PATCH] Displays country name instead of country code as flag title. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/profile.php | 7 ++++--- templates/gadgets/ig-minifiche.tpl | 4 ++-- templates/include/minifiche.tpl | 4 ++-- templates/profile/profile.tpl | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) 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()} -- 2.1.4