/** * Returns a list of available sources. * * @param boolean $writeable If true, limits to writeable sources. * @param boolean $sync_only Only include synchable address books. * * @return array An array of the available sources. Keys are source IDs, * values are source titles. * @since 4.2.0 */ public function sources($writeable = false, $sync_only = false) { $out = array(); foreach (Nag::listTasklists(false, $writeable ? Horde_Perms::EDIT : Horde_Perms::READ, false) as $key => $val) { $out[$key] = $val->get('name'); } if ($sync_only) { $syncable = Nag::getSyncLists(); $out = array_intersect_key($out, array_flip($syncable)); } return $out; }