X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile.php;h=a4c2d571a4540742af079603e85aee687142098b;hb=a7c28fffa54b53f05ef4245b73a8dfb9597be877;hp=5a3f1252c570093320d805aa7259c16817235008;hpb=45c358a97c9e7a0ba3c4c77b5e6d922d7482bfaa;p=platal.git diff --git a/modules/profile.php b/modules/profile.php index 5a3f125..a4c2d57 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -32,6 +32,8 @@ class ProfileModule extends PLModule 'profile/private' => $this->make_hook('profile', AUTH_COOKIE), 'profile/ax' => $this->make_hook('ax', AUTH_COOKIE, 'admin'), 'profile/edit' => $this->make_hook('p_edit', AUTH_MDP), + 'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_PUBLIC, 'user', NO_AUTH), + 'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH), 'profile/orange' => $this->make_hook('p_orange', AUTH_MDP), 'profile/usage' => $this->make_hook('p_usage', AUTH_MDP), @@ -310,12 +312,14 @@ class ProfileModule extends PLModule // Misc checks // TODO: Block if birth date is missing ? + $page->addJsLink('ajax.js'); + $page->addJsLink('jquery.js'); $wiz = new PlWizard('Profil', 'core/plwizard.tpl', true); require_once dirname(__FILE__) . '/profile/page.inc.php'; $wiz->addPage('ProfileGeneral', 'Général', 'general'); - $wiz->addPage('ProfileAddress', 'Adresses personnelles', 'adresses'); + $wiz->addPage('ProfileAddresses', 'Adresses personnelles', 'adresses'); $wiz->addPage('ProfileGroups', 'Groupes X - Binets', 'poly'); - $wiz->addPage('ProfileDeco', 'Décorations - Medals', 'deco'); + $wiz->addPage('ProfileDecos', 'Décorations - Medailles', 'deco'); $wiz->addPage('ProfilePro', 'Informations professionnelles', 'emploi'); $wiz->addPage('ProfileSkills', 'Compétences diverses', 'skill'); $wiz->addPage('ProfileMentor', 'Mentoring', 'mentor'); @@ -325,6 +329,25 @@ class ProfileModule extends PLModule $page->assign('xorg_title', 'Polytechnique.org - Mon Profil'); } + function handler_ajax_address(&$page, $adid) + { + $page->changeTpl('profile/adresses.address.tpl', NO_SKIN); + $page->assign('i', $adid); + $page->assign('adr', array()); + $page->assign('ajaxadr', true); + } + + function handler_ajax_tel(&$page, $adid, $telid) + { + $page->changeTpl('profile/adresses.tel.tpl', NO_SKIN); + $page->assign('i', $adid); + $page->assign('adid', "addresses_$adid"); + $page->assign('adpref', "addresses[$adid]"); + $page->assign('t', $telid); + $page->assign('tel', array()); + $page->assign('ajaxtel', true); + } + function handler_p_orange(&$page) { $page->changeTpl('profile/orange.tpl');