1: <?php
2: /**
3: * Handles iTip response options for Horde iTip responses.
4: *
5: * PHP version 5
6: *
7: * @category Horde
8: * @package Itip
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL
11: * @link http://pear.horde.org/index.php?package=Itip
12: */
13:
14: /**
15: * Handles iTip response options for Horde iTip responses.
16: *
17: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you did not
20: * receive this file, see
21: * {@link http://www.horde.org/licenses/lgpl21 LGPL}.
22: *
23: * @category Horde
24: * @package Itip
25: * @author Gunnar Wrobel <wrobel@pardus.de>
26: * @license http://www.horde.org/licenses/lgpl21 LGPL
27: * @link http://pear.horde.org/index.php?package=Itip
28: */
29: class Horde_Itip_Response_Options_Horde
30: extends Horde_Itip_Response_Options_Base
31: {
32: /**
33: * The MIME character set.
34: *
35: * @var string
36: */
37: private $_charset;
38:
39: /**
40: * Options for setting the "Received" MIME header.
41: *
42: * @var array
43: */
44: private $_received_options;
45:
46: /**
47: * Constructor.
48: *
49: * @param string $charset The MIME character set that should be
50: * used.
51: * @param array $received_options Options for setting the "Received" MIME
52: * header.
53: */
54: public function __construct($charset, $received_options)
55: {
56: $this->_charset = $charset;
57: $this->_received_options = $received_options;
58: }
59: /**
60: * Prepare the iCalendar MIME part of the response message.
61: *
62: * @param Horde_Mime_Part $ics The iCalendar MIME part of the response
63: * message.
64: *
65: * @return NULL
66: */
67: public function prepareResponseMimeHeaders(Horde_Mime_Headers $headers)
68: {
69: $headers->addReceivedHeader($this->_received_options);
70: $headers->addMessageIdHeader();
71: }
72:
73: /**
74: * Get the character set for the response mime parts.
75: *
76: * @return string The character set.
77: */
78: public function getCharacterSet()
79: {
80: return $this->_charset;
81: }
82:
83: /**
84: * Get the product ID of the iCalendar object embedded in the MIME response.
85: *
86: * @return string The product ID.
87: */
88: public function getProductId()
89: {
90: $headers = new Horde_Mime_Headers();
91: return '-//The Horde Project//' . $headers->getUserAgent() . '//EN';
92: }
93: }