Exemple #1
0
 /**
  * Retourne la liste des contacts au format JSON
  */
 private function jsonList()
 {
     if (parent::select(array('type' => 'list', 'getlang' => $this->getlang)) != null) {
         foreach (parent::select(array('type' => 'list', 'getlang' => $this->getlang)) as $key) {
             $json[] = '{"idcontact":' . json_encode($key['idcontact']) . ',"mail_contact":' . json_encode($key['mail_contact']) . '}';
         }
         print '[' . implode(',', $json) . ']';
     } else {
         print '{}';
     }
 }