1: <?php
2: /**
3: * Copyright 2013-2014 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @category Horde
9: * @copyright 2013-2014 Horde LLC
10: * @license http://www.fsf.org/copyleft/gpl.html GPL
11: * @package IMP
12: */
13:
14: /**
15: * Interface for a contacts flag image backend based on the sending host.
16: *
17: * @author Michael Slusarz <slusarz@horde.org>
18: * @category Horde
19: * @copyright 2013-2014 Horde LLC
20: * @license http://www.horde.org/licenses/gpl GPL
21: * @package IMP
22: */
23: class IMP_Contacts_Flag_Host implements IMP_Contacts_Flag_Backend
24: {
25: /**
26: */
27: public function flagImg($email)
28: {
29: $addr = new Horde_Mail_Rfc822_Address($email);
30: if ($flag = Horde_Core_Ui_FlagImage::getFlagImageObByHost($addr->host)) {
31: return array(
32: 'desc' => $flag['name'],
33: 'url' => $flag['ob']
34: );
35: }
36:
37: return null;
38: }
39:
40: }
41: