X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile.php;h=940af80866ddae224f8561d4f69c133d21f60d51;hb=c65aed9897893d27bc93744c801d289724ef5b7b;hp=07e91897e6d4be5b59fb7932e8288036ef8e94bc;hpb=658cffd4cd8d42cb5c394663b00514dae036f834;p=platal.git diff --git a/modules/profile.php b/modules/profile.php index 07e9189..940af80 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -329,14 +329,15 @@ class ProfileModule extends PLModule $wiz->addPage('ProfilePageGeneral', 'Général', 'general'); $wiz->addPage('ProfilePageAddresses', 'Adresses personnelles', 'adresses'); $wiz->addPage('ProfilePageJobs', 'Informations professionnelles', 'emploi'); - if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) { + $viewPrivate = S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE); + if ($viewPrivate) { $wiz->addPage('ProfilePageGroups', 'Groupes X - Binets', 'poly'); } $wiz->addPage('ProfilePageDecos', 'Décorations - Medailles', 'deco'); - if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) { + if ($viewPrivate) { $wiz->addPage('ProfilePageMentor', 'Mentoring', 'mentor'); } - if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE) && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) { + if ($viewPrivate && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) { $wiz->addPage('ProfilePageDeltaten', 'Opération N N-10', 'deltaten'); } $wiz->apply($page, 'profile/edit/' . $profile->hrid(), $opened_tab, $mode); @@ -348,6 +349,8 @@ class ProfileModule extends PLModule $page->setTitle('Mon Profil'); $page->assign('hrpid', $profile->hrid()); + $page->assign('viewPrivate', $viewPrivate); + $page->assign('isMe', S::user()->isMyProfile($profile)); if (isset($success) && $success) { $page->trigSuccess('Ton profil a bien été mis à jour.'); } @@ -355,7 +358,7 @@ class ProfileModule extends PLModule function handler_education_js($page) { - pl_cached_content_headers("text/javascript", "utf-8"); + pl_cached_dynamic_content_headers('text/javascript', 'utf-8'); $page->changeTpl('profile/education.js.tpl', NO_SKIN); require_once 'education.func.inc.php'; }