X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Feducation.func.inc.php;h=8ff9a5f1b0d09bdeab554fbeaf337fd8da1b164b;hb=448c8cdc9ec81362d230534097a9788bc2b005c9;hp=dd635915e99c7667de775a5d0f70858c20ed318d;hpb=2db80ab6f7d054ec274c66f7ba983f49596b81cf;p=platal.git diff --git a/include/education.func.inc.php b/include/education.func.inc.php index dd63591..8ff9a5f 100644 --- a/include/education.func.inc.php +++ b/include/education.func.inc.php @@ -1,6 +1,6 @@ '; - $res = XDB::iterator("SELECT e.id AS id, gc.countryFR AS country, + $html = ''; + $res = XDB::iterator("SELECT e.id AS id, gc.country, IF(CHAR_LENGTH(e.name) > 76, e.abbreviation, e.name) AS name FROM profile_education_enum AS e LEFT JOIN geoloc_countries AS gc ON (e.country = gc.iso_3166_1_a2) WHERE EXISTS (SELECT * FROM profile_education_degree AS d - WHERE e.id = d.eduid) - ORDER BY gc.countryFR, e.name"); + WHERE e.id = d.eduid) AND e.name != {?} + ORDER BY gc.country, e.name", + Profile::EDU_X); $country = ""; while ($arr_edu = $res->next()) { if ($arr_edu["country"] != $country) { + if ($country) { + $html .= ''; + } $country = $arr_edu["country"]; - $html .= ""; + $html .= ''; } $html .= ''; + } return $html; } @@ -106,68 +113,5 @@ function education_degree_name() } Platal::page()->register_function('education_degree_name', 'education_degree_name'); -/** formatte une formation pour l'affichage - */ -function education_fmt($name, $url, $degree, $grad_year, $field, $program, $sexe, $long) -{ - $field = strtolower($field); - $txt = ""; - - if ($grad_year || $field || $program) { - $txt .= ""; - } - } - - if (($degree != "Lic.") || ($long)) { - if (($degree != "Ing.") && ($degree != "Dipl.")) { - $txt .= $degree; - } - if ($name) { - $txt .= ' '; - } - if ($url != ' ') { - $txt .= "$name"; - } else { - $txt .= $name; - } - } - $txt .= ""; - - return $txt; -} - -function _education_fmt($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 education_fmt($edu['school_short'], $edu['school_url'], $edu['degree_short'], $edu['grad_year'], - $edu['field'], $edu['program'], $sex, $params->b('long')); -} -Platal::page()->register_function('education_fmt', '_education_fmt'); - -// 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: ?>