X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.display_education.php;h=752c5e73e678f544d3307e02e51d36d1321faffb;hb=1105545b63af9aacf1abefb8322dd4290de9e8a2;hp=da0ea9631e25df49b4daf01889a038309d3531b2;hpb=00ca0ad5370df5be4a0272364fb16a4385ffabfe;p=platal.git diff --git a/plugins/function.display_education.php b/plugins/function.display_education.php index da0ea96..752c5e7 100644 --- a/plugins/function.display_education.php +++ b/plugins/function.display_education.php @@ -1,6 +1,6 @@ ' . $name . ''; + } else { + $txt .= $name; + } + + if ($gradYear || $field || $program) { + $details = ''; if ($program) { - $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; if ($field) { - $txt .= ", "; + $details .= ', '; } } if ($field) { - $txt .= "domaine : $field"; + $details .= $field; } - $txt .= ")\">"; - } - if (($degree != "Lic.") || ($long)) { - if (($degree != "Ing.") && ($degree != "Dipl.")) { - $txt .= $degree; - } - if ($name) { - $txt .= ' '; - } - if ($url != '') { - $txt .= "$name"; + if ($full) { + $txt .= ' (' . $details . ')'; } else { - $txt .= $name; + $txt = '' . $txt . ''; } } - $txt .= ""; return $txt; } -function smarty_function_display_education($params, &$smarty) +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'); - } - return display_education($edu->school_short, $edu->school_url, $edu->degree_short, $edu->grad_year, - $edu->field, $edu->program, $sex, $params->b('long')); + $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, + $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 fenc=utf-8: ?>