Displays country name instead of country code as flag title.
authorStéphane Jacob <sj@m4x.org>
Tue, 6 Jul 2010 17:56:58 +0000 (19:56 +0200)
committerStéphane Jacob <sj@m4x.org>
Mon, 12 Jul 2010 13:26:42 +0000 (15:26 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/profile.php
templates/gadgets/ig-minifiche.tpl
templates/include/minifiche.tpl
templates/profile/profile.tpl

index 0b22460..095d1ef 100644 (file)
@@ -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;
     }
index c5e8069..b88b872 100644 (file)
@@ -51,8 +51,8 @@
     {if !$dead && $registered}</a>{/if}
   </div>
   <div class="autre">
-    {foreach from=$profile->nationalities() item=nat}
-    <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />&nbsp;
+    {foreach from=$profile->nationalities() item=country key=code}
+    <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />&nbsp;
     {/foreach}
     {$profile->promo()}{*
     *}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if}
index 21fc745..6146791 100644 (file)
@@ -60,8 +60,8 @@
     </div>
 
     <div class="edu">
-      {foreach from=$profile->nationalities() item=nat}
-      <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />&nbsp;
+      {foreach from=$profile->nationalities() item=country key=code}
+      <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />&nbsp;
       {/foreach}
       {$profile->promo()}{*
       *}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile}{/foreach}{*
index 79abc50..19bd26a 100644 (file)
@@ -154,8 +154,8 @@ function chgMainWinLoc(strPage)
     {/if}
 
     <div class='formation'>
-      {foreach from=$profile->nationalities() item=nat}
-        <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />&nbsp;
+      {foreach from=$profile->nationalities() item=country key=code}
+      <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />&nbsp;
       {/foreach}
 
       {$profile->promo()}