Signed-off-by: Stéphane Jacob <sj@m4x.org>
***************************************************************************/
***************************************************************************/
-function display_education($name, $url, $degree, $grad_year, $field, $program, $sexe, $long)
+function display_education($name, $url, $degree, $gradYear, $field, $program, $full)
{
$field = strtolower($field);
{
$field = strtolower($field);
- if ($grad_year || $field || $program) {
- $txt .= "<span title=\"(";
+ if (($degree != 'Ing.') && ($degree != 'Dipl.')) {
+ $txt .= $degree;
+ if ($name) {
+ $txt .= ' ';
+ }
+ }
+ if ($url != '') {
+ $txt .= '<a href="' . $url . '" onclick="return popup(this)">' . $name . '</a>';
+ } else {
+ $txt .= $name;
+ }
+
+ if ($gradYear || $field || $program) {
+ $details = '';
- $txt .= $program;
- if ($grad_year || $field) {
- $txt .= ", ";
+ $details .= $program;
+ if ($gradYear || $field) {
+ $details .= ', ';
- if ($grad_year) {
- if ($sexe) {
- $txt .= "diplômée en $grad_year";
- } else {
- $txt .= "diplômé en $grad_year";
- }
+ if ($gradYear) {
+ $details .= $gradYear;
- $txt .= "domaine : $field";
- if (($degree != "Lic.") || ($long)) {
- if (($degree != "Ing.") && ($degree != "Dipl.")) {
- $txt .= $degree;
- }
- if ($name) {
- $txt .= ' ';
- }
- if ($url != '') {
- $txt .= "<a href=\"$url\" onclick=\"return popup(this)\">$name</a>";
+ if ($full) {
+ $txt .= ' <small>(' . $details . ')</small>';
+ $txt = '<span title="' . $details . '">' . $txt . '</span>';
- if ($grad_year || $field || $program) {
- $txt .= "</span>";
- }
return $txt;
}
function smarty_function_display_education($params, &$smarty)
{
return $txt;
}
function smarty_function_display_education($params, &$smarty)
{
- $params = new PlDict($params);
- $edu = $params->v('edu');
- if (!$params->has('sex')) {
- $profile = $params->v('profile');
- $sex = $profile->isFemale();
- } else {
- $sex = $params->b('sex');
- }
+ $params = new PlDict($params);
+ $edu = $params->v('edu');
return display_education(($edu->school_short == '') ? $edu->school : $edu->school_short,
$edu->school_url, $edu->degree_short, $edu->grad_year,
return display_education(($edu->school_short == '') ? $edu->school : $edu->school_short,
$edu->school_url, $edu->degree_short, $edu->grad_year,
- $edu->field, $edu->program, $sex, $params->b('long'));
+ $edu->field, $edu->program, $params->b('full'));
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
<img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />
{/foreach}
{$profile->promo()}{*
<img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />
{/foreach}
{$profile->promo()}{*
- *}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile}{/foreach}{*
+ *}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile full=false}{/foreach}{*
*}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if}
</div>
</div>
*}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if}
</div>
</div>
- Formation :
<ul>
{foreach from=$educations item=edu}
- Formation :
<ul>
{foreach from=$educations item=edu}
- <li>{display_education edu=$edu profile=$profile}</li>
+ <li>{display_education edu=$edu profile=$profile full=true}</li>