24 require_once(
"classes/class.ilSaxParser.php");
25 require_once(
"Services/Mail/classes/class.ilMailbox.php");
50 define(
'EXPORT_VERSION',4);
53 $this->mode = $a_mode;
64 return count($this->mails);
69 if(count($this->not_imported))
71 return implode(
"<br/>",$this->not_imported);
83 xml_set_object($a_xml_parser,$this);
84 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
85 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
98 if(count($this->not_imported))
122 if($a_attribs[
"exportVersion"] < EXPORT_VERSION)
124 $ilErr->raiseError(
"!!! This export Version isn't supported, update your ILIAS 2 installation"
132 $this->not_imported[] = $a_attribs[
"id"];
143 if($a_attribs[
"systemMessage"])
155 $this->mails[
$this->counter][
"import_name"] = $a_attribs[
"import_name"];
181 if(!isset($this->mails[$this->counter][
"folder_id"]))
183 $tmp_mailbox =&
new ilMailbox($this->i3_id);
187 $this->mails[
$this->counter][
"folder_id"] = $tmp_mailbox->getInboxFolder();
191 $this->mails[
$this->counter][
"folder_id"] = $tmp_mailbox->getSentFolder();
195 $this->mails[
$this->counter][
"folder_id"] = $tmp_mailbox->getDraftsFolder();
199 $this->mails[
$this->counter][
"folder_id"] = $tmp_mailbox->getTrashFolder();
207 $this->mails[
$this->counter][
"send_time"] = date(
"Y-m-d H:i:s",$this->cdata);
208 $this->mails[
$this->counter][
"timest"] = date(
"YmdHis",$this->cdata);
226 $this->mails[
$this->counter][
"m_message"] =
"Url: ".$this->cdata.
" <br>";
230 case "urlDescription":
258 $a_data = str_replace(
"<",
"<",$a_data);
259 $a_data = str_replace(
">",
">",$a_data);
263 $this->cdata .= $a_data;
271 $sth = $ilDB->prepare(
"INSERT INTO mail VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
283 if(!count($this->mails))
288 foreach($this->mails as $mail)
291 addslashes($mail[
"usr_id"]),
292 addslashes($mail[
"folder_id"]),
293 addslashes($mail[
"sender_id"]),
294 addslashes(serialize(array())),
295 addslashes($mail[
"send_time"]),
296 addslashes($mail[
"rcp_to"]),
297 addslashes($mail[
"rcp_cc"]),
298 addslashes($mail[
"rcp_bcc"]),
299 addslashes($mail[
"read"]),
300 addslashes(serialize(array(
"normal"))),
301 addslashes($mail[
"m_email"]),
302 addslashes($mail[
"m_subject"]),
303 addslashes($mail[
"m_message"]),
304 addslashes($mail[
"import_name"])));
307 return $sql ? $sql :array();