// : $GLOBALS['registry']->call('contacts/getDefaultShare');
//
//
+// case 'search_fields':
// case 'search_sources':
-// // Dynamically set the search_sources preference.
+// // Dynamically set the search_fields/search_sources preferences.
//
// // Example #1: Use the list of sources defined in the contacts
-// // application (e.g. Turba) to populate the search_sources
-// // value.
+// // application (e.g. Turba).
// if (!is_null($username) &&
// $GLOBALS['registry']->hasMethod('contacts/sources')) {
// $sources = $GLOBALS['registry']->call('contacts/sources');
-// return json_encode(array_keys($sources));
+//
+// if ($pref == 'search_fields') {
+// $out = array();
+// foreach (array_keys($sources) as $source) {
+// $out[$source] = array_keys($GLOBALS['registry']->call('contacts/fields', array($source)));
+// }
+// } else {
+// $out = array_keys($sources);
+// }
+//
+// return json_encode($out);
// }
//
// return $value;