|
0
|
1 <?php
|
|
|
2
|
|
|
3 /**
|
|
|
4 +-----------------------------------------------------------------------+
|
|
|
5 | This file is part of the Roundcube Webmail client |
|
|
|
6 | Copyright (C) 2005-2012, The Roundcube Dev Team |
|
|
|
7 | Copyright (C) 2011-2012, Kolab Systems AG |
|
|
|
8 | |
|
|
|
9 | Licensed under the GNU General Public License version 3 or |
|
|
|
10 | any later version with exceptions for skins & plugins. |
|
|
|
11 | See the README file for a full license statement. |
|
|
|
12 | |
|
|
|
13 | PURPOSE: |
|
|
|
14 | Class representing a message part |
|
|
|
15 +-----------------------------------------------------------------------+
|
|
|
16 | Author: Thomas Bruederli <roundcube@gmail.com> |
|
|
|
17 | Author: Aleksander Machniak <alec@alec.pl> |
|
|
|
18 +-----------------------------------------------------------------------+
|
|
|
19 */
|
|
|
20
|
|
|
21 /**
|
|
|
22 * Class representing a message part
|
|
|
23 *
|
|
|
24 * @package Framework
|
|
|
25 * @subpackage Storage
|
|
|
26 * @author Thomas Bruederli <roundcube@gmail.com>
|
|
|
27 * @author Aleksander Machniak <alec@alec.pl>
|
|
|
28 */
|
|
|
29 class rcube_message_part
|
|
|
30 {
|
|
|
31 /**
|
|
|
32 * Part MIME identifier
|
|
|
33 *
|
|
|
34 * @var string
|
|
|
35 */
|
|
|
36 public $mime_id = '';
|
|
|
37
|
|
|
38 /**
|
|
|
39 * Content main type
|
|
|
40 *
|
|
|
41 * @var string
|
|
|
42 */
|
|
|
43 public $ctype_primary = 'text';
|
|
|
44
|
|
|
45 /**
|
|
|
46 * Content subtype
|
|
|
47 *
|
|
|
48 * @var string
|
|
|
49 */
|
|
|
50 public $ctype_secondary = 'plain';
|
|
|
51
|
|
|
52 /**
|
|
|
53 * Complete content type
|
|
|
54 *
|
|
|
55 * @var string
|
|
|
56 */
|
|
|
57 public $mimetype = 'text/plain';
|
|
|
58
|
|
|
59 /**
|
|
25
|
60 * Real content type (for fake parts)
|
|
|
61 *
|
|
|
62 * @var string|null
|
|
|
63 */
|
|
|
64 public $realtype;
|
|
|
65
|
|
|
66 /**
|
|
|
67 * Real content type of a message/rfc822 part
|
|
|
68 *
|
|
|
69 * @var string
|
|
|
70 */
|
|
|
71 public $real_mimetype = '';
|
|
|
72
|
|
|
73 /**
|
|
0
|
74 * Part size in bytes
|
|
|
75 *
|
|
|
76 * @var int
|
|
|
77 */
|
|
|
78 public $size = 0;
|
|
|
79
|
|
|
80 /**
|
|
25
|
81 * Part body
|
|
|
82 *
|
|
|
83 * @var string|null
|
|
|
84 */
|
|
|
85 public $body;
|
|
|
86
|
|
|
87 /**
|
|
0
|
88 * Part headers
|
|
|
89 *
|
|
|
90 * @var array
|
|
|
91 */
|
|
25
|
92 public $headers = [];
|
|
|
93
|
|
|
94 /**
|
|
|
95 * Sub-Parts
|
|
|
96 *
|
|
|
97 * @var array
|
|
|
98 */
|
|
|
99 public $parts = [];
|
|
|
100
|
|
|
101 /**
|
|
|
102 * Part Content-Id
|
|
|
103 *
|
|
|
104 * @var string|null
|
|
|
105 */
|
|
|
106 public $content_id;
|
|
|
107
|
|
|
108 /**
|
|
|
109 * Part Content-Location
|
|
|
110 *
|
|
|
111 * @var string|null
|
|
|
112 */
|
|
|
113 public $content_location;
|
|
|
114
|
|
19
|
115 public $type;
|
|
0
|
116 public $disposition = '';
|
|
|
117 public $filename = '';
|
|
|
118 public $encoding = '8bit';
|
|
|
119 public $charset = '';
|
|
|
120 public $d_parameters = array();
|
|
|
121 public $ctype_parameters = array();
|
|
22
|
122 public $replaces = [];
|
|
25
|
123 public $body_modified = false;
|
|
0
|
124
|
|
|
125 /**
|
|
|
126 * Clone handler.
|
|
|
127 */
|
|
|
128 function __clone()
|
|
|
129 {
|
|
|
130 if (isset($this->parts)) {
|
|
|
131 foreach ($this->parts as $idx => $part) {
|
|
|
132 if (is_object($part)) {
|
|
|
133 $this->parts[$idx] = clone $part;
|
|
|
134 }
|
|
|
135 }
|
|
|
136 }
|
|
|
137 }
|
|
|
138 }
|