X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.display_education.php;h=752c5e73e678f544d3307e02e51d36d1321faffb;hb=66ac15905a2a66ccdee5725acbf967ff39c5656e;hp=bbf42086d0e58f032ef2fed06056f366f6e98a8f;hpb=0d66652e6e401991864fd180bc18d07ecb066656;p=platal.git
diff --git a/plugins/function.display_education.php b/plugins/function.display_education.php
index bbf4208..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 . '';
}
}
- if ($grad_year || $field || $program) {
- $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:
?>