X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.display_education.php;h=143c474c1d47340c90d351d48a4d82ab3bc634a7;hb=2482fe415f23dad9abc95f0fd5ff0fdf939de8b8;hp=da0ea9631e25df49b4daf01889a038309d3531b2;hpb=93d42b4fcc6f055a428c9b63e386ac62c918d08a;p=platal.git
diff --git a/plugins/function.display_education.php b/plugins/function.display_education.php
index da0ea96..143c474 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: