2006 => 2007 Happy New Year\!
[platal.git] / include / vcard.inc.php
index f876f4d..994ca8d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -61,6 +61,9 @@ class VCard
 
     function text_encode($text, $escape = true)
     {
+        if (is_array($text)) {
+            return implode(',', array_map(array($this, 'text_encode'), $text));
+        }
         if ($escape) {
             $text = $this->escape($text);
         }
@@ -98,7 +101,8 @@ class VCard
                 $user['forlife'].'@'.$globals->mail->domain2);
 
         $user['virtualalias'] = $res->fetchOneCell();
-
+        $user['gpxs_vcardjoin'] = join(',', array_map(array($this, 'text_encode'), $user['gpxs_name']));
+        $user['binets_vcardjoin'] = join(',', array_map(array($this, 'text_encode'), $user['binets']));
         // get photo
         if ($this->photos) {
             $res = XDB::query(
@@ -115,7 +119,7 @@ class VCard
 
     function do_page(&$page)
     {
-        $page->changeTpl('vcard.tpl', NO_SKIN);
+        $page->changeTpl('core/vcard.tpl', NO_SKIN);
         $page->register_modifier('vcard_enc',  array($this, 'text_encode'));
         $page->register_function('format_adr', array($this, 'format_adr'));
         $page->assign_by_ref('users', $this->users);