Modifies database structure for phones
[platal.git] / modules / profile.php
index f21e463..e3d86cd 100644 (file)
@@ -35,6 +35,7 @@ class ProfileModule extends PLModule
             'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_COOKIE, 'user', NO_AUTH),
             'profile/ajax/tel'     => $this->make_hook('ajax_tel',     AUTH_COOKIE, 'user', NO_AUTH),
             'profile/ajax/medal'   => $this->make_hook('ajax_medal',   AUTH_COOKIE, 'user', NO_AUTH),
+            'profile/networking'   => $this->make_hook('networking',   AUTH_PUBLIC),
             'profile/ajax/job'     => $this->make_hook('ajax_job',     AUTH_COOKIE, 'user', NO_AUTH),
             '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),
@@ -125,6 +126,19 @@ class ProfileModule extends PLModule
         exit;
     }
 
+    function handler_networking(&$page, $mid)
+    {
+        $res = XDB::query("SELECT  icon
+                             FROM  profile_networking_enum
+                            WHERE  network_type = {?}",
+                          $mid);
+        $img  = dirname(__FILE__) . '/../htdocs/images/networking/' . $res->fetchOneCell();
+        $type = mime_content_type($img);
+        header("Content-Type: $type");
+        echo file_get_contents($img);
+        exit;
+    }
+
     function handler_photo_change(&$page)
     {
         $page->changeTpl('profile/trombino.tpl');
@@ -811,7 +825,8 @@ class ProfileModule extends PLModule
         $table_editor = new PLTableEditor('admin/networking', 'profile_networking_enum', 'network_type');
         $table_editor->describe('name', 'intitulé', true);
         $table_editor->describe('icon', 'nom de l\'icône', false);
-        $table_editor->describe('filter', 'nom du filtre à appliquer', true);
+        $table_editor->describe('filter', 'filtre', true);
+        $table_editor->describe('link', 'lien web', true);
         $table_editor->apply($page, $action, $id);
     }
     function handler_admin_medals(&$page, $action = 'list', $id = null) {