4 require_once(
"./Services/Xml/classes/class.ilSaxParser.php");
5 require_once(
"Services/Mail/classes/class.ilMailbox.php");
30 define(
'EXPORT_VERSION',4);
33 $this->mode = $a_mode;
44 return count($this->mails);
49 if(count($this->not_imported))
51 return implode(
"<br/>",$this->not_imported);
63 xml_set_object($a_xml_parser,$this);
64 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
65 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
78 if(count($this->not_imported))
102 if($a_attribs[
"exportVersion"] < EXPORT_VERSION)
104 $ilErr->raiseError(
"!!! This export Version isn't supported, update your ILIAS 2 installation"
112 $this->not_imported[] = $a_attribs[
"id"];
123 if($a_attribs[
"systemMessage"])
135 $this->mails[
$this->counter][
"import_name"] = $a_attribs[
"import_name"];
161 if(!isset($this->mails[$this->counter][
"folder_id"]))
163 $tmp_mailbox =&
new ilMailbox($this->i3_id);
167 $this->mails[
$this->counter][
"folder_id"] = $tmp_mailbox->getInboxFolder();
171 $this->mails[
$this->counter][
"folder_id"] = $tmp_mailbox->getSentFolder();
175 $this->mails[
$this->counter][
"folder_id"] = $tmp_mailbox->getDraftsFolder();
179 $this->mails[
$this->counter][
"folder_id"] = $tmp_mailbox->getTrashFolder();
187 $this->mails[
$this->counter][
"send_time"] = date(
"Y-m-d H:i:s",$this->cdata);
188 $this->mails[
$this->counter][
"timest"] = date(
"YmdHis",$this->cdata);
206 $this->mails[
$this->counter][
"m_message"] =
"Url: ".$this->cdata.
" <br>";
210 case "urlDescription":
238 $a_data = str_replace(
"<",
"<",$a_data);
239 $a_data = str_replace(
">",
">",$a_data);
243 $this->cdata .= $a_data;
251 $sth = $ilDB->prepare(
"INSERT INTO mail VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
263 if(!count($this->mails))
268 foreach($this->mails as $mail)
271 addslashes($mail[
"usr_id"]),
272 addslashes($mail[
"folder_id"]),
273 addslashes($mail[
"sender_id"]),
274 addslashes(serialize(array())),
275 addslashes($mail[
"send_time"]),
276 addslashes($mail[
"rcp_to"]),
277 addslashes($mail[
"rcp_cc"]),
278 addslashes($mail[
"rcp_bcc"]),
279 addslashes($mail[
"read"]),
280 addslashes(serialize(array(
"normal"))),
281 addslashes($mail[
"m_email"]),
282 addslashes($mail[
"m_subject"]),
283 addslashes($mail[
"m_message"]),
284 addslashes($mail[
"import_name"])));
287 return $sql ? $sql :array();