<?php
/* $Id: contact_func.inc.php,v 1.10 2003/11/11 16:11:16 k-fish Exp $ */

// helper function to create an email link
// based on settings
function linkEmail($email){
    if($email!=""){
        if(isset($_SESSION["MGW"]->settings["use_webmail"]) and $_SESSION["MGW"]->settings["use_webmail"] == 1) $email="<a href=\"../webmail2/index.php?rightframe=".rawurlencode("sendmail.php?to=".$email)."&amp;".SID."\">".$email."</a>";
	else $email = "<a href=\"mailto:".$email."\">".$email."</a>";
    }
    return $email;
}

// generates two email links for the context menu of contacts
function linkEmail2($email){
    $rs = '';
    if($email!=""){
        if(isModuleInstalled('webmail2'))
	    $rs="<a href=\"../webmail2/index.php?rightframe=".rawurlencode("sendmail.php?to=".$email)."&amp;".SID."\">".Lang::getLanguageString('email').' ('.Lang::getLanguageString('webmail2').")</a><br />";
	$rs .= "<a href=\"mailto:$email\">".Lang::getLanguageString('email')." (mailto:)</a><br />";
    }
    return $rs;
}

?>
