function makeMenuLink(&$contactList, &$nav) { if (!is_a($contactList, 'GroupContactList') || $contactList->group == '') { return; } $epp = $contactList->entriesPerPage; $start = $contactList->start; $contactList->setEntriesPerPage(0); $contactList->setStartString(''); $c = $contactList->getContacts(); $contactList->setEntriesPerPage($epp); $contactList->setStartString($start); $allEmails = ''; foreach ($c as $cont) { $eml = $cont->getValueGroup('email'); if (count($eml) > 0) { $allEmails .= StringHelper::obscureString($cont->contact['lastname'] . ' ' . $cont->contact['firstname'] . ' <' . $eml[0]['value'] . '>,'); } } $nav->addEntry('plugin.Mailto', 'mailto', 'mailto:' . $allEmails); }
/** * generate a HTML link to send an email. Takes care of obscuring. * @static * @param string|array list of emails * @param string $text text between <a> and </a> * @return string <a href="mailto:-emails-"> $text </a> */ function sendEmailLink($email, $text) { return "<a class='email' href='mailto:" . EmailHelper::sendEmailHref($email) . "'>" . StringHelper::obscureString($text) . '</a>'; }