Adds verification for 'Prénom' and 'Nom patronymique' so that they remain close enoug...
[platal.git] / modules / profile.php
index ef9bec9..66343b5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -46,6 +46,7 @@ class ProfileModule extends PLModule
             '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/name_info'          => $this->make_hook('name_info',                  AUTH_PUBLIC),
             'profile/orange'             => $this->make_hook('p_orange',                   AUTH_MDP),
             'profile/usage'              => $this->make_hook('p_usage',                    AUTH_MDP),
 
@@ -139,6 +140,19 @@ class ProfileModule extends PLModule
         exit;
     }
 
+    function handler_name_info(&$page)
+    {
+        header('Content-Type: text/html; charset=utf-8');
+        $page->changeTpl('profile/name_info.tpl', SIMPLE);
+        $res = XDB::iterator("SELECT  name, explanations,
+                                      FIND_IN_SET('public', flags) AS public,
+                                      FIND_IN_SET('has_particle', flags) AS has_particle
+                                FROM  profile_name_search_enum
+                               WHERE  NOT FIND_IN_SET('not_displayed', flags)
+                            ORDER BY  NOT FIND_IN_SET('public', flags)");
+        $page->assign('types', $res);
+    }
+
     function handler_networking(&$page, $mid)
     {
         $res = XDB::query("SELECT  icon
@@ -440,7 +454,7 @@ class ProfileModule extends PLModule
     function handler_ajax_edu(&$page, $eduid, $class)
     {
         header('Content-Type: text/html; charset=utf-8');
-        $page->changeTpl('profile/edu.tpl', NO_SKIN);
+        $page->changeTpl('profile/general.edu.tpl', NO_SKIN);
         $res = XDB::iterator("SELECT  id, field
                                 FROM  profile_education_field_enum
                             ORDER BY  field");