Changeset 1531


Ignore:
Timestamp:
Oct 2, 2010, 9:06:51 PM (10 years ago)
Author:
roux
Message:

gestion sexe et pluriel pour fonction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/parlementaire/templates/_table.php

    r1526 r1531  
    44  if (!isset($colonnes))
    55    $colonnes = 3;
    6   if (isset($imp))
    7     echo '<h3 class="aligncenter">'.ucfirst($deputes[0]->fonction).(count($deputes) > 1 ? 's' : '').'</h3>';
     6  if (isset($imp)) {
     7    $fonction = $deputes[0]->fonction;
     8    foreach ($deputes as $depute) if ($depute->sexe === "H") {
     9      $fonction = $depute->fonction;
     10       break;
     11    }
     12    echo '<h3 class="aligncenter">'.ucfirst(preg_replace('/d(u|e)s /', 'd\\1 ', preg_replace('/(,)? /', 's\\1 ', $fonction))).(count($deputes) > 1 && !preg_match('/(droit|bureau)$/', $fonction) ? 's' : '').'</h3>';
     13  }
    814  echo '<table><tr>';
    915  $totaldep = count($deputes);
Note: See TracChangeset for help on using the changeset viewer.