[Tutos-commits] tutos/php/email email.pinc,NONE,1.1
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
From: Gero K. <gok...@us...> - 2009-04-16 10:39:03
|
Update of /cvsroot/tutos/tutos/php/email In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8586/email Added Files: email.pinc Log Message: use handler methods for email addresses --- NEW FILE: email.pinc --- <?php /** * Copyright 2005 - 2009 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * * CVS Info: $Id: email.pinc,v 1.1 2009/04/16 10:38:56 gokohnert Exp $ * $Author: gokohnert $ * * handle email addresses */ /** * handle email addresses (formerly AsEmail in webelement.p3) */ class email_handle extends tutos_handler { /** * run the handler */ function handle(&$obj,$arg,$cnt) { global $tutos,$lang,$current_user; $r = ''; if (empty($arg)) { return ''; } if ( is_Object($obj) ) { $fn = $obj->getFullname() ; } else { $fn = $obj; } # $fn = $arg; $subject = 'TUTOS'; if ($cnt != 1) { $fn = 'mail'; } if ( $current_user->feature_ok(usemail,PERM_NEW) && ($tutos[usemail] == 1) ) { $r = makelink("mail_new.php?to[]=". UrlEncode($arg)."&subject=".UrlEncode($subject) ,$fn,sprintf($lang['MailSendTo'],$arg)); } else if ( $tutos[usemail] == 2 ) { $r = makelink($tutos[squirrelurl]."src/compose.php?send_to=". UrlEncode(trim($arg))."&subject=".UrlEncode($subject) ,$fn,sprintf($lang['MailSendTo'],$arg), '', '_blank'); } else { $r = makelink("mailto:". $name ."<". trim($arg) .">?subject=".$subject ,$fn,sprintf($lang['MailSendTo'],$arg) ); } if ($cnt == 1) { return $r; } else { return ' ['.$r.']'; } return $r; } /** * check if all is ok */ function check(&$obj,$arg) { // allways delivers something return true; } } ?> |