Updates fusionax scripts for better compliance and to get them working right.
[platal.git] / modules / profile.php
index 765afe8..322a13f 100644 (file)
@@ -41,7 +41,7 @@ class ProfileModule extends PLModule
             'profile/ajax/secteur'       => $this->make_hook('ajax_secteur',               AUTH_COOKIE, 'user', NO_AUTH),
             'profile/ajax/skill'         => $this->make_hook('ajax_skill',                 AUTH_COOKIE, 'user', NO_AUTH),
             'profile/ajax/searchname'    => $this->make_hook('ajax_searchname',            AUTH_COOKIE, 'user', NO_AUTH),
-            'javascript/applis.js'       => $this->make_hook('applis_js',                  AUTH_COOKIE),
+            'javascript/education.js'    => $this->make_hook('education_js',               AUTH_COOKIE),
             'javascript/grades.js'       => $this->make_hook('grades_js',                  AUTH_COOKIE),
             'profile/medal'              => $this->make_hook('medal',                      AUTH_PUBLIC),
             'profile/orange'             => $this->make_hook('p_orange',                   AUTH_MDP),
@@ -333,12 +333,12 @@ class ProfileModule extends PLModule
 
         // Build the page
         $page->addJsLink('ajax.js');
-        $page->addJsLink('applis.js');
+        $page->addJsLink('education.js');
         $page->addJsLink('grades.js');
         $page->addJsLink('profile.js');
         $page->addJsLink('jquery.autocomplete.js');
-        $wiz = new PlWizard('Profil', 'core/plwizard.tpl', true, true);
-        require_once dirname(__FILE__) . '/profile/page.inc.php';
+        $wiz = new PlWizard('Profil', PlPage::getCoreTpl('plwizard.tpl'), true, true);
+        $this->load('page.inc.php');
         $wiz->addPage('ProfileGeneral', 'Général', 'general');
         $wiz->addPage('ProfileAddresses', 'Adresses personnelles', 'adresses');
         $wiz->addPage('ProfileGroups', 'Groupes X - Binets', 'poly');
@@ -360,15 +360,15 @@ class ProfileModule extends PLModule
        $page->setTitle('Mon Profil');
     }
 
-    function handler_applis_js(&$page)
+    function handler_education_js(&$page)
     {
         header('Content-Type: text/javascript; charset=utf-8');
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
         header('Last-Modified:' . gmdate('D, d M Y H:i:s') . ' GMT');
         header('Cache-Control: no-cache, must-revalidate');
         header('Pragma: no-cache');
-        $page->changeTpl('profile/applis.js.tpl', NO_SKIN);
-        require_once "applis.func.inc.php";
+        $page->changeTpl('profile/education.js.tpl', NO_SKIN);
+        require_once "education.func.inc.php";
     }
 
     function handler_grades_js(&$page)
@@ -416,7 +416,7 @@ class ProfileModule extends PLModule
         $page->assign('tel', array());
     }
 
-    function handler_ajax_edu(&$page, $eduid)
+    function handler_ajax_edu(&$page, $eduid, $class)
     {
         header('Content-Type: text/html; charset=utf-8');
         $page->changeTpl('profile/edu.tpl', NO_SKIN);
@@ -425,7 +425,8 @@ class ProfileModule extends PLModule
                             ORDER BY  field");
         $page->assign('edu_fields', $res->fetchAllAssoc());
         $page->assign('eduid', $eduid);
-        require_once "applis.func.inc.php";
+        $page->assign('class', $class);
+        require_once "education.func.inc.php";
     }
 
     function handler_ajax_medal(&$page, $id)
@@ -758,8 +759,9 @@ class ProfileModule extends PLModule
             $x = substr($x, 0, strlen($x) - 4);
         }
 
-        $vcard = new VCard($x);
-        $vcard->do_page($page);
+        $vcard = new VCard();
+        $vcard->addUser($x);
+        $vcard->show();
     }
 
     function handler_admin_trombino(&$page, $uid = null, $action = null) {