/** * @param string $name * @param string $value */ function AddNode($name, $value) { if (!is_int($value)) { $value = ConvertUtils::WMHtmlSpecialChars($value); } $this->AppendChild(new XmlDomNode($name, $value)); }
/** * @param string $tagName * @param string $value optional * @param bool $isCDATA optional * @return XmlDomNode */ function XmlDomNode($tagName, $value = null, $isCDATA = false, $isSimpleCharsCode = false) { $value = $value ? ConvertUtils::ClearUtf8($value) : $value; $this->TagName = $tagName; $this->Value = $value; if ($isCDATA) { $value = $isSimpleCharsCode ? ConvertUtils::WMHtmlNewCode($value) : ConvertUtils::WMHtmlSpecialChars($value); $this->Value = '<![CDATA[' . $value . ']]>'; } }
/** * @param PageBuilder $pageBuilder * @return ContactsPanel */ function CNewMessagePanel(&$pagebuilder) { $this->Type = Post::val('mtype', 'mes'); $this->To = ''; $this->_pagebuilder =& $pagebuilder; $this->_proc =& $pagebuilder->_proc; $this->From = $this->_getFromEmail(); $this->_pagebuilder->_top->AddOnResize('ResizeElements(\'all\');'); if ($this->_proc->account->AllowDhtmlEditor) { $editorResize = 'HTMLEditor.Resize(width - 1, height - 2);'; $editorReplace = 'HTMLEditor.Replace();'; } else { $editorResize = ' plainEditor.style.height = (height - 1) + "px"; plainEditor.style.width = (width - 2) + "px"; '; $editorReplace = ''; } $this->inputs = ''; $contacts = null; if (Post::has('contacts') && is_array(Post::val('contacts'))) { $contactsArray = array_keys(Post::val('contacts')); $contacts =& $this->_proc->db->LoadContactsById($contactsArray); } if (Post::has('groupid')) { $group =& $this->_proc->db->SelectGroupById(Post::val('groupid', -1)); $contacts =& $this->_proc->db->SelectAddressGroupContacts(Post::val('groupid', -1)); } if ($contacts) { foreach ($contacts->Instance() as $contact) { if (!$contact->Email) { continue; } $this->To .= $contact->Name ? '"' . $contact->Name . '" <' . $contact->Email . '>, ' : $contact->Email . ','; } $this->To = trim(trim($this->To), ','); } if (Post::has('mailto')) { $this->To = Post::val('mailto', ''); } if (Get::has('to')) { $this->To = (string) trim(Get::val('to', '')); } $message = null; $isHtml = $this->_proc->account->AllowDhtmlEditor; $this->attacmentsHtml = ''; $this->_pagebuilder->AddJSText(' var bcc, bcc_mode, bcc_mode_switcher; var plainCont = null; var plainEditor = null; var HTMLEditor = null; var EditAreaUrl = "edit-area.php"; var prevWidth = 0; var prevHeight = 0; var rowIndex = 0; function ResizeElements(mode) { var width = GetWidth(); if (width < 684) width = 684; width = width - 40; var height = Math.ceil(width/3); if (prevWidth != width && prevHeight != height) { prevWidth = width; prevHeight = height; if (plainCont != null) { plainCont.style.height = height + "px"; plainCont.style.width = width + "px"; ' . $editorResize . ' } } } function WriteEmails(str, field) { var mailInput; if (field == 2) { mailInput = document.getElementById("toCC"); } else if (field == 3) { mailInput = document.getElementById("toBCC"); } else { mailInput = document.getElementById("toemail"); } if (mailInput) { mailInput.value = (mailInput.value == "") ? str : mailInput.value + ", " + str; mailInput.focus(); } } function LoadAttachmentHandler(attachObj) { var attachtable = document.getElementById("attachmentTable"); if (attachObj) { var imageLink = GetFileParams(attachObj.FileName); var tr = attachtable.insertRow(rowIndex++); tr.id = "tr_" + attachObj.TempName; var td = tr.insertCell(0); td.className = "wm_attachment"; var innerHtml = \'<img src="./images/icons/\' + imageLink.image + \'" />\'; innerHtml += \'<input type="hidden" name="attachments[\' + attachObj.TempName + \']" value="\' + attachObj.FileName + \'">\'; innerHtml += HtmlEncode(attachObj.FileName) + \' (\' + GetFriendlySize(attachObj.Size) + \') <a href="#" id="\' + attachObj.TempName + \'" onclick="return DeleteAttach(this.id);">' . JS_LANG_Delete . '</a>\'; td.innerHTML = innerHtml; } } function ChangeBCCMode() { if (bcc_mode == "hide") { bcc_mode = "show"; bcc.className = ""; bcc_mode_switcher.innerHTML = Lang.HideBCC; } else { bcc_mode = "hide"; bcc.className = "wm_hide"; bcc_mode_switcher.innerHTML = Lang.ShowBCC; } ' . $editorReplace . ' return false; } function UpdateIdUid(id, uid) { var idf = document.getElementById("m_id"); var uidf = document.getElementById("m_uid"); if (idf && uidf) { idf.value = id; uidf.value = uid; } } var Rep_m, Err_m; var hiddensaveiframe; var pop3Pr = ' . ($pagebuilder->_proc->account->MailProtocol == MAILPROTOCOL_POP3 ? 'true' : 'false') . '; function DoSaveButton() { if (pop3Pr) { if (!hiddensaveiframe) { hiddensaveiframe = CreateChildWithAttrs(document.body, "iframe", [["name", "hiddensaveiframe"], ["class", "wm_hide"]]); } } var form = document.getElementById("messageForm"); form.action = "' . ACTIONFILE . '?action=save&req=message"; form.target = (pop3Pr) ? "hiddensaveiframe" : ""; if (submitSaveMessage()) { form.submit(); } } function DoSendButton() { var toemail = document.getElementById("toemail"); var ccemail = document.getElementById("toCC"); var bccemail = document.getElementById("toBCC"); var subject = document.getElementById("subject"); var mailIsCorrect = false; if ((toemail && toemail.value.length > 3) || (ccemail && ccemail.value.length > 3) || (bccemail && bccemail.value.length > 3)) { mailIsCorrect = true; } if (mailIsCorrect) { if (subject && subject.value.length < 1 && !confirm(Lang.ConfirmEmptySubject)) { return false; } var form = document.getElementById("messageForm"); form.action = "' . ACTIONFILE . '?action=send&req=message"; form.target = ""; if (submitSaveMessage()) { form.submit(); } } else { alert(Lang.WarningToBlank); } } function DeleteAttach(idline) { var trtable = document.getElementById("tr_" + idline); if (trtable) { trtable.className = "wm_hide"; CleanNode(trtable); } return false; } function ShowPictures() { var showPictureTable = document.getElementById("showpicturestable"); if (HTMLEditor) { var temp = HTMLEditor.GetText().ReplaceStr("wmx_src", "src"); temp = temp.ReplaceStr("wmx_background", "background"); HTMLEditor.SetHtml(temp); if (showPictureTable) { showPictureTable.className = "wm_hide"; } HTMLEditor.Replace(); } } '); $this->_pagebuilder->AddInitText(' bcc_mode = "hide"; bcc = document.getElementById("bcc"); bcc_mode_switcher = document.getElementById("bcc_mode_switcher"); plainEditor = document.getElementById("editor_area"); plainCont = document.getElementById("editor_cont"); Rep_m = new CReport("Rep_m"); Rep_m.Build(); Err_m = new CError("Err_m", "' . ConvertUtils::ClearJavaScriptString($this->_pagebuilder->SkinName(), '"') . '"); Err_m.Build(); '); $m_id = -1; $m_uid = ''; if (Post::has('m_id')) { $mes_id = Post::val('m_id'); $mes_uid = Post::val('m_uid'); $folder_id = Post::val('f_id'); $folder_name = Post::val('f_name'); $folder_name = 'defaultname'; $mes_charset = Post::val('charset', -1); $message = new GetMessageBase($this->_proc->account, $mes_id, $mes_uid, $folder_id, $folder_name, $mes_charset); $m_id = (int) $mes_id; $m_uid = $mes_uid; } $this->inputs = '<input type="hidden" id="m_id" name="m_id" value="' . ConvertUtils::AttributeQuote($m_id) . '"><input type="hidden" id="m_uid" name="m_uid" value="' . ConvertUtils::AttributeQuote($m_uid) . '">'; $withSignature = false; switch ($this->_proc->account->SignatureOptions) { case SIGNATURE_OPTION_AddToAll: $withSignature = true; break; case SIGNATURE_OPTION_AddToNewOnly: $withSignature = $this->Type == 'mes'; break; default: case SIGNATURE_OPTION_DontAdd: $withSignature = false; break; } if ($message) { if ($this->Type != 'forward' && $this->Type != 'reply' && $this->Type != 'replytoall') { $withSignature = false; } $this->_pagebuilder->AddInitText('SetPriority(' . $message->msg->GetPriorityStatus() . ');'); switch ($this->Type) { default: $this->To = $message->PrintTo(true); $this->CC = $message->PrintCC(true); $this->BCC = ''; $this->Subject = $message->PrintSubject(true); break; case 'forward': $this->To = ''; $this->CC = ''; $this->BCC = ''; $this->Subject = JS_LANG_Fwd . ': ' . $message->PrintSubject(true); break; case 'reply': $replyto = trim($message->PrintReplyTo(true)); $this->To = strlen($replyto) > 0 ? $replyto : $message->PrintFrom(true); $this->CC = ''; $this->BCC = ''; $this->Subject = JS_LANG_Re . ': ' . $message->PrintSubject(true); break; case 'replytoall': $emailCollection =& $message->msg->GetAllRecipients(false, true); $temp = ''; if ($emailCollection) { foreach ($emailCollection->Instance() as $value) { $email =& $value; if ($email->Email != $this->_proc->account->Email) { $temp .= $email->Email . ', '; } } } $this->To = trim(trim($temp), ','); $this->CC = ''; $this->BCC = ''; $this->Subject = JS_LANG_Re . ': ' . $message->PrintSubject(true); break; } if ($this->_proc->account->AllowDhtmlEditor) { switch ($this->Type) { case 'forward': case 'reply': case 'replytoall': if ($message->account->ViewMode == VIEW_MODE_PREVIEW_PANE_NO_IMG || $message->account->ViewMode == VIEW_MODE_WITHOUT_PREVIEW_PANE_NO_IMG) { $isHtml = true; $this->Body = ConvertUtils::HtmlBodyWithoutImages($message->msg->GetRelpyAsHtml(true)); if (isset($GLOBALS[GL_WITHIMG]) && $GLOBALS[GL_WITHIMG]) { $GLOBALS[GL_WITHIMG] = false; $this->isSafety = false; } } else { $isHtml = true; $this->Body = ConvertUtils::HtmlBodyWithoutImages($message->msg->GetRelpyAsHtml(true)); } break; default: if ($message->account->ViewMode == VIEW_MODE_PREVIEW_PANE_NO_IMG || $message->account->ViewMode == VIEW_MODE_WITHOUT_PREVIEW_PANE_NO_IMG) { if ($message->msg->HasHtmlText()) { $isHtml = true; $this->Body = ConvertUtils::HtmlBodyWithoutImages($message->msg->GetCensoredHtmlWithImageLinks(true)); if (isset($GLOBALS[GL_WITHIMG]) && $GLOBALS[GL_WITHIMG]) { $GLOBALS[GL_WITHIMG] = false; $this->isSafety = false; } } elseif ($message->msg->HasPlainText()) { $isHtml = false; $this->Body = $message->msg->GetNotCensoredTextBody(true); } } else { if ($message->msg->HasHtmlText()) { $isHtml = true; $this->Body = $message->msg->GetCensoredHtmlWithImageLinks(true); } elseif ($message->msg->HasPlainText()) { $isHtml = false; $this->Body = $message->msg->GetNotCensoredTextBody(true); } } break; } } else { $isHtml = false; switch ($this->Type) { case 'forward': case 'reply': case 'replytoall': $this->Body = $message->msg->GetRelpyAsPlain(true); break; default: $this->Body = $message->msg->GetNotCensoredTextBody(true); break; } } if ($message->HasAttachments() && $this->Type != 'reply' && $this->Type != 'replytoall') { $attachments =& $message->msg->Attachments; if ($attachments != null && $attachments->Count() > 0) { foreach (array_keys($attachments->Instance()) as $key) { $attachment =& $attachments->Get($key); $tempname = $message->msg->IdMsg . '-' . $key . '_' . $attachment->GetTempName(); //$filename = ConvertUtils::ConvertEncoding($attachment->GetFilenameFromMime(), $GLOBALS[MailInputCharset], $message->account->GetUserCharset()); $filename = ConvertUtils::WMHtmlSpecialChars($attachment->GetFilenameFromMime()); $filesize = GetFriendlySize(strlen($attachment->MimePart->GetBinaryBody())); $fs =& new FileSystem(INI_DIR . '/temp', $message->account->Email, $message->account->Id); $attfolder =& new Folder($message->account->Id, -1, Session::val('attachtempdir', md5(session_id()))); $fs->SaveAttach($attachment, $attfolder, $tempname); $this->attacmentsHtml .= ' <tr id="tr_' . ConvertUtils::AttributeQuote($tempname) . '"><td class="wm_attachment"><img src="./images/icons/' . GetAttachImg($filename) . '" /> <input type="hidden" name="attachments[' . ConvertUtils::AttributeQuote($tempname) . ']" value="' . ConvertUtils::AttributeQuote($filename) . '"> ' . $filename . ' (' . $filesize . ') <a href="#" id="' . ConvertUtils::AttributeQuote($tempname) . '" onClick="return DeleteAttach(this.id);">' . JS_LANG_Delete . '</a></td></tr>'; } } } } else { $this->_pagebuilder->AddInitText('SetPriority(3);'); } $signature = ''; if ($withSignature) { if ($this->_proc->account->AllowDhtmlEditor) { $signature = $this->_proc->account->SignatureType == 0 ? nl2br($this->_proc->account->Signature) : $this->_proc->account->Signature; $signature = $isHtml ? $signature : strip_tags(nl2br($signature)); } else { $signature = $this->_proc->account->SignatureType == 0 ? strip_tags($this->_proc->account->Signature) : strip_tags($this->_proc->account->Signature); } } $this->Body = $signature . $this->Body; if ($this->_proc->account->AllowDhtmlEditor) { $this->_pagebuilder->AddJSFile('class.html-editor.js'); $setText = $isHtml ? 'HTMLEditor.SetHtml(mess);' : 'HTMLEditor.SetText(mess);'; $this->_pagebuilder->AddJSText(' function submitSaveMessage() { var hiddenkey = document.getElementById("ishtml"); if (HTMLEditor._htmlMode) { plainEditor.value = HTMLEditor.GetText(); hiddenkey.value = "1"; } else { hiddenkey.value = "0"; } if (bcc_mode == "hide") { document.getElementById("toBCC").value = ""; } return true; } function EditAreaLoadHandler() { HTMLEditor.LoadEditArea(); } function CreateLinkHandler(url) { HTMLEditor.CreateLinkFromWindow(url); } function DesignModeOnHandler(rer) { HTMLEditor.Show(); var mess = "' . ConvertUtils::ReBuildStringToJavaScript($this->Body, '"') . '"; if (mess.length == 0) { mess = "<br />"; } ' . $setText . ' } '); $this->_pagebuilder->AddInitText(' HTMLEditor = new CHtmlEditorField(true); HTMLEditor.SetPlainEditor(plainEditor, document.getElementById("mode_switcher")); HTMLEditor.Show();'); } else { $this->_pagebuilder->AddJSText(' function submitSaveMessage() { var hiddenkey = document.getElementById("ishtml"); hiddenkey.value = "0"; if (bcc_mode == "hide") { document.getElementById("toBCC").value = ""; } return true; } '); } }
function GetMessageNode(&$_xmlRes, &$_message, &$_folder, &$_processor, &$_account, &$_settings, $_mode, $_charsetNum, $_isFromSave) { $_safety = true; $_messageNode = new XmlDomNode('message'); $_msgId = $_message->IdMsg; $_msgUid = $_message->Uid; $_messageInfo = new CMessageInfo(); $_messageInfo->SetInfo($_msgId, $_msgUid, $_folder->IdDb, $_folder->FullName); $_messageClassType = $_message->TextBodies->ClassType(); $_messageNode->AppendAttribute('id', $_msgId); $_messageNode->AppendAttribute('size', $_message->GetMailSize()); $_messageNode->AppendAttribute('html', (int) (($_messageClassType & 2) == 2)); $_messageNode->AppendAttribute('plain', (int) (($_messageClassType & 1) == 1)); $_messageNode->AppendAttribute('priority', $_message->GetPriorityStatus()); $_messageNode->AppendAttribute('mode', $_mode); $_messageNode->AppendAttribute('charset', $_charsetNum); $_messageNode->AppendAttribute('has_charset', (int) $_message->HasCharset); $_messageNode->AppendAttribute('downloaded', (int) $_message->Downloaded); $_messageNode->AppendAttribute('sensivity', $_message->GetSensitivity()); $maf =& MessageActionFilters::CreateInstance(); $mafNoReply = $maf->GetNoReplyEmails(); $mafNoReplyAll = $maf->GetNoReplyAllEmails(); $mafNoForward = $maf->GetNoForwardEmails(); $fromEmail = $_message->GetFrom(); $fromEmail = $fromEmail->Email; $_textCharset = $_message->GetTextCharset(); $_rtl = 0; if (null !== $_textCharset) { switch (ConvertUtils::GetCodePageNumber($_textCharset)) { case 1255: case 1256: case 28596: case 28598: $_rtl = 1; break; } } $_messageNode->AppendAttribute('rtl', $_rtl); $_messageNode->AppendChild(new XmlDomNode('uid', $_msgUid, true)); $_folderNode = new XmlDomNode('folder', $_folder->FullName, true); $_folderNode->AppendAttribute('id', $_folder->IdDb); $_messageNode->AppendChild($_folderNode); $_signature_html = ''; $_signature_plain = ''; if ($_account->SignatureOptions == SIGNATURE_OPTION_AddToAll) { if ($_account->SignatureType == 1) { $_signature_html = '<br />' . $_account->Signature; require_once WM_ROOTPATH . 'libs/class_converthtml.php'; $_pars = new convertHtml($_account->Signature, false); $_signature_plain = CRLF . $_pars->get_text(); } else { $_signature_plain = CRLF . $_account->Signature; $_signature_html = '<br />' . nl2br($_account->Signature); } $_signature_plain = ConvertUtils::WMHtmlSpecialChars($_signature_plain); } $_accountOffset = $_settings->AllowUsersChangeTimeZone ? $_account->GetDefaultTimeOffset() : $_account->GetDefaultTimeOffset($_settings->DefaultTimeZone); if (($_mode & 1) == 1) { $_headersNode = new XmlDomNode('headers'); $_fromNode = new XmlDomNode('from'); $_id_addr = -1; $_from4search =& $_message->GetFrom(); if ($_from4search && USE_DB) { $_id_addr = $_processor->DbStorage->GetContactIdByEmail($_from4search->Email, $_account->IdUser); } if ($_id_addr > 0) { $_fromNode->AppendAttribute('contact_id', $_id_addr); $_bigContactNode = CXmlProcessing::GetContactNodeFromAddressBookRecord($_account, $_settings, $_id_addr); if (null != $_bigContactNode) { $_xmlRes->XmlRoot->AppendChild($_bigContactNode); } } $_fromNode->AppendChild(new XmlDomNode('short', WebMailMessage::ClearForSend(trim($_from4search->DisplayName)), true)); $_fromNode->AppendChild(new XmlDomNode('full', $_from4search->ToDecodedString(), true)); $_headersNode->AppendChild($_fromNode); $_headersNode->AppendChild(new XmlDomNode('to', $_message->GetToAsString(true), true)); $_headersNode->AppendChild(new XmlDomNode('cc', $_message->GetCcAsString(true), true)); $_headersNode->AppendChild(new XmlDomNode('bcc', $_message->GetBccAsString(true), true)); $_headersNode->AppendChild(new XmlDomNode('reply_to', $_message->GetReplyToAsString(true), true)); $_headersNode->AppendChild(new XmlDomNode('subject', $_message->GetSubject(true), true)); $_mailConfirmation = $_message->GetReadMailConfirmationAsString(); if (strlen($_mailConfirmation) > 0) { $_headersNode->AppendChild(new XmlDomNode('mailconfirmation', $_mailConfirmation, true)); } $_date =& $_message->GetDate(); $_date->FormatString = $_account->DefaultDateFormat; $_date->TimeFormat = $_account->DefaultTimeFormat; $_headersNode->AppendChild(new XmlDomNode('short_date', $_date->GetFormattedShortDate($_accountOffset), true)); $_headersNode->AppendChild(new XmlDomNode('full_date', $_date->GetFormattedFullDate($_accountOffset), true)); $_headersNode->AppendChild(new XmlDomNode('time', $_date->GetFormattedTime($_accountOffset), true)); $_messageNode->AppendChild($_headersNode); } $html_part = ''; if (($_mode & 2) == 2 && ($_messageClassType & 2) == 2) { $html_part = ConvertUtils::ReplaceJSMethod($_message->GetCensoredHtmlWithImageLinks(true, $_messageInfo)); if (($_account->ViewMode == VIEW_MODE_PREVIEW_PANE_NO_IMG || $_account->ViewMode == VIEW_MODE_WITHOUT_PREVIEW_PANE_NO_IMG) && !$_isFromSave) { $html_part = ConvertUtils::HtmlBodyWithoutImages($html_part); if (isset($GLOBALS[GL_WITHIMG]) && $GLOBALS[GL_WITHIMG]) { $GLOBALS[GL_WITHIMG] = false; $_safety = false; } } } $modified_plain_text = ''; if (($_mode & 4) == 4 || ($_mode & 2) == 2 && ($_messageClassType & 2) != 2) { $modified_plain_text = $_message->GetCensoredTextBody(true); } if (($_mode & 8) == 8) { if (($_account->ViewMode == VIEW_MODE_PREVIEW_PANE_NO_IMG || $_account->ViewMode == VIEW_MODE_WITHOUT_PREVIEW_PANE_NO_IMG) && !$_isFromSave) { $_messageNode->AppendChild(new XmlDomNode('reply_html', ConvertUtils::AddToLinkMailToCheck(ConvertUtils::HtmlBodyWithoutImages(ConvertUtils::ReplaceJSMethod($_signature_html . $_message->GetRelpyAsHtml(true, $_accountOffset, $_messageInfo)))), true, true)); if (isset($GLOBALS[GL_WITHIMG]) && $GLOBALS[GL_WITHIMG]) { $GLOBALS[GL_WITHIMG] = false; $_safety = false; } } else { $_messageNode->AppendChild(new XmlDomNode('reply_html', ConvertUtils::AddToLinkMailToCheck(ConvertUtils::ReplaceJSMethod($_signature_html . $_message->GetRelpyAsHtml(true, $_accountOffset, $_messageInfo))), true, true)); } } if (($_mode & 16) == 16) { $_messageNode->AppendChild(new XmlDomNode('reply_plain', ConvertUtils::AddToLinkMailToCheck($_signature_plain . $_message->GetRelpyAsPlain(true, $_accountOffset)), true, true)); } if (($_mode & 32) == 32) { if (($_account->ViewMode == VIEW_MODE_PREVIEW_PANE_NO_IMG || $_account->ViewMode == VIEW_MODE_WITHOUT_PREVIEW_PANE_NO_IMG) && !$_isFromSave) { $_messageNode->AppendChild(new XmlDomNode('forward_html', ConvertUtils::AddToLinkMailToCheck(ConvertUtils::HtmlBodyWithoutImages(ConvertUtils::ReplaceJSMethod($_signature_html . $_message->GetRelpyAsHtml(true, $_accountOffset, $_messageInfo)))), true, true)); if (isset($GLOBALS[GL_WITHIMG]) && $GLOBALS[GL_WITHIMG]) { $GLOBALS[GL_WITHIMG] = false; $_safety = false; } } else { $_messageNode->AppendChild(new XmlDomNode('forward_html', ConvertUtils::AddToLinkMailToCheck(ConvertUtils::ReplaceJSMethod($_signature_html . $_message->GetRelpyAsHtml(true, $_accountOffset, $_messageInfo))), true, true)); } } if (($_mode & 64) == 64) { $_messageNode->AppendChild(new XmlDomNode('forward_plain', ConvertUtils::AddToLinkMailToCheck($_signature_plain . $_message->GetRelpyAsPlain(true, $_accountOffset)), true, true)); } if (($_mode & 128) == 128) { $_messageNode->AppendChild(new XmlDomNode('full_headers', $_message->ClearForSend(ConvertUtils::ConvertEncoding($_message->OriginalHeaders, $GLOBALS[MailInputCharset], $_account->GetUserCharset())), true, true)); } $_messageNode->AppendAttribute('safety', (int) $_safety); $_msqAttachLine = 'msg_id=' . $_msgId . '&msg_uid=' . urlencode($_msgUid) . '&folder_id=' . $_folder->IdDb . '&folder_fname=' . urlencode($_folder->FullName); $addAttachArray = array(); if (($_mode & 256) == 256 || ($_mode & 8) == 8 || ($_mode & 16) == 16 || ($_mode & 32) == 32 || ($_mode & 64) == 64) { $_attachments =& $_message->Attachments; if ($_attachments && $_attachments->Count() > 0) { $tempFiles =& CTempFiles::CreateInstance($_account); $_attachmentsNode = new XmlDomNode('attachments'); $_attachmentsKeys = array_keys($_attachments->Instance()); foreach ($_attachmentsKeys as $_key) { $attachArray = array(); $_attachment =& $_attachments->Get($_key); $_tempname = $_message->IdMsg . '-' . $_key . '_' . ConvertUtils::ClearFileName($_attachment->GetTempName()); $_filename = ConvertUtils::ClearFileName(ConvertUtils::ClearUtf8($_attachment->GetFilenameFromMime(), $GLOBALS[MailInputCharset], $_account->GetUserCharset())); $_size = 0; $_isBodyStructureAttachment = false; if ($_attachment->MimePart && $_attachment->MimePart->BodyStructureIndex !== null && $_attachment->MimePart->BodyStructureSize !== null) { $_isBodyStructureAttachment = true; $_size = $_attachment->MimePart->BodyStructureSize; } else { $_size = $tempFiles->SaveFile($_tempname, $_attachment->GetBinaryBody()); $_size = $_size < 0 ? 0 : $_size; } $attachArray['name'] = $_filename; $attachArray['tempname'] = $_tempname; $attachArray['size'] = $_size; $_bodyStructureUrlAdd = ''; if ($_isBodyStructureAttachment) { $_bodyStructureUrlAdd = 'bsi=' . urlencode($_attachment->MimePart->BodyStructureIndex); if ($_attachment->MimePart->BodyStructureEncode !== null && strlen($_attachment->MimePart->BodyStructureEncode) > 0) { $_bodyStructureUrlAdd .= '&bse=' . urlencode(ConvertUtils::GetBodyStructureEncodeType($_attachment->MimePart->BodyStructureEncode)); } } $_attachNode = new XmlDomNode('attachment'); $_attachNode->AppendAttribute('size', $_size); $_attachNode->AppendAttribute('inline', $_attachment->IsInline ? '1' : '0'); $_attachNode->AppendChild(new XmlDomNode('filename', $_filename, true)); $viewUrl = substr(strtolower($_filename), -4) == '.eml' ? 'message-view.php?type=' . MESSAGE_VIEW_TYPE_ATTACH . '&tn=' . urlencode($_tempname) : 'view-image.php?img&tn=' . urlencode($_tempname) . '&filename=' . urlencode($_filename); if ($_isBodyStructureAttachment) { $viewUrl .= '&' . $_bodyStructureUrlAdd . '&' . $_msqAttachLine; } $_attachNode->AppendChild(new XmlDomNode('view', $viewUrl, true)); $linkUrl = 'attach.php?tn=' . urlencode($_tempname); if ($_isBodyStructureAttachment) { $linkUrl .= '&' . $_bodyStructureUrlAdd . '&' . $_msqAttachLine; } $downloadUrl = $linkUrl . '&filename=' . urlencode($_filename); $attachArray['download'] = $downloadUrl; $attachArray['link'] = $linkUrl; $_attachNode->AppendChild(new XmlDomNode('download', $downloadUrl, true)); $_attachNode->AppendChild(new XmlDomNode('tempname', $_tempname, true)); $mime_type = ConvertUtils::GetContentTypeFromFileName($_filename); $_attachNode->AppendChild(new XmlDomNode('mime_type', $mime_type, true)); $attachArray['mime_type'] = $mime_type; $attachArray['download'] = $downloadUrl; $addAttachArray[] = $attachArray; $_attachmentsNode->AppendChild($_attachNode); unset($_attachment, $_attachNode, $attachArray); } $_messageNode->AppendChild($_attachmentsNode); } } ChangeHtmlTextFromAttachment($html_part, $modified_plain_text, $addAttachArray); if (($_mode & 2) == 2 && ($_messageClassType & 2) == 2) { $_messageNode->AppendChild(new XmlDomNode('html_part', ConvertUtils::AddToLinkMailToCheck($html_part), true, true)); } if (($_mode & 4) == 4 || ($_mode & 2) == 2 && ($_messageClassType & 2) != 2) { $_messageNode->AppendChild(new XmlDomNode('modified_plain_text', ConvertUtils::AddToLinkMailToCheck($modified_plain_text), true, true)); } if (($_mode & 512) == 512) { $_messageNode->AppendChild(new XmlDomNode('unmodified_plain_text', $_message->GetNotCensoredTextBody(true), true, true)); } $_messageNode->AppendChild(new XmlDomNode('save_link', 'attach.php?' . $_msqAttachLine, true)); $_messageNode->AppendChild(new XmlDomNode('print_link', 'message-view.php?type=' . MESSAGE_VIEW_TYPE_PRINT . '&' . $_msqAttachLine . '&charset=' . $_charsetNum, true)); $_messageNode->AppendAttribute('no_reply', count($mafNoReply) > 0 && in_array($fromEmail, $mafNoReply) ? '1' : '0'); $_messageNode->AppendAttribute('no_reply_all', count($mafNoReplyAll) > 0 && in_array($fromEmail, $mafNoReplyAll) ? '1' : '0'); $_messageNode->AppendAttribute('no_forward', count($mafNoForward) > 0 && in_array($fromEmail, $mafNoForward) ? '1' : '0'); $_xmlRes->XmlRoot->AppendChild($_messageNode); }
$folderNode =& new XmlDomNode('folder', $folder->FullName, true); $folderNode->AppendAttribute('id', $folder->IdDb); $messageNode->AppendChild($folderNode); $signature_html = ''; $signature_plain = ''; if ($account->SignatureOptions == SIGNATURE_OPTION_AddToAll) { if ($account->SignatureType == 1) { $signature_html = '<br />' . $account->Signature; require_once WM_ROOTPATH . 'libs/class_converthtml.php'; $pars =& new convertHtml($account->Signature, false); $signature_plain = CRLF . $pars->get_text(); } else { $signature_plain = CRLF . $account->Signature; $signature_html = '<br />' . nl2br($account->Signature); } $signature_plain = ConvertUtils::WMHtmlSpecialChars($signature_plain); $signature_html = $signature_html; } if (($mode & 1) == 1) { $headersNode =& new XmlDomNode('headers'); $headersNode->AppendChild(new XmlDomNode('from', $message->GetFromAsString(true), true)); $headersNode->AppendChild(new XmlDomNode('to', $message->GetToAsString(true), true)); $headersNode->AppendChild(new XmlDomNode('cc', $message->GetCcAsString(true), true)); $headersNode->AppendChild(new XmlDomNode('bcc', $message->GetBccAsString(true), true)); $headersNode->AppendChild(new XmlDomNode('reply_to', $message->GetReplyToAsString(true), true)); $headersNode->AppendChild(new XmlDomNode('subject', $message->GetSubject(true), true)); $date =& $message->GetDate(); $date->FormatString = $account->DefaultDateFormat; $date->TimeFormat = $account->DefaultTimeFormat; if ($settings->AllowUsersChangeTimeZone) { $headersNode->AppendChild(new XmlDomNode('date', $date->GetFormattedDate($account->GetDefaultTimeOffset()), true));
/** * @param bool $isClear optional * @return string */ function GetRelpyAsHtml($isClear = false) { $result = '<br /><blockquote style="border-left: solid 2px #000000; margin-left: 5px; padding-left: 5px">'; $result .= '---- Original Message ----<br />'; $result .= '<b>From</b>: ' . ConvertUtils::WMHtmlSpecialChars($this->GetFromAsString()) . '<br />'; $result .= '<b>To</b>: ' . ConvertUtils::WMHtmlSpecialChars($this->GetToAsString()) . '<br />'; $cc = ConvertUtils::WMHtmlSpecialChars($this->GetCcAsString()); if ($cc) { $result .= '<b>Cc</b>: ' . $cc . '<br />'; } $date =& $this->GetDate(); $result .= '<b>Sent</b>: ' . $date->GetAsStr() . '<br />'; $result .= '<b>Subject</b>: ' . ConvertUtils::WMHtmlSpecialChars($this->GetSubject()) . '<br /><br />'; if ($this->HasHtmlText()) { $result .= $this->GetCensoredHtmlWithImageLinks(true) . '</blockquote>'; } else { $result .= nl2br(ConvertUtils::WMHtmlSpecialChars($this->TextBodies->PlainTextBodyPart)) . '</blockquote>'; } return $isClear ? $this->ClearForSend($result) : $result; }
<td class="wm_print_content" style="border-width: 0px 0px 1px 1px"> <?php echo ConvertUtils::WMHtmlSpecialChars($message->PrintDate()); ?> </td> </tr> <tr> <td class="wm_print_content" style="border-width: 0px 1px 1px 0px" width="60px"> <?php echo JS_LANG_Subject; ?> : </td> <td class="wm_print_content" style="border-width: 0px 0px 1px 1px"> <?php echo ConvertUtils::WMHtmlSpecialChars($message->PrintSubject(true)); ?> </td> </tr> <tr> <td colspan="2" class="wm_print_content" style="border-width: 1px 0px 0px 0px"> <div class="wm_space_before"> <?php echo $fullBodyText; ?> </div> </td> </tr> </table> </div> </body>
/** * @return string */ function MessageListTr() { $out = ''; if (!$this->messageCollection) { return ''; } $c = $this->messageCollection->Count(); $stylewidth = array(array('', ' style="width: 21px; text-align: center;"'), array('', ' style="width: 20px;"'), array('', ' style="width: 20px;"'), array('', ' style="width: 150px;"'), array('', ' style="width: 140px;"'), array('', ' style="width: 48px;"'), array('', ' style="width: 148px;"')); $atemp_1 = $atemp_2 = ''; if ($this->_proc->account->ViewMode == VIEW_MODE_WITHOUT_PREVIEW_PANE || $this->_proc->account->ViewMode == VIEW_MODE_WITHOUT_PREVIEW_PANE_NO_IMG) { $atemp_1 = '<a href="#">'; $atemp_2 = '</a>'; } for ($i = 0; $i < $c; $i++) { $msg =& $this->messageCollection->Get($i); if (!$msg) { continue; } $isRead = ($msg->Flags & MESSAGEFLAGS_Seen) == MESSAGEFLAGS_Seen ? 'true' : 'false'; $flaggedImg = ''; $handclass = $this->_proc->account->MailProtocol != MAILPROTOCOL_IMAP4 && $this->_proc->currentFolder && $this->_proc->currentFolder->SyncType == FOLDERSYNC_DirectMode ? '' : 'wm_control'; if (($msg->Flags & MESSAGEFLAGS_Flagged) == MESSAGEFLAGS_Flagged) { $isFlagged = 'true'; $flaggedImg = '<img class="' . $handclass . '" src="skins/' . $this->_pagebuilder->SkinName() . '/menu/flag.gif" />'; } else { $isFlagged = 'false'; $flaggedImg = '<img class="' . $handclass . '" src="skins/' . $this->_pagebuilder->SkinName() . '/menu/unflag.gif" />'; } if ($msg->IdFolder == -1 && $this->folder && $this->folder->SyncType == FOLDERSYNC_DirectMode) { $msg->IdFolder = $this->folder->IdDb; } $isForwarded = ($msg->Flags & MESSAGEFLAGS_Forwarded) == MESSAGEFLAGS_Forwarded ? 'true' : 'false'; $isDeleted = ($msg->Flags & MESSAGEFLAGS_Deleted) == MESSAGEFLAGS_Deleted ? 'true' : 'false'; $isGrey = ($msg->Flags & MESSAGEFLAGS_Grayed) == MESSAGEFLAGS_Grayed ? 'true' : 'false'; $isReplied = 'false'; $date =& $msg->GetDate(); $date->FormatString = $this->_proc->account->DefaultDateFormat; $date->TimeFormat = $this->_proc->account->DefaultTimeFormat; $sep = '-----'; $char = $msg->Charset > -1 ? ConvertUtils::GetCodePageName($msg->Charset) : -1; $idString = $msg->IdMsg . $sep . $msg->Uid . $sep . $msg->IdFolder . $sep . $char . $sep; $folderName = $this->folder ? $this->folder->FullName : ''; $this->_pagebuilder->AddInitText('messObj = {Read: ' . $isRead . ', Replied: ' . $isReplied . ', Forwarded: ' . $isForwarded . ', Flagged: ' . $isFlagged . ', Deleted: ' . $isDeleted . ', Gray: ' . $isGrey . ', Id: ' . (int) $msg->IdMsg . ', Uid: "' . ConvertUtils::ClearJavaScriptString($msg->Uid, '"') . '", FolderId: ' . $msg->IdFolder . ', FolderFullName: "' . ConvertUtils::ClearJavaScriptString($folderName, '"') . '", FromAddr: "", Subject: ""}'); $this->_pagebuilder->AddInitText('InboxLines.AddLine(new CSelectionPart(document.getElementById("' . ConvertUtils::ClearJavaScriptString($idString, '"') . '"), "' . $this->_pagebuilder->SkinName() . '" , messObj));'); $from = ConvertUtils::WMHtmlSpecialChars($msg->GetFromAsStringForSend()); $to = ConvertUtils::WMHtmlSpecialChars($msg->GetAllRecipientsEmailsAsString(true)); $subject = ConvertUtils::WMHtmlSpecialChars($msg->GetSubject(true)); if (isset($this->_proc->sArray[SEARCH_ARRAY][S_TEXT]) && strlen($this->_proc->sArray[SEARCH_ARRAY][S_TEXT]) > 0) { $from = preg_replace('/' . preg_quote($this->_proc->sArray[SEARCH_ARRAY][S_TEXT]) . '/i', '<font>$0</font>', $from); $to = preg_replace('/' . preg_quote($this->_proc->sArray[SEARCH_ARRAY][S_TEXT]) . '/i', '<font>$0</font>', $to); $subject = preg_replace('/' . preg_quote($this->_proc->sArray[SEARCH_ARRAY][S_TEXT]) . '/i', '<font>$0</font>', $subject); } $subjectId = $i == 0 ? 'id="subject"' : ''; $out .= ' <tr onclick="CheckThisLine(event, this);" ondblclick="CheckThisLineDb(event, this);" id="' . ConvertUtils::AttributeQuote($idString) . '"> <td' . $stylewidth[0][(int) ($i == 0)] . ' id="none"><input type="checkbox" /></td> <td' . $stylewidth[1][(int) ($i == 0)] . '>'; $out .= (int) $msg->HasAttachments() == 1 ? '<img src="skins/' . $this->_pagebuilder->SkinName() . '/menu/attachment.gif" />' : ''; $out .= '</td><td' . $stylewidth[2][(int) ($i == 0)] . '>' . $flaggedImg; $tempFromTo = $this->folder && $this->folder->ToFolder ? $to : $from; $out .= '</td><td' . $stylewidth[3][(int) ($i == 0)] . ' class="wm_inbox_from_subject"><nobr>' . $atemp_1 . $tempFromTo . $atemp_2 . '</nobr></td> <td' . $stylewidth[4][(int) ($i == 0)] . '><nobr>' . $date->GetFormattedDate($this->_proc->account->GetDefaultTimeOffset()) . '</nobr></td><td' . $stylewidth[5][(int) ($i == 0)] . '><nobr>' . GetFriendlySize($msg->Size) . '</nobr></td> <td' . $stylewidth[6][(int) ($i == 0)] . ' class="wm_inbox_from_subject" ' . $subjectId . '><nobr>' . $atemp_1 . $subject . $atemp_2 . '</nobr></td> </tr>'; } if (isset($this->_proc->sArray[SEARCH_ARRAY]) && isset($this->_proc->sArray[SEARCH_ARRAY][S_TEXT]) && strlen($this->_proc->sArray[SEARCH_ARRAY][S_TEXT]) > 0 && $c == 0) { $out = '<tr><td colspan="6" style="width: 404px;"></td>'; $out .= '<td style="width: 150px;" id="subject"></td></tr> <tr><td colspan="7"><div class="wm_inbox_info_message">' . InfoNoMessagesFound . '</div></td></tr> '; } else { if ($c == 0) { $out = '<tr><td colspan="6" style="width: 404px;"></td>'; $out .= '<td style="width: 150px;" id="subject"></td></tr> <tr><td colspan="7"><div class="wm_inbox_info_message">' . JS_LANG_InfoEmptyFolder . '</div></td></tr> '; } } return $out; }
/** * @return string */ function getError() { return isset($GLOBALS[ErrorDesc]) ? '<br /><font color="red">' . ConvertUtils::WMHtmlSpecialChars(getGlobalError()) . '</font>' : ''; }
function PrintMessagePreview($skin, $isRtlOn, $body, $textCharset, $from, $to, $date, $subject, $attachments = null, $cc = null, $usePrint = false) { $CCTr = $AttachTr = ''; $headLink = $isRtlOn ? '<link rel="stylesheet" href="skins/' . $skin . '/styles-rtl.css" type="text/css" id="skin-rtl">' : ''; $dirTextStyle = ' style="text-align: left;"'; if ($textCharset) { if (strtolower($textCharset) == 'iso-8859-8-i') { $dirTextStyle = ' style="text-align: right;"'; } else { switch (ConvertUtils::GetCodePageNumber($textCharset)) { case 1255: case 1256: case 28596: case 28598: $dirTextStyle = ' style="text-align: right;"'; break; case 65001: if ($isRtlOn) { $dirTextStyle = ' style="text-align: right;"'; } break; } } } if ($cc && strlen($cc) > 0) { $CCTr = ' <tr> <td class="wm_print_title" width="60px"> ' . JS_LANG_CC . ' </td> <td class="wm_print_value"> ' . ConvertUtils::WMHtmlSpecialChars($cc) . ' </td> </tr>'; } if ($attachments && strlen($attachments) > 0) { $AttachTr = ' <tr> <td class="wm_print_title" width="60px"> ' . Attachments . ': </td> <td class="wm_print_value"> ' . $attachments . ' </td> </tr>'; } $usePrintStr = $usePrint ? ' onload="window.print();"' : ''; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> <html> <head> <link rel="shortcut icon" href="favicon.ico" /> <link rel="stylesheet" href="./skins/<?php echo $skin; ?> /styles.css" type="text/css" /> <?php echo $headLink; ?> </head> <body class="wm_body"<?php echo $usePrintStr; ?> > <div align="center" class="wm_space_before"> <table class="wm_print"> <tr> <td class="wm_print_title" width="60px"> <?php echo JS_LANG_From; ?> : </td> <td class="wm_print_value"> <?php echo ConvertUtils::WMHtmlSpecialChars($from); ?> </td> </tr> <tr> <td class="wm_print_title" width="60px"> <?php echo JS_LANG_To; ?> : </td> <td class="wm_print_value"> <?php echo ConvertUtils::WMHtmlSpecialChars($to); ?> </td> </tr> <?php echo $CCTr; ?> <tr> <td class="wm_print_title" width="60px"> <?php echo JS_LANG_Date; ?> : </td> <td class="wm_print_value"> <?php echo ConvertUtils::WMHtmlSpecialChars($date); ?> </td> </tr> <tr> <td class="wm_print_title" width="60px"> <?php echo JS_LANG_Subject; ?> : </td> <td class="wm_print_value"> <?php echo ConvertUtils::WMHtmlSpecialChars($subject); ?> </td> </tr> <?php echo $AttachTr; ?> <tr> <td colspan="2" class="wm_print_body"> <div class="wm_space_before"<?php echo $dirTextStyle; ?> > <?php echo $body; ?> </div> </td> </tr> </table> </div> </body> </html> <?php }
/** * @param PageBuilder $pagebuilder * @param int $contact_id * @param bool $isNew * @return string */ function WriteContactEdit(&$pagebuilder, $contact_id, $isNew = false) { $out = ''; $isCorrect = false; $jsIsNew = $isNew ? 'true' : 'false'; $pagebuilder->AddJSText(' function dolocation(idurl) { var url = document.getElementById(idurl); if (url && url.value.length > 2) { OpenURL(url.value); } } function MessageToMail(email) { if (!email) { return false; } var form = CreateChildWithAttrs(document.body, "form", [["action", "' . BASEFILE . '?' . SCREEN . '=' . SCREEN_NEWOREDIT . '"], ["method", "POST"]]); CreateChildWithAttrs(form, "input", [["type", "hidden"], ["name", "mailto"], ["value", email]]); form.submit(); } function submitContactForm() { var result = false; if (newContact) { result = newContact.SubmitContact(); } if (!result) { alert(Lang.WarningContactNotComplete); } return result; } function DoCancle() { if (' . $jsIsNew . ') { document.location = "' . BASEFILE . '?' . SCREEN . '=' . SCREEN_CONTACTS . '"; } else { document.location = "' . BASEFILE . '?' . SCREEN . '=' . SCREEN_CONTACTS . '&' . CONTACT_MODE . '=' . C_VIEW . '&' . CONTACT_ID . '=' . $contact_id . '"; } } '); if ($isNew) { $contact = new AddressBookRecord(); $contact->PrimaryEmail = 0; $groupsArray = array(); if (Post::val('cdata') == 1) { $contact->FullName = Post::val('cfullname', ''); $contact->HomeEmail = Post::val('cemail', ''); } } else { $contact =& $pagebuilder->_proc->db->SelectAddressBookRecord($contact_id); $groupsArray =& $pagebuilder->_proc->db->SelectAddressGroupContact($contact_id); } $allGroups =& $pagebuilder->_proc->db->SelectUserAddressGroupNames(); $skinName = $pagebuilder->SkinName(); if ($contact && is_object($contact)) { $isCorrect = true; } if ($isCorrect) { $pagebuilder->AddInitText($contact->isOpen() ? 'var isOpenContact = true;' : 'var isOpenContact = false;'); $data = array(); $data = @get_object_vars($contact); foreach ($data as $key => $value) { $data[$key] = $value && strlen($value) > 0 ? array('', $value) : array(' class="wm_hide"', ''); } $Birthday[0] = $data['BirthdayDay'][1] || $data['BirthdayMonth'][1] || $data['BirthdayYear'][1] ? '' : ' class="wm_hide"'; $Birthday[1] = GetBirthDay($data['BirthdayDay'][1], $data['BirthdayMonth'][1], $data['BirthdayYear'][1]); $Email = array('', ''); switch ($contact->PrimaryEmail) { case PRIMARYEMAIL_Home: $Email[1] = $contact->HomeEmail; break; case PRIMARYEMAIL_Business: $Email[1] = $contact->BusinessEmail; break; case PRIMARYEMAIL_Other: $Email[1] = $contact->OtherEmail; break; } $Email[0] = $Email[1] ? '' : ' class="wm_hide"'; $class_00 = $data['HomeEmail'][1] || $data['HomeStreet'][1] || $data['HomeCity'][1] || $data['HomeFax'][1] || $data['HomeState'][1] || $data['HomePhone'][1] || $data['HomeZip'][1] || $data['HomeMobile'][1] || $data['HomeCountry'][1] || $data['HomeWeb'][1]; $class_00 = $class_00 ? ' class="wm_contacts_view"' : ' class="wm_hide"'; $class_01 = $data['HomeCity'][1] || $data['HomeFax'][1] ? '' : ' class="wm_hide"'; $data['HomeCity'][0] = $data['HomeCity'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['HomeCity'][2] = $data['HomeCity'][1] != '' ? '' : ' class="wm_hide"'; $data['HomeFax'][0] = $data['HomeFax'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['HomeFax'][2] = $data['HomeFax'][1] != '' ? '' : ' class="wm_hide"'; $class_02 = $data['HomeState'][1] || $data['HomePhone'][1] ? '' : ' class="wm_hide"'; $data['HomeState'][0] = $data['HomeState'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['HomeState'][2] = $data['HomeState'][1] != '' ? '' : ' class="wm_hide"'; $data['HomePhone'][0] = $data['HomePhone'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['HomePhone'][2] = $data['HomePhone'][1] != '' ? '' : ' class="wm_hide"'; $class_03 = $data['HomeZip'][1] || $data['HomeMobile'][1] ? '' : ' class="wm_hide"'; $data['HomeZip'][0] = $data['HomeZip'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['HomeZip'][2] = $data['HomeZip'][1] != '' ? '' : ' class="wm_hide"'; $data['HomeMobile'][0] = $data['HomeMobile'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['HomeMobile'][2] = $data['HomeMobile'][1] != '' ? '' : ' class="wm_hide"'; $class_10 = $data['BusinessCompany'][1] || $data['BusinessJobTitle'][1] || $data['BusinessDepartment'][1] || $data['BusinessOffice'][1] || $data['BusinessCity'][1] || $data['BusinessFax'][1] || $data['BusinessState'][1] || $data['BusinessPhone'][1] || $data['BusinessZip'][1] || $data['BusinessCountry'][1] || $data['BusinessEmail'][1] || $data['BusinessStreet'][1] || $data['BusinessWeb'][1]; $class_10 = $class_10 ? ' class="wm_contacts_view"' : ' class="wm_hide"'; $class_11 = $data['BusinessCompany'][1] || $data['BusinessJobTitle'][1] ? '' : ' class="wm_hide"'; $data['BusinessCompany'][0] = $data['BusinessCompany'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessCompany'][2] = $data['BusinessCompany'][1] != '' ? '' : ' class="wm_hide"'; $data['BusinessJobTitle'][0] = $data['BusinessJobTitle'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessJobTitle'][2] = $data['BusinessJobTitle'][1] != '' ? '' : ' class="wm_hide"'; $class_12 = $data['BusinessDepartment'][1] || $data['BusinessOffice'][1] ? '' : ' class="wm_hide"'; $data['BusinessDepartment'][0] = $data['BusinessDepartment'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessDepartment'][2] = $data['BusinessDepartment'][1] != '' ? '' : ' class="wm_hide"'; $data['BusinessOffice'][0] = $data['BusinessOffice'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessOffice'][2] = $data['BusinessOffice'][1] != '' ? '' : ' class="wm_hide"'; $class_13 = $data['BusinessCity'][1] || $data['BusinessFax'][1] ? '' : ' class="wm_hide"'; $data['BusinessCity'][0] = $data['BusinessCity'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessCity'][2] = $data['BusinessCity'][1] != '' ? '' : ' class="wm_hide"'; $data['BusinessFax'][0] = $data['BusinessFax'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessFax'][2] = $data['BusinessFax'][1] != '' ? '' : ' class="wm_hide"'; $class_14 = $data['BusinessState'][1] || $data['BusinessPhone'][1] ? '' : ' class="wm_hide"'; $data['BusinessState'][0] = $data['BusinessState'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessState'][2] = $data['BusinessState'][1] != '' ? '' : ' class="wm_hide"'; $data['BusinessPhone'][0] = $data['BusinessPhone'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessPhone'][2] = $data['BusinessPhone'][1] != '' ? '' : ' class="wm_hide"'; $class_15 = $data['BusinessZip'][1] || $data['BusinessCountry'][1] ? '' : ' class="wm_hide"'; $data['BusinessZip'][0] = $data['BusinessZip'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessZip'][2] = $data['BusinessZip'][1] != '' ? '' : ' class="wm_hide"'; $data['BusinessCountry'][0] = $data['BusinessCountry'][1] != '' ? ' class="wm_contacts_view_title"' : ' class="wm_hide"'; $data['BusinessCountry'][2] = $data['BusinessCountry'][1] != '' ? '' : ' class="wm_hide"'; $class_20 = $data['OtherEmail'][1] || $data['Notes'][1] || $Birthday[1]; $class_20 = $class_20 ? ' class="wm_contacts_view"' : ' class="wm_hide"'; $daysSelect = ''; for ($i = 1; $i < 32; $i++) { $daysSelect .= $data['BirthdayDay'][1] == $i ? '<option value="' . $i . '" selected="selected">' . $i . '</option>' . "\r\n" : '<option value="' . $i . '">' . $i . '</option>' . "\r\n"; } $selectedArray = array('', '', '', '', '', '', '', '', '', '', '', '', '', ''); if (isset($data['BirthdayMonth'][1]) && $data['BirthdayMonth'][1] > 0 && $data['BirthdayMonth'][1] < 13) { $selectedArray[(int) $data['BirthdayMonth'][1]] = ' selected="selected"'; } $monthsSelect = '<option value="1"' . $selectedArray[1] . '>' . JS_LANG_January . '</option> <option value="2"' . $selectedArray[2] . '>' . JS_LANG_February . '</option> <option value="3"' . $selectedArray[3] . '>' . JS_LANG_March . '</option> <option value="4"' . $selectedArray[4] . '>' . JS_LANG_April . '</option> <option value="5"' . $selectedArray[5] . '>' . JS_LANG_May . '</option> <option value="6"' . $selectedArray[6] . '>' . JS_LANG_June . '</option> <option value="7"' . $selectedArray[7] . '>' . JS_LANG_July . '</option> <option value="8"' . $selectedArray[8] . '>' . JS_LANG_August . '</option> <option value="9"' . $selectedArray[9] . '>' . JS_LANG_September . '</option> <option value="10"' . $selectedArray[10] . '>' . JS_LANG_October . '</option> <option value="11"' . $selectedArray[11] . '>' . JS_LANG_November . '</option> <option value="12"' . $selectedArray[12] . '>' . JS_LANG_December . '</option>'; $yearsSelect = ''; $lastyear = (int) date('Y', time()) > 1900 ? (int) date('Y', time()) : 2008; for ($i = $lastyear; $i > 1899; $i--) { $yearsSelect .= $data['BirthdayYear'][1] == $i ? '<option value="' . $i . '" selected="selected">' . $i . '</option>' . "\r\n" : '<option value="' . $i . '">' . $i . '</option>' . "\r\n"; } $groupsHtml = ''; if ($groupsArray && count($groupsArray) > 0) { $groupsHtml = '<table class="wm_contacts_view"> <tr> <td class="wm_contacts_view_title wm_contacts_section_name">' . JS_LANG_Groups . ':</td>'; $k = 0; $cnt = count($groupsArray); foreach ($groupsArray as $key => $value) { $k++; $tempstr = $cnt > $k ? ',' : ''; $groupsHtml .= '<td class="wm_contacts_groups"><a href="' . BASEFILE . '?' . CONTACT_MODE . '=' . G_VIEW . '&' . CONTACT_ID . '=' . $key . '">' . $value . '</a>' . $tempstr . '</td>' . "\r\n"; } $groupsHtml .= '</tr></table>'; } $groupsHtml2 = ''; if (count($allGroups) > 0) { $groupsHtml2 = ' <table class="wm_contacts_tab" onclick="ChangeTabVisibility(\'street_addresses\');"> <tr> <td> <span class="wm_contacts_tab_name"> ' . JS_LANG_Groups . ' </span> <span class="wm_contacts_tab_mode"> <img id="button_street_addresses" src="skins/' . $skinName . '/menu/arrow_down.gif" /> </span> </td> </tr> </table> <table class="wm_hide" id="street_addresses"> <tr><td>'; foreach ($allGroups as $id => $name) { $inGroup = key_exists($id, $groupsArray); $inGroup = $inGroup ? 'checked="checked"' : ''; $groupsHtml2 .= '<input id="inp_g_' . $id . '" class="wm_checkbox" ' . $inGroup . ' type="checkbox" value="' . $id . '" name="groupsIds[]"/> <label for="inp_g_' . $id . '">' . $name . '</label><br />'; } $groupsHtml2 .= ' </td></tr> </table>'; } $useFrName = $contact->UseFriendlyName || $isNew ? ' checked="checked"' : ''; $isNewHidden = $isNew ? '1' : '0'; $out .= '<form action="' . ACTIONFILE . '?action=update&req=contact" method="POST" onsubmit="return submitContactForm()"> <input type="hidden" name="isNewContact" value="' . $isNewHidden . '" /> <input type="hidden" name="contactId" value="' . $contact_id . '" /> <div id="viewTbl"> <table class="wm_contacts_view"> <tr' . $data['FullName'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_Name . ':</td> <td class="wm_contacts_name">' . ConvertUtils::WMHtmlSpecialChars($data['FullName'][1]) . '</td> </tr> <tr' . $Email[0] . '> <td class="wm_contacts_view_title">' . JS_LANG_Email . ':</td> <td class="wm_contacts_email"><a href="#" onclick="return MessageToMail(\'' . ConvertUtils::AttributeQuote(ConvertUtils::ClearJavaScriptString(ConvertUtils::WMHtmlSpecialChars($Email[1]), '\'')) . '\')">' . ConvertUtils::WMHtmlSpecialChars($Email[1]) . '</a></td> </tr> </table> <table' . $class_00 . '> <tr> <td class="wm_contacts_section_name" colspan="4">' . JS_LANG_Home . '</td> </tr> <tr' . $data['HomeEmail'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_PersonalEmail . ':</td> <td colspan="3"> <a href="#" onclick="return MessageToMail(\'' . ConvertUtils::AttributeQuote(ConvertUtils::ClearJavaScriptString(ConvertUtils::WMHtmlSpecialChars($data['HomeEmail'][1]), '\'')) . '\')">' . ConvertUtils::WMHtmlSpecialChars($data['HomeEmail'][1]) . '</a> </td> </tr> <tr' . $data['HomeStreet'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_StreetAddress . ':</td> <td colspan="3">' . ConvertUtils::WMHtmlSpecialChars($data['HomeStreet'][1]) . '</td> </tr> <tr' . $class_01 . '> <td' . $data['HomeCity'][0] . '>' . JS_LANG_City . ':</td> <td' . $data['HomeCity'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['HomeCity'][1]) . '</td> <td' . $data['HomeFax'][0] . '>' . JS_LANG_Fax . ':</td> <td' . $data['HomeFax'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['HomeFax'][1]) . '</td> </tr> <tr' . $class_02 . '> <td' . $data['HomeState'][0] . '>' . JS_LANG_StateProvince . ':</td> <td' . $data['HomeState'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['HomeState'][1]) . '</td> <td' . $data['HomePhone'][0] . '>' . JS_LANG_Phone . ':</td> <td' . $data['HomePhone'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['HomePhone'][1]) . '</td> </tr> <tr' . $class_03 . '> <td' . $data['HomeZip'][0] . '>' . JS_LANG_ZipCode . ':</td> <td' . $data['HomeZip'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['HomeZip'][1]) . '</td> <td' . $data['HomeMobile'][0] . '>' . JS_LANG_Mobile . ':</td> <td' . $data['HomeMobile'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['HomeMobile'][1]) . '</td> </tr> <tr' . $data['HomeCountry'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_CountryRegion . ':</td> <td colspan="3"> ' . ConvertUtils::WMHtmlSpecialChars($data['HomeCountry'][1]) . ' </td> </tr> <tr' . $data['HomeWeb'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_WebPage . ':</td> <td colspan="3"> ' . ConvertUtils::WMHtmlSpecialChars($data['HomeWeb'][1]) . ' </td> </tr> </table> <table' . $class_10 . '> <tr> <td class="wm_contacts_section_name" colspan="4">' . JS_LANG_Business . '</td> </tr> <tr' . $data['BusinessEmail'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_BusinessEmail . ':</td> <td colspan="3"> <a href="#" onclick="return MessageToMail(\'' . ConvertUtils::AttributeQuote(ConvertUtils::ClearJavaScriptString(ConvertUtils::WMHtmlSpecialChars($data['BusinessEmail'][1]), '\'')) . '\')">' . ConvertUtils::WMHtmlSpecialChars($data['BusinessEmail'][1]) . '</a> </td> </tr> <tr' . $class_11 . '> <td' . $data['BusinessCompany'][0] . '>' . JS_LANG_Company . ':</td> <td' . $data['BusinessCompany'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessCompany'][1]) . '</td> <td' . $data['BusinessJobTitle'][0] . '">' . JS_LANG_JobTitle . ':</td> <td' . $data['BusinessJobTitle'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessJobTitle'][1]) . '</td> </tr> <tr' . $class_12 . '> <td' . $data['BusinessDepartment'][0] . '>' . JS_LANG_Department . ':</td> <td' . $data['BusinessDepartment'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessDepartment'][1]) . '</td> <td' . $data['BusinessOffice'][0] . '>' . JS_LANG_Office . ':</td> <td' . $data['BusinessOffice'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessOffice'][1]) . '</td> </tr> <tr' . $data['BusinessStreet'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_StreetAddress . ':</td> <td colspan="3">' . ConvertUtils::WMHtmlSpecialChars($data['BusinessStreet'][1]) . '</td> </tr> <tr' . $class_13 . '> <td' . $data['BusinessCity'][0] . '>' . JS_LANG_City . ':</td> <td' . $data['BusinessCity'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessCity'][1]) . '</td> <td' . $data['BusinessFax'][0] . '>' . JS_LANG_Fax . ':</td> <td' . $data['BusinessFax'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessFax'][1]) . '</td> </tr> <tr' . $class_14 . '> <td' . $data['BusinessState'][0] . '>' . JS_LANG_StateProvince . ':</td> <td' . $data['BusinessState'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessState'][1]) . '</td> <td' . $data['BusinessPhone'][0] . '>' . JS_LANG_Phone . ':</td> <td' . $data['BusinessPhone'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessPhone'][1]) . '</td> </tr> <tr' . $class_15 . '> <td' . $data['BusinessZip'][0] . '>' . JS_LANG_ZipCode . ':</td> <td' . $data['BusinessZip'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessZip'][1]) . '</td> <td' . $data['BusinessCountry'][0] . '>' . JS_LANG_CountryRegion . ':</td> <td' . $data['BusinessCountry'][2] . '>' . ConvertUtils::WMHtmlSpecialChars($data['BusinessCountry'][1]) . '</td> </tr> <tr' . $data['BusinessWeb'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_WebPage . ':</td> <td colspan="3"> ' . ConvertUtils::WMHtmlSpecialChars($data['BusinessWeb'][1]) . ' </td> </tr> </table> <table' . $class_20 . '> <tr> <td class="wm_contacts_section_name" colspan="2">' . JS_LANG_Other . '</td> </tr> <tr' . $Birthday[0] . '> <td class="wm_contacts_view_title">' . JS_LANG_Birthday . ':</td> <td>' . $Birthday[1] . '</td> </tr> <tr' . $data['OtherEmail'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_OtherEmail . ':</td> <td><a href="#" onclick="return MessageToMail(\'' . ConvertUtils::AttributeQuote(ConvertUtils::ClearJavaScriptString(ConvertUtils::WMHtmlSpecialChars($data['OtherEmail'][1]), '\'')) . '\')">' . ConvertUtils::WMHtmlSpecialChars($data['OtherEmail'][1]) . '</a></td> </tr> <tr' . $data['Notes'][0] . '> <td class="wm_contacts_view_title">' . JS_LANG_Notes . ':</td> <td>' . ConvertUtils::WMHtmlSpecialChars($data['Notes'][1]) . '</td> </tr> </table> ' . $groupsHtml . ' <table class="wm_contacts_view"> <tr> <td> <a href="#" id="switch_to_edit">' . JS_LANG_EditContact . '</a> </td> </tr> </table> </div> <!-- --> <div id="editTbl" class="wm_hide"> <table class="wm_contacts_view"> <tr> <td class="wm_contacts_view_title" style="width: 25%;">' . JS_LANG_DefaultEmail . ':</td> <td style="width: 75%;"> <span id="notSpecified" class="wm_hide">' . JS_LANG_NotSpecifiedYet . '</span> <select id="select_default_email" class="wm_hide" style="width: 200px;"></select> <input id="input_default_email" name="input_default_email" type="text" value="' . ConvertUtils::AttributeQuote($Email[1]) . '" class="wm_input" maxlength="255"/> <input id="default_email_type" type="hidden" name="default_email_type" value="' . ConvertUtils::AttributeQuote($contact->PrimaryEmail) . '" /> </td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 25%;">' . JS_LANG_Name . ':</td> <td> <input class="wm_input" type="text" name="c_fullname" value="' . ConvertUtils::AttributeQuote($data['FullName'][1]) . '" id="c_fullname" maxlength="85" /></td> </tr> <tr> <td></td> <td> <input class="wm_checkbox" type="checkbox" name="use_friendly_name" id="use_friendly_name" value="1" ' . $useFrName . '> <label for="use_friendly_name">' . JS_LANG_UseFriendlyName1 . '</label><label class="wm_secondary_info wm_inline_info" for="use_friendly_name">' . JS_LANG_UseFriendlyName2 . '</label> </td> </tr> </table> <div class="wm_hide" id="more_info_div"> <table class="wm_contacts_view" style="width: 94%; margin: 0px 15px 2px 15px;"> <tr> <td style="text-align: right; border-top: solid 1px #8D8C89;"> <a href="" id="more_info_hide">' . JS_LANG_HideAddFields . '</a> </td> </tr> </table> <table class="wm_contacts_tab" onclick="ChangeTabVisibility(\'access\');"> <tr> <td> <span class="wm_contacts_tab_name"> ' . JS_LANG_Home . ' </span> <span class="wm_contacts_tab_mode"> <img id="button_access" src="skins/' . $skinName . '/menu/arrow_up.gif"> </span> </td> </tr> </table> <table ' . $class_00 . ' id="access"> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_PersonalEmail . ':</td> <td style="width: 80%;" colspan="4"><input autocomplete="off" class="wm_input" type="text" size="45" id="personal_email" name="personal_email" value="' . ConvertUtils::AttributeQuote($data['HomeEmail'][1]) . '" maxlength="255" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_StreetAddress . ':</td> <td colspan="4"><textarea class="wm_input" rows="2" cols="35" name="personal_street" rows="4">' . $data['HomeStreet'][1] . '</textarea></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_City . ':</td> <td style="width: 30%;"><input class="wm_input" type="text" size="18" name="personal_city" value="' . ConvertUtils::AttributeQuote($data['HomeCity'][1]) . '" maxlength="65" /></td> <td style="width: 10%;"></td> <td class="wm_contacts_view_title" style="width: 10%;">' . JS_LANG_Fax . ':</td> <td style="width: 30%;"><input class="wm_input" type="text" size="18" name="personal_fax" value="' . ConvertUtils::AttributeQuote($data['HomeFax'][1]) . '" maxlength="50"/></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_StateProvince . ':</td> <td><input class="wm_input" type="text" size="18" name="personal_state" value="' . ConvertUtils::AttributeQuote($data['HomeState'][1]) . '" maxlength="65" /></td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_Phone . ':</td> <td><input class="wm_input" type="text" size="18" name="personal_phone" value="' . ConvertUtils::AttributeQuote($data['HomePhone'][1]) . '" maxlength="50" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_ZipCode . ':</td> <td><input class="wm_input" type="text" size="18" name="personal_zip" value="' . ConvertUtils::AttributeQuote($data['HomeZip'][1]) . '" maxlength="10" /></td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_Mobile . ':</td> <td><input class="wm_input" type="text" size="18" name="personal_mobile" value="' . ConvertUtils::AttributeQuote($data['HomeMobile'][1]) . '" maxlength="50" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_CountryRegion . ':</td> <td colspan="4"><input class="wm_input" type="text" size="18" name="personal_country" value="' . ConvertUtils::AttributeQuote($data['HomeCountry'][1]) . '" maxlength="65" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_WebPage . ':</td> <td colspan="4"> <input class="wm_input" type="text" size="45" name="personal_web" id="personal_web" value="' . ConvertUtils::AttributeQuote($data['HomeWeb'][1]) . '" maxlength="255" /> <input class="wm_button" type="button" value="' . ConvertUtils::AttributeQuote(JS_LANG_Go) . '" onClick="dolocation(\'personal_web\');" /> </td> </tr> </table> <table class="wm_contacts_tab" onclick="ChangeTabVisibility(\'online_addresses\');"> <tr> <td> <span class="wm_contacts_tab_name"> ' . JS_LANG_Business . ' </span> <span class="wm_contacts_tab_mode"> <img id="button_online_addresses" src="skins/' . $skinName . '/menu/arrow_down.gif"> </span> </td> </tr> </table> <table ' . $class_10 . ' id="online_addresses"> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_BusinessEmail . ':</td> <td style="width: 80%;" colspan="4"><input class="wm_input" autocomplete="off" type="text" id="business_email" name="business_email" size="45" value="' . ConvertUtils::AttributeQuote($data['BusinessEmail'][1]) . '" maxlength="255" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_Company . ':</td> <td style="width: 30%;"><input class="wm_input" type="text" size="18" name="business_company" value="' . ConvertUtils::AttributeQuote($data['BusinessCompany'][1]) . '" maxlength="65" /></td> <td style="width: 5%;"></td> <td class="wm_contacts_view_title" style="width: 15%;">' . JS_LANG_JobTitle . ':</td> <td style="width: 30%;"><input class="wm_input" type="text" size="18" name="business_job" value="' . ConvertUtils::AttributeQuote($data['BusinessJobTitle'][1]) . '" maxlength="30" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_Department . ':</td> <td><input class="wm_input" type="text" size="18" name="business_departament" value="' . ConvertUtils::AttributeQuote($data['BusinessDepartment'][1]) . '" maxlength="65" /></td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_Office . ':</td> <td><input class="wm_input" type="text" size="18" name="business_office" value="' . ConvertUtils::AttributeQuote($data['BusinessOffice'][1]) . '" maxlength="65" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_StreetAddress . ':</td> <td colspan="4"><textarea rows="2" class="wm_input" cols="35" name="business_street" rows="4">' . $data['BusinessStreet'][1] . '</textarea></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_City . ':</td> <td><input class="wm_input" type="text" size="18" name="business_city" value="' . ConvertUtils::AttributeQuote($data['BusinessCity'][1]) . '" maxlength="65" /></td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_Fax . ':</td> <td><input class="wm_input" type="text" size="18" name="business_fax" value="' . ConvertUtils::AttributeQuote($data['BusinessFax'][1]) . '" maxlength="50" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_StateProvince . ':</td> <td><input class="wm_input" type="text" size="18" name="business_state" value="' . ConvertUtils::AttributeQuote($data['BusinessState'][1]) . '" maxlength="65" /></td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_Phone . ':</td> <td><input class="wm_input" type="text" size="18" name="business_phone" value="' . ConvertUtils::AttributeQuote($data['BusinessPhone'][1]) . '" maxlength="50" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_ZipCode . ':</td> <td><input class="wm_input" type="text" size="18" name="business_zip" value="' . ConvertUtils::AttributeQuote($data['BusinessZip'][1]) . '" maxlength="10" /></td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_CountryRegion . ':</td> <td colspan="4"><input class="wm_input" type="text" name="business_country" size="18" value="' . ConvertUtils::AttributeQuote($data['BusinessCountry'][1]) . '" maxlength="65" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_WebPage . ':</td> <td colspan="4"> <input class="wm_input" type="text" size="45" id="business_web" name="business_web" value="' . ConvertUtils::AttributeQuote($data['BusinessWeb'][1]) . '" maxlength="255" /> <input class="wm_button" type="button" value="' . ConvertUtils::AttributeQuote(JS_LANG_Go) . '" onClick="dolocation(\'business_web\');" /> </td> </tr> </table> <table class="wm_contacts_tab" onclick="ChangeTabVisibility(\'phone_numbers\');"> <tr> <td> <span class="wm_contacts_tab_name"> ' . JS_LANG_Other . ' </span> <span class="wm_contacts_tab_mode"> <img id="button_phone_numbers" src="skins/' . $skinName . '/menu/arrow_down.gif"> </span> </td> </tr> </table> <table ' . $class_20 . ' id="phone_numbers"> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_Birthday . ':</td> <td> <select name="birthday_month"> <option value="0">' . JS_LANG_Month . '</option> ' . $monthsSelect . ' </select> <select name="birthday_day"> <option value="0">' . JS_LANG_Day . '</option> ' . $daysSelect . ' </select> <select name="birthday_year"> <option value="0">' . JS_LANG_Year . '</option> ' . $yearsSelect . ' </select> </td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_OtherEmail . ':</td> <td style="width: 80%;"><input class="wm_input" autocomplete="off" id="other_email" name="other_email" type="text" size="45" value="' . ConvertUtils::AttributeQuote($data['OtherEmail'][1]) . '" maxlength="255" /></td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_Notes . ':</td> <td><textarea rows="2" class="wm_input" cols="35" rows="4" name="other_notes">' . $data['Notes'][1] . '</textarea></td> </tr> </table> ' . $groupsHtml2 . ' </div> <table class="wm_contacts_view" style="width: 94%; margin: 0px 15px 2px 15px;"> <tr> <td style="text-align: right;"> <a href="" id="more_info_show">' . JS_LANG_ShowAddFields . '</a> </td> </tr> <tr> <td style="text-align: right; border-top: solid 1px #8D8C89;"> <input type="submit" class="wm_button" value="' . ConvertUtils::AttributeQuote(JS_LANG_Save) . '" /> <input type="button" class="wm_button" name="cancle" value="' . ConvertUtils::AttributeQuote(JS_LANG_Cancel) . '" ID="Cancel" onclick="DoCancle();" /> </td> </tr> </table> </div></form>'; } else { $out = ''; } return $out; }
/** * @param PageBuilder $pagebuilder * @return ContactsList */ function ContactsViewer(&$pagebuilder) { $this->_pagebuilder =& $pagebuilder; $this->_proc =& $pagebuilder->_proc; $this->_pagebuilder->AddInitText(' selection = new CContactsSelection(); selection.FillContacts(); '); $this->text = ''; switch (Get::val(CONTACT_MODE, C_NONE)) { case C_IMPORT: $this->_pagebuilder->AddJSText(' function ImportContactsHandler(code, count) { switch (code) { case 0: InfoPanel.SetInfo(Lang.ErrorImportContacts); InfoPanel.Class("wm_error_information"); InfoPanel.Show(); InfoPanel.Resize(); break; case 1: document.location = "' . BASEFILE . '"; break; case 2: InfoPanel.SetInfo(Lang.ErrorNoContacts); InfoPanel.Class("wm_error_information"); InfoPanel.Show(); InfoPanel.Resize(); break; case 3: InfoPanel.SetInfo(Lang.ErrorInvalidCSV); InfoPanel.Class("wm_error_information"); InfoPanel.Show(); InfoPanel.Resize(); break; } } function submitForm() { var app1 = document.getElementById("app1"); var app2 = document.getElementById("app2"); var fileField = document.getElementById("fileField"); if (app1 && app2 && app1.checked == false && app2.checked == false) { alert(Lang.WarningImportFileType); return false; } if (fileField) { if (Trim(fileField.value).length < 1) { alert(Lang.WarningEmptyImportFile); return false; } else { if (GetExtension(fileField.value) != "csv") { alert(Lang.WarningCsvExtention); return false; } } } return true; } '); $this->text .= ' <div class="wm_contacts_view_edit" id="contacts_viewer"> <div id="contacts_viewer_div"> <table class="wm_contacts_card" id="wm_contacts_card"> <tr> <td class="wm_contacts_card_top_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_top"></td> <td class="wm_contacts_card_top_right"><div class="wm_contacts_card_corner"></div></td> </tr> <tr> <td class="wm_contacts_card_left"></td> <td>'; $this->text .= '<table class="wm_contacts_view"> <tr> <td><b>' . JS_LANG_UseImportTo . '</b></td> </tr> <tr> <td> <input type="radio" class="wm_checkbox" name="app" id="app1" value="1" /> <label for="app1">' . JS_LANG_Outlook1 . '</label><br /> <input type="radio" class="wm_checkbox" name="app" id="app2" value="2" /> <label for="app2">' . JS_LANG_Outlook2 . '</label><br /> </td> </tr> <tr> <td> ' . JS_LANG_SelectImportFile . ': </td> </tr> <tr> <td> <form target="importIframe" enctype="multipart/form-data" method="post" action="import.php" onsubmit="return submitForm()"> <iframe class="wm_hide" name="importIframe" id="importIframe"></iframe> <input class="wm_file" type="file" name="fileupload" size="30" value="" id="fileField" /> </td> </tr> </table> <table class="wm_contacts_view" style="width: 90%;"> <tr> <td style="text-align: right; border-top: solid 1px #8D8C89;"> <input type="submit" class="wm_button" value="' . ConvertUtils::AttributeQuote(JS_LANG_Import) . '" /> </form> </td> </tr> </table>'; $this->text .= '</td> <td class="wm_contacts_card_right"></td> </tr> <tr> <td class="wm_contacts_card_bottom_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_bottom"></td> <td class="wm_contacts_card_bottom_right"><div class="wm_contacts_card_corner"></div></td> </tr> </table> </div> </div> </div>'; break; case G_NEW: $this->_pagebuilder->AddInitText(' OrgTab = document.getElementById("orgTab"); OrgTabImg = document.getElementById("orgTabImg"); OrgTable = document.getElementById("orgTable"); OrgCheckBox = document.getElementById("isorganization"); OrgDiv = document.getElementById("orgDiv"); ShowHideOrgDiv(); ShowHideOrgForm(); '); $this->_pagebuilder->AddJSText(' var OrgTab, OrgTable, OrgCheckBox, OrgDiv; var isOrg = false; function ShowHideOrgDiv() { if (!OrgDiv || !OrgCheckBox) { return false; } OrgDiv.className = (OrgCheckBox.checked == true) ? "" : "wm_hide"; ResizeElements("all"); } function dolocation(idurl) { var url = document.getElementById(idurl); if (url && url.value.length > 2) { OpenURL(url.value); } } function ShowHideOrgForm() { if (isOrg) { OrgTable.className = "wm_hide"; OrgTabImg.src="skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_down.gif"; } else { OrgTable.className = "wm_contacts_view"; OrgTabImg.src="skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_up.gif"; } isOrg = !isOrg; ResizeElements("all"); } function submitForm() { var groupnameField = document.getElementById("groupname"); if (groupnameField && Trim(groupnameField.value).length < 1) { alert(Lang.WarningGroupNotComplete); return false; } return true; } '); $this->text .= ' <div class="wm_contacts_view_edit" id= "contacts_viewer"> <div id="contacts_viewer_div"> <table class="wm_contacts_card" id="wm_contacts_card"> <tr> <td class="wm_contacts_card_top_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_top"></td> <td class="wm_contacts_card_top_right"><div class="wm_contacts_card_corner"></div></td> </tr> <tr> <td class="wm_contacts_card_left"></td> <td>'; $this->text .= ' <form action="' . ACTIONFILE . '?action=new&req=group" method="POST" onsubmit="return submitForm()"> <table class="wm_contacts_view"> <tr> <td>' . JS_LANG_GroupName . ':</td> <td> <input type="text" name="groupname" id="groupname" class="wm_input wm_group_name_input" maxlength="85" /> </td> </tr> <tr> <td colspan="2"> <input type="checkbox" class="wm_checkbox" name="isorganization" id="isorganization" class="wm_input" onclick="ShowHideOrgDiv()"/> <label for="isorganization">' . TreatAsOrganization . '</label> </td> </tr> </table> <div id="orgDiv"> <table class="wm_contacts_tab" style="margin-top: 20px;" id="orgTab"> <tr onclick="ShowHideOrgForm()"> <td> <span class="wm_contacts_tab_name">' . Organization . '</span> <span class="wm_contacts_tab_mode"> <img id="orgTabImg" src="skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_up.gif"/> </span> </td> </tr> </table> <table class="wm_contacts_view" id="orgTable"> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_Email . ':</td> <td style="width: 80%;" colspan="4"> <input class="wm_input" type="text" maxlength="255" size="45" name="gemail"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_Company . ':</td> <td colspan="4"> <input class="wm_input" type="text" maxlength="65" size="18" name="gcompany"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_StreetAddress . ':</td> <td colspan="4"> <textarea class="wm_input" rows="2" cols="35" name="gstreet"></textarea> </td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_City . ':</td> <td style="width: 30%;"> <input class="wm_input" type="text" maxlength="65" size="18" name="gcity"/> </td> <td style="width: 5%;"></td> <td class="wm_contacts_view_title" style="width: 15%;">' . JS_LANG_Fax . ':</td> <td style="width: 30%;"> <input class="wm_input" type="text" maxlength="50" size="18" name="gfax"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_StateProvince . ':</td> <td> <input class="wm_input" type="text" maxlength="65" size="18" name="gstate"/> </td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_Phone . ':</td> <td> <input class="wm_input" type="text" maxlength="50" size="18" name="gphone"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_ZipCode . ':</td> <td> <input class="wm_input" type="text" maxlength="10" size="18" name="gzip"/> </td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_CountryRegion . ':</td> <td> <input class="wm_input" type="text" maxlength="65" size="18" name="gcountry"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_WebPage . ':</td> <td colspan="4"> <input class="wm_input" type="text" maxlength="255" size="45" name="gweb" id="gweb"/> <input class="wm_button" type="button" value="' . ConvertUtils::AttributeQuote(JS_LANG_Go) . '" onclick="dolocation(\'gweb\');"/> </td> </tr> </table> </div> <table class="wm_contacts_view wm_add_contacts"> <tr> <td> ' . JS_LANG_AddContacts . ': </td> </tr> <tr> <td class="wm_secondary_info"> <textarea name="contactsEmails" rows="2" style="width: 100%; height: 70px;"></textarea> ' . JS_LANG_CommentAddContacts . ' </td> </tr> </table> <table class="wm_contacts_view" style="width: 90%;"> <tr> <td class="wm_contacts_save_button"> <input type="submit" class="wm_button" value="' . ConvertUtils::AttributeQuote(JS_LANG_CreateGroup) . '" /> </td> </tr> </table> </form> '; $this->text .= '</td> <td class="wm_contacts_card_right"></td> </tr> <tr> <td class="wm_contacts_card_bottom_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_bottom"></td> <td class="wm_contacts_card_bottom_right"><div class="wm_contacts_card_corner"></div></td> </tr> </table> </div> </div> </div>'; break; case G_VIEW: $this->_pagebuilder->AddInitText(' OrgTab = document.getElementById("orgTab"); OrgTabImg = document.getElementById("orgTabImg"); OrgTable = document.getElementById("orgTable"); OrgCheckBox = document.getElementById("isorganization"); OrgDiv = document.getElementById("orgDiv"); ShowHideOrgDiv(); ShowHideOrgForm(); '); $this->_pagebuilder->AddJSText(' var OrgTab, OrgTable, OrgCheckBox, OrgDiv; var isOrg = false; function ShowHideOrgDiv() { if (!OrgDiv || !OrgCheckBox) { return false; } OrgDiv.className = (OrgCheckBox.checked == true) ? "" : "wm_hide"; ResizeElements("all"); } function ShowHideOrgForm() { if (isOrg) { OrgTable.className = "wm_hide"; OrgTabImg.src="skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_down.gif"; } else { OrgTable.className = "wm_contacts_view"; OrgTabImg.src="skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_up.gif"; } isOrg = !isOrg; ResizeElements("all"); } '); $contact_id = Get::val(CONTACT_ID, -1); if ($contact_id > -1) { $group =& $this->_proc->db->SelectGroupById($contact_id); $groupname = $group->Name; $contacts =& $this->_proc->db->SelectAddressGroupContacts($contact_id); if ($group && $contacts) { $this->_pagebuilder->AddJSText(' function dolocation(idurl) { var url = document.getElementById(idurl); if (url && url.value.length > 2) { OpenURL(url.value); } } function RenameGroup() { var gcontrol = document.getElementById("control_1"); var gspan = document.getElementById("span_gname"); var ginput = document.getElementById("editor_1"); gspan.className = "wm_hide"; gcontrol.className = "wm_hide"; ginput.value = gspan.innerHTML; ginput.className = "wm_input"; ginput.onkeydown = function(ev) { if (isEnter(ev)) { var g_control = document.getElementById("control_1"); var g_span = document.getElementById("span_gname"); var g_input = document.getElementById("editor_1"); g_span.innerHTML = ginput.value; g_input.className = "wm_hide"; g_control.className = ""; g_span.className = ""; return false; } } ginput.focus(); } function SelectAllInputs(obj) { var table = document.getElementById("contacts_in_group"); if (table) { var inputs = table.getElementsByTagName("input"); var i, c; for (i = 0, c = inputs.length; i < c; i++) { if (inputs[i].type == "checkbox" && !inputs[i].disabled) { inputs[i].checked = obj.checked; } } } return false; } function DeleteContactsFromGroup() { var inputs = document.getElementsByTagName("input"); var i, c, t = 0; for (i = 0, c = inputs.length; i < c; i++) { if (inputs[i].type == "checkbox" && inputs[i].name == "cont_check[]") { t++; if (inputs[i].checked) { t--; var tr = document.getElementById("in_group_" + inputs[i].value); var imp = document.getElementById("inp_" + inputs[i].value); if (tr) tr.className = "wm_hide"; if (imp) imp.value = "-1"; } } } if (t == 0) { var table = document.getElementById("contacts_in_group"); if (table) table.className = "wm_hide"; var mail_group = document.getElementById("mail_group"); if (mail_group) mail_group.className = "wm_hide"; } } '); $this->_pagebuilder->AddInitText('selection.CheckLine("g_' . $contact_id . '");'); $isOrg = $group->IsOrganization ? 'checked="checked"' : ''; $html_2 = ''; if ($contacts && $contacts->Count() > 0) { $html_2 = '<table id="contacts_in_group" class="wm_inbox_lines" style="margin: 20px 20px 0px 20px; width: 300px;"> <tr class="wm_inbox_read_item" id="in_group_0"> <td> <input type="checkbox" class="wm_checkbox" onclick="SelectAllInputs(this);" id="CheckAll" name="CheckAll"/> </td> <td> ' . JS_LANG_Name . ' </td> <td> ' . JS_LANG_Email . ' </td> </tr>'; foreach (array_keys($contacts->Instance()) as $key) { $contact =& $contacts->Get($key); $html_2 .= ' <tr class="wm_inbox_read_item" id="in_group_' . $contact->Id . '"> <td> <input type="checkbox" class="wm_checkbox" id="ch_' . $contact->Id . '" name="cont_check[]" value="' . $contact->Id . '" /> <input type="hidden" id="inp_' . $contact->Id . '" value="' . $contact->Id . '" name="contactsIds[]" /> </td> <td class="wm_inbox_from_subject">' . ConvertUtils::WMHtmlSpecialChars($contact->Name) . '</td> <td class="wm_inbox_from_subject">' . ConvertUtils::WMHtmlSpecialChars($contact->Email) . '</td> </tr>'; } $html_2 .= '<tr id="mail_group"> <td colspan="2"> <a href="#" onclick="MailGroup(' . $contact_id . ')">' . JS_LANG_MailGroup . '</a> </td> <td style="text-align: right;"> <a href="#" onclick="DeleteContactsFromGroup();">' . JS_LANG_RemoveFromGroup . '</a> </td> </tr> </table>'; } $this->text .= ' <div class="wm_contacts_view_edit" id= "contacts_viewer"> <div id="contacts_viewer_div"> <form action="' . ACTIONFILE . '?action=update&req=group" method="POST"> <table class="wm_contacts_card" id="wm_contacts_card"> <tr> <td class="wm_contacts_card_top_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_top"></td> <td class="wm_contacts_card_top_right"><div class="wm_contacts_card_corner"></div></td> </tr> <tr> <td class="wm_contacts_card_left"></td> <td>'; $this->text .= ' <table class="wm_contacts_view"> <tr> <td>' . JS_LANG_GroupName . ':</td> <td class="wm_contacts_name"> <input type="hidden" name="gid" value="' . $contact_id . '"> <span id="span_gname">' . $groupname . '</span> <a id="control_1" href="#" onclick="return RenameGroup();">' . JS_LANG_Rename . '</a> <input style="width: 240px;" id="editor_1" type="text" value="' . ConvertUtils::AttributeQuote($groupname) . '" class="wm_hide" name="gname" /> </td> </tr> <tr> <td colspan="2"> <input type="checkbox" class="wm_checkbox" name="isorganization" id="isorganization" class="wm_input" onclick="ShowHideOrgDiv()" ' . $isOrg . '/> <label for="isorganization">' . TreatAsOrganization . '</label> </td> </tr> </table> <div id="orgDiv"> <table class="wm_contacts_tab" style="margin-top: 20px;" id="orgTab"> <tr onclick="ShowHideOrgForm()"> <td> <span class="wm_contacts_tab_name">' . Organization . '</span> <span class="wm_contacts_tab_mode"> <img id="orgTabImg" src="skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_up.gif"/> </span> </td> </tr> </table> <table class="wm_contacts_view" id="orgTable"> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_Email . ':</td> <td style="width: 80%;" colspan="4"> <input class="wm_input" type="text" maxlength="255" size="45" name="gemail" value="' . ConvertUtils::AttributeQuote($group->Email) . '"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_Company . ':</td> <td colspan="4"> <input class="wm_input" type="text" maxlength="65" size="18" name="gcompany" value="' . ConvertUtils::AttributeQuote($group->Company) . '"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_StreetAddress . ':</td> <td colspan="4"> <textarea class="wm_input" rows="2" cols="35" name="gstreet">' . ConvertUtils::WMHtmlSpecialChars($group->Street) . '</textarea> </td> </tr> <tr> <td class="wm_contacts_view_title" style="width: 20%;">' . JS_LANG_City . ':</td> <td style="width: 30%;"> <input class="wm_input" type="text" maxlength="65" size="18" name="gcity" value="' . ConvertUtils::AttributeQuote($group->City) . '"/> </td> <td style="width: 5%;"></td> <td class="wm_contacts_view_title" style="width: 15%;">' . JS_LANG_Fax . ':</td> <td style="width: 30%;"> <input class="wm_input" type="text" maxlength="50" size="18" name="gfax" value="' . ConvertUtils::AttributeQuote($group->Fax) . '"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_StateProvince . ':</td> <td> <input class="wm_input" type="text" maxlength="65" size="18" name="gstate" value="' . ConvertUtils::AttributeQuote($group->State) . '"/> </td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_Phone . ':</td> <td> <input class="wm_input" type="text" maxlength="50" size="18" name="gphone" value="' . ConvertUtils::AttributeQuote($group->Phone) . '"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_ZipCode . ':</td> <td> <input class="wm_input" type="text" maxlength="10" size="18" name="gzip" value="' . ConvertUtils::AttributeQuote($group->Zip) . '"/> </td> <td></td> <td class="wm_contacts_view_title">' . JS_LANG_CountryRegion . ':</td> <td> <input class="wm_input" type="text" maxlength="65" size="18" name="gcountry" value="' . ConvertUtils::AttributeQuote($group->Country) . '"/> </td> </tr> <tr> <td class="wm_contacts_view_title">' . JS_LANG_WebPage . ':</td> <td colspan="4"> <input class="wm_input" type="text" maxlength="255" size="45" name="gweb" id="gweb" value="' . ConvertUtils::AttributeQuote($group->Web) . '"/> <input class="wm_button" type="button" value="' . ConvertUtils::AttributeQuote(JS_LANG_Go) . '" onclick="dolocation(\'gweb\');"/> </td> </tr> </table> </div> ' . $html_2 . ' <table class="wm_contacts_view wm_add_contacts" style="width: 300px;"> <tr> <td> ' . JS_LANG_AddContacts . ': </td> </tr> <tr> <td colspan="2" class="wm_secondary_info"> <textarea rows="2" style="width: 100%; height: 70px;" name="emails"></textarea> ' . JS_LANG_CommentAddContacts . ' </td> </tr> </table> <table class="wm_contacts_view" style="width: 90%;"> <tr> <td class="wm_contacts_save_button"> <input type="submit" class="wm_button" value="' . ConvertUtils::AttributeQuote(JS_LANG_Save) . '" /> </td> </tr> </table> </form>'; $this->text .= ' </td> <td class="wm_contacts_card_right"></td> </tr> <tr> <td class="wm_contacts_card_bottom_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_bottom"></td> <td class="wm_contacts_card_bottom_right"><div class="wm_contacts_card_corner"></div></td> </tr> </table> </div> </div> </div>'; } else { $this->text = '<div class="wm_contacts_view_edit" id="contacts_viewer"><div id="contacts_viewer_div"></div></div>'; } } break; case C_VIEW: require_once WM_ROOTPATH . 'classic/base_contactedit.php'; $contact_id = Get::val(CONTACT_ID, -1); $text = WriteContactEdit($this->_pagebuilder, $contact_id); if ($text) { $this->_pagebuilder->AddJSFile('./classic/base.cnewcontactscreen.js'); $this->_pagebuilder->AddInitText(' selection.CheckLine("c_' . $contact_id . '"); newContact = new CNewContactScreenPart(0); newContact.InitEditContacts(isOpenContact); '); $this->_pagebuilder->AddJSText(' function ChangeTabVisibility(tab_name) { var tab = document.getElementById(tab_name); if (!tab) { return false; } if(tab.className == "wm_contacts_view") { tab.className = "wm_hide"; document.getElementById("button_" + tab_name).src = "skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_down.gif"; } else { tab.className = "wm_contacts_view"; document.getElementById("button_" + tab_name).src = "skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_up.gif"; } ResizeElements("all"); } '); $this->text .= ' <div class="wm_contacts_view_edit" id= "contacts_viewer"> <div id="contacts_viewer_div"> <table class="wm_contacts_card" id="wm_contacts_card"> <tr> <td class="wm_contacts_card_top_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_top"></td> <td class="wm_contacts_card_top_right"><div class="wm_contacts_card_corner"></div></td> </tr> <tr> <td class="wm_contacts_card_left"></td> <td>'; $this->text .= $text; $this->text .= '</td> <td class="wm_contacts_card_right"></td> </tr> <tr> <td class="wm_contacts_card_bottom_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_bottom"></td> <td class="wm_contacts_card_bottom_right"><div class="wm_contacts_card_corner"></div></td> </tr> </table> </div> </div> </div>'; } else { $this->text = '<div class="wm_contacts_view_edit" id="contacts_viewer"><div id="contacts_viewer_div"></div></div></div>'; } break; case C_NEW: require_once WM_ROOTPATH . 'classic/base_contactedit.php'; $this->_pagebuilder->AddJSFile('./classic/base.cnewcontactscreen.js'); $this->_pagebuilder->AddInitText(' newContact = new CNewContactScreenPart(1); newContact.InitEditContacts(); '); $this->_pagebuilder->AddJSText(' function ChangeTabVisibility(tab_name) { var tab = document.getElementById(tab_name); if (!tab) { return false; } if(tab.className == "wm_contacts_view") { tab.className = "wm_hide"; document.getElementById("button_" + tab_name).src = "skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_down.gif"; } else { tab.className = \'wm_contacts_view\'; document.getElementById("button_" + tab_name).src = "skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_up.gif"; } ResizeElements("all"); } '); $contact_id = -1; $this->text .= ' <div class="wm_contacts_view_edit" id="contacts_viewer"> <div id="contacts_viewer_div"> <table class="wm_contacts_card" id="wm_contacts_card"> <tr> <td class="wm_contacts_card_top_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_top"></td> <td class="wm_contacts_card_top_right"><div class="wm_contacts_card_corner"></div></td> </tr> <tr> <td class="wm_contacts_card_left"></td> <td>'; $this->text .= WriteContactEdit($this->_pagebuilder, $contact_id, true); $this->text .= '</td> <td class="wm_contacts_card_right"></td> </tr> <tr> <td class="wm_contacts_card_bottom_left"><div class="wm_contacts_card_corner"></div></td> <td class="wm_contacts_card_bottom"></td> <td class="wm_contacts_card_bottom_right"><div class="wm_contacts_card_corner"></div></td> </tr> </table> </div> </div> </div>'; break; default: case C_NONE: $this->text = '<div class="wm_contacts_view_edit" id="contacts_viewer"><div id="contacts_viewer_div"></div></div></div>'; break; } }
header('Location: ' . BASEFILE); break; break; case 'signature': if ($sarray && in_array($sarray[EDIT_ACCOUNT_ID], $Accounts)) { $editAccount =& Account::LoadFromDb($sarray[EDIT_ACCOUNT_ID]); if ($editAccount->IsDemo) { header('Location: ' . BASEFILE); exit; } $signatureOptions = 0; $signatureOptions += (int) Post::val('add_signatures', 0); $signatureOptions += (int) Post::val('replies_forwards', 0); $editAccount->SignatureType = (int) Post::val('isHtml', 0); $editAccount->SignatureOptions = $signatureOptions; $editAccount->Signature = $editAccount->SignatureType == 0 ? ConvertUtils::WMHtmlSpecialChars(strip_tags(Post::val('signature', ''))) : Post::val('signature', ''); if (!$editAccount->Update(null)) { SetError(PROC_CANT_UPDATE_ACCT); } else { SetReport(ReportSignatureUpdatedSuccessfuly); } } header('Location: ' . BASEFILE); break; default: case 'none': header('Location: ' . BASEFILE . '?' . SCREEN . '=' . SCREEN_MAILBOX); break; } break; case 'delete':
/** * @param FolderCollection $folders * @param int $messagesCount * @param int $messagesSize * @param Account $account * @return string */ function CreateHtmlFolderTree(&$folders, &$messagesCount, &$messagesSize, &$account) { $out = array('', ''); for ($i = 0, $count = $folders->Count(); $i < $count; $i++) { $folder =& $folders->Get($i); if ($i > 0) { $pr_folder =& $folders->Get($i - 1); } if ($i < $count - 1) { $nx_folder =& $folders->Get($i + 1); } $messagesCount += $folder->MessageCount; $messagesSize += $folder->Size; $foldername = ''; if (ConvertUtils::IsLatin($folder->Name)) { $foldername = ConvertUtils::ConvertEncoding($folder->Name, CPAGE_UTF7_Imap, $this->setaccount->_pagebuilder->_proc->account->GetUserCharset()); } else { $foldername = ConvertUtils::ConvertEncoding($folder->Name, $this->setaccount->_pagebuilder->_proc->account->DefaultIncCharset, $this->setaccount->_pagebuilder->_proc->account->GetUserCharset()); } $folderUrl = 'skins/' . $this->setaccount->_pagebuilder->SkinName() . '/folders/' . GetFolderImg($folder->Type, MAILPROTOCOL_POP3); $hasChild = $folder->SubFolders != null; $hasMessages = $folder->MessageCount > 0; $disab = $hasChild || $hasMessages ? 'disabled="disabled" ' : ''; $disab = $account->MailProtocol == MAILPROTOCOL_POP3 ? '' : $disab; $checkbox = $folder->Type == FOLDERTYPE_Custom ? '<input type="checkbox" id="ch_0" name="folders[' . ConvertUtils::AttributeQuote($folder->IdDb) . ']" value="' . ConvertUtils::AttributeQuote($folder->FullName) . '" class="wm_checkbox" ' . $disab . '/>' : ''; $uphref = $i < 1 ? '<img src="skins/' . $this->setaccount->_pagebuilder->SkinName() . '/folders/up_inactive.gif" />' : '<a onclick="return DoAlert();" href="' . ACTIONFILE . '?action=update&req=folderorder&cf_id=' . $folder->IdDb . '&rf_id=' . $pr_folder->IdDb . '"><img src="skins/' . $this->setaccount->_pagebuilder->SkinName() . '/folders/up.gif" /></a>'; $downhref = $i > $count - 2 ? '<img src="skins/' . $this->setaccount->_pagebuilder->SkinName() . '/folders/down_inactive.gif" />' : '<a onclick="return DoAlert();" href="' . ACTIONFILE . '?action=update&req=folderorder&cf_id=' . $folder->IdDb . '&rf_id=' . $nx_folder->IdDb . '"><img src="skins/' . $this->setaccount->_pagebuilder->SkinName() . '/folders/down.gif" /></a>'; $eyeimg = $folder->Hide ? 'hide.gif' : 'show.gif'; switch ($folder->Type) { default: case FOLDERTYPE_Custom: $foldername = ConvertUtils::WMHtmlSpecialChars($foldername); break; case FOLDERTYPE_Inbox: $foldername = FolderInbox; break; case FOLDERTYPE_Drafts: $foldername = FolderDrafts; break; case FOLDERTYPE_SentItems: $foldername = FolderSentItems; break; case FOLDERTYPE_Trash: $foldername = FolderTrash; break; } $nameSting = $folder->Type == FOLDERTYPE_Custom ? '<form action="' . ACTIONFILE . '?action=rename&req=folder" id="folder_form_' . $folder->IdDb . '" method="POST"> <img src="' . $folderUrl . '" /> <a href="#" onclick="EditFolder(' . $folder->IdDb . ');" id="folder_a_' . $folder->IdDb . '">' . $foldername . '</a> <input type="text" class="wm_hide" name="folderid" value="' . $folder->IdDb . '"> <input type="text" class="wm_hide" name="fname" maxLength="30" id="folder_i_' . $folder->IdDb . '" value="' . ConvertUtils::AttributeQuote($foldername) . '"/></form>' : '<img src="' . ConvertUtils::AttributeQuote($folderUrl) . '" /> ' . $foldername; $imap4SyncTd = $this->setaccount->_editAccount->MailProtocol == MAILPROTOCOL_IMAP4 ? ' <td><form id="syncform_' . $folder->IdDb . '" action="' . ACTIONFILE . '?action=update&req=foldersync" method="POST"> <input type="hidden" name="folderid" value="' . $folder->IdDb . '"> <select onchange="document.getElementById(\'syncform_' . $folder->IdDb . '\').submit();" name="synctype"> <option value="' . FOLDERSYNC_DontSync . '" ' . ($folder->SyncType == FOLDERSYNC_DontSync ? 'selected="selected"' : '') . '>' . JS_LANG_SyncTypeNo . '</option> <option value="' . FOLDERSYNC_NewHeadersOnly . '" ' . ($folder->SyncType == FOLDERSYNC_NewHeadersOnly ? 'selected="selected"' : '') . '>' . JS_LANG_SyncTypeNewHeaders . '</option> <option value="' . FOLDERSYNC_AllHeadersOnly . '" ' . ($folder->SyncType == FOLDERSYNC_AllHeadersOnly ? 'selected="selected"' : '') . '>' . JS_LANG_SyncTypeAllHeaders . '</option> <option value="' . FOLDERSYNC_NewEntireMessages . '" ' . ($folder->SyncType == FOLDERSYNC_NewEntireMessages ? 'selected="selected"' : '') . '>' . JS_LANG_SyncTypeNewMessages . '</option> <option value="' . FOLDERSYNC_AllEntireMessages . '" ' . ($folder->SyncType == FOLDERSYNC_AllEntireMessages ? 'selected="selected"' : '') . '>' . JS_LANG_SyncTypeAllMessages . '</option> <option value="' . FOLDERSYNC_DirectMode . '" ' . ($folder->SyncType == FOLDERSYNC_DirectMode ? 'selected="selected"' : '') . '>' . JS_LANG_SyncTypeDirectMode . '</option> </select></form> </td> ' : '<td class="wm_hide"></td>'; $out[0] .= ' <tr> <td>' . $checkbox . '</td> <td class="wm_settings_mf_folder"> <div style="padding-left: ' . $folder->Level * 8 . 'px;"> ' . $nameSting . ' </div></td> <td>' . $folder->MessageCount . '</td> <td>' . GetFriendlySize($folder->Size) . '</td> ' . $imap4SyncTd . ' <td><a href="#" onclick="if (!DoAlert()) return false; document.location=\'' . ACTIONFILE . '?action=update&req=folderhide&folderid=' . $folder->IdDb . '\'"><img class="wm_settings_mf_show_hide" src="skins/' . $this->setaccount->_pagebuilder->SkinName() . '/folders/' . $eyeimg . '"></a> </td> <td class="wm_settings_mf_up_down"> ' . $uphref . $downhref . ' </td> </tr> '; $out[1] .= '<option value="' . $folder->IdDb . '">' . str_repeat(' ', $folder->Level * 3) . $foldername . '</option>' . "\r\n"; if ($folder->SubFolders != null && $folder->SubFolders->Count() > 0) { $temp = $this->CreateHtmlFolderTree($folder->SubFolders, $messagesCount, $messagesSize, $account); $out[0] .= $temp[0]; $out[1] .= $temp[1]; } } return $out; }
/** * @return String */ function CreateGroupsHtml() { $out = ''; $groupNames =& $this->_pagebuilder->_proc->db->SelectUserAddressGroupNames(); foreach ($groupNames as $id => $name) { $out .= '<option value="' . $id . '">' . ConvertUtils::WMHtmlSpecialChars($name) . '</option>'; } return $out; }
/** * @return bool */ function SaveToXml() { $xmlDocument =& new XmlDocument(); $xmlDocument->CreateElement('Settings'); $xmlDocument->XmlRoot->AppendAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema'); $xmlDocument->XmlRoot->AppendAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); $common = new XmlDomNode('Common'); $common->AppendChild(new XmlDomNode('SiteName', ConvertUtils::WMHtmlSpecialChars($this->WindowTitle))); $common->AppendChild(new XmlDomNode('LicenseKey', ConvertUtils::WMHtmlSpecialChars($this->LicenseKey))); $common->AppendChild(new XmlDomNode('AdminPassword', ConvertUtils::WMHtmlSpecialChars($this->AdminPassword))); $common->AppendChild(new XmlDomNode('DBType', (int) $this->DbType)); $common->AppendChild(new XmlDomNode('DBLogin', ConvertUtils::WMHtmlSpecialChars($this->DbLogin))); $common->AppendChild(new XmlDomNode('DBPassword', ConvertUtils::WMHtmlSpecialChars($this->DbPassword))); $common->AppendChild(new XmlDomNode('DBName', ConvertUtils::WMHtmlSpecialChars($this->DbName))); $common->AppendChild(new XmlDomNode('DBDSN', ConvertUtils::WMHtmlSpecialChars($this->DbDsn))); $common->AppendChild(new XmlDomNode('DBHost', ConvertUtils::WMHtmlSpecialChars($this->DbHost))); $common->AppendChild(new XmlDomNode('UseCustomConnectionString', (int) $this->UseCustomConnectionString)); $common->AppendChild(new XmlDomNode('DBCustomConnectionString', ConvertUtils::WMHtmlSpecialChars($this->DbCustomConnectionString))); $common->AppendChild(new XmlDomNode('DBPrefix', ConvertUtils::WMHtmlSpecialChars($this->DbPrefix))); $common->AppendChild(new XmlDomNode('DefaultSkin', ConvertUtils::WMHtmlSpecialChars($this->DefaultSkin))); $common->AppendChild(new XmlDomNode('AllowUsersChangeSkin', (int) $this->AllowUsersChangeSkin)); $common->AppendChild(new XmlDomNode('DefaultLanguage', ConvertUtils::WMHtmlSpecialChars($this->DefaultLanguage))); $common->AppendChild(new XmlDomNode('AllowUsersChangeLanguage', (int) $this->AllowUsersChangeLanguage)); $xmlDocument->XmlRoot->AppendChild($common); $webmail = new XmlDomNode('WebMail'); $webmail->AppendChild(new XmlDomNode('IncomingMailProtocol', (int) $this->IncomingMailProtocol)); $webmail->AppendChild(new XmlDomNode('IncomingMailServer', ConvertUtils::WMHtmlSpecialChars($this->IncomingMailServer))); $webmail->AppendChild(new XmlDomNode('IncomingMailPort', (int) $this->IncomingMailPort)); $webmail->AppendChild(new XmlDomNode('OutgoingMailServer', ConvertUtils::WMHtmlSpecialChars($this->OutgoingMailServer))); $webmail->AppendChild(new XmlDomNode('OutgoingMailPort', (int) $this->OutgoingMailPort)); $webmail->AppendChild(new XmlDomNode('ReqSmtpAuth', (int) $this->ReqSmtpAuth)); $webmail->AppendChild(new XmlDomNode('AllowAdvancedLogin', (int) $this->AllowAdvancedLogin)); $webmail->AppendChild(new XmlDomNode('HideLoginMode', (int) $this->HideLoginMode)); $webmail->AppendChild(new XmlDomNode('DefaultDomainOptional', ConvertUtils::WMHtmlSpecialChars($this->DefaultDomainOptional))); $webmail->AppendChild(new XmlDomNode('ShowTextLabels', (int) $this->ShowTextLabels)); $webmail->AppendChild(new XmlDomNode('AutomaticCorrectLoginSettings', (int) $this->AutomaticCorrectLoginSettings)); $webmail->AppendChild(new XmlDomNode('EnableLogging', (int) $this->EnableLogging)); $webmail->AppendChild(new XmlDomNode('DisableErrorHandling', (int) $this->DisableErrorHandling)); $webmail->AppendChild(new XmlDomNode('AllowAjax', (int) $this->AllowAjax)); $webmail->AppendChild(new XmlDomNode('MailsPerPage', (int) $this->MailsPerPage)); $webmail->AppendChild(new XmlDomNode('EnableAttachmentSizeLimit', (int) $this->EnableAttachmentSizeLimit)); $webmail->AppendChild(new XmlDomNode('AttachmentSizeLimit', ConvertUtils::WMHtmlSpecialChars($this->AttachmentSizeLimit))); $webmail->AppendChild(new XmlDomNode('EnableMailboxSizeLimit', (int) $this->EnableMailboxSizeLimit)); $webmail->AppendChild(new XmlDomNode('MailboxSizeLimit', ConvertUtils::WMHtmlSpecialChars($this->MailboxSizeLimit))); $webmail->AppendChild(new XmlDomNode('DefaultTimeZone', ConvertUtils::WMHtmlSpecialChars($this->DefaultTimeZone))); $webmail->AppendChild(new XmlDomNode('AllowUsersChangeTimeZone', (int) $this->AllowUsersChangeTimeZone)); $webmail->AppendChild(new XmlDomNode('DefaultUserCharset', ConvertUtils::GetCodePageNumber($this->DefaultUserCharset))); $webmail->AppendChild(new XmlDomNode('AllowUsersChangeCharset', (int) $this->AllowUsersChangeCharset)); $webmail->AppendChild(new XmlDomNode('AllowDHTMLEditor', (int) $this->AllowDhtmlEditor)); $webmail->AppendChild(new XmlDomNode('AllowUsersChangeEmailSettings', (int) $this->AllowUsersChangeEmailSettings)); $webmail->AppendChild(new XmlDomNode('AllowDirectMode', (int) $this->AllowDirectMode)); $webmail->AppendChild(new XmlDomNode('DirectModeIsDefault', (int) $this->DirectModeIsDefault)); $webmail->AppendChild(new XmlDomNode('AllowNewUsersRegister', (int) $this->AllowNewUsersRegister)); $webmail->AppendChild(new XmlDomNode('AllowUsersAddNewAccounts', (int) $this->AllowUsersAddNewAccounts)); $webmail->AppendChild(new XmlDomNode('StoreMailsInDb', (int) $this->StoreMailsInDb)); $webmail->AppendChild(new XmlDomNode('EnableWmServer', (int) $this->EnableWmServer)); $webmail->AppendChild(new XmlDomNode('WmServerRootPath', ConvertUtils::WMHtmlSpecialChars($this->WmServerRootPath))); $webmail->AppendChild(new XmlDomNode('WmServerHost', ConvertUtils::WMHtmlSpecialChars($this->WmServerHost))); $webmail->AppendChild(new XmlDomNode('WmAllowManageXMailAccounts', (int) $this->WmAllowManageXMailAccounts)); $webmail->AppendChild(new XmlDomNode('AllowContacts', (int) $this->AllowContacts)); $webmail->AppendChild(new XmlDomNode('AllowCalendar', (int) $this->AllowCalendar)); $xmlDocument->XmlRoot->AppendChild($webmail); $calendar = new XmlDomNode('Calendar'); $calendar->AppendChild(new XmlDomNode('DefaultTimeFormat', (int) $this->Cal_DefaultTimeFormat)); $calendar->AppendChild(new XmlDomNode('DefaultDateFormat', (int) $this->Cal_DefaultDateFormat)); $calendar->AppendChild(new XmlDomNode('ShowWeekends', (int) $this->Cal_ShowWeekends)); $calendar->AppendChild(new XmlDomNode('WorkdayStarts', (int) $this->Cal_WorkdayStarts)); $calendar->AppendChild(new XmlDomNode('WorkdayEnds', (int) $this->Cal_WorkdayEnds)); $calendar->AppendChild(new XmlDomNode('ShowWorkDay', (int) $this->Cal_ShowWorkDay)); $calendar->AppendChild(new XmlDomNode('WeekStartsOn', (int) $this->Cal_WeekStartsOn)); $calendar->AppendChild(new XmlDomNode('DefaultTab', (int) $this->Cal_DefaultTab)); $calendar->AppendChild(new XmlDomNode('DefaultCountry', ConvertUtils::WMHtmlSpecialChars($this->Cal_DefaultCountry))); $calendar->AppendChild(new XmlDomNode('DefaultTimeZone', (int) $this->Cal_DefaultTimeZone)); $calendar->AppendChild(new XmlDomNode('AllTimeZones', (int) $this->Cal_AllTimeZones)); $xmlDocument->XmlRoot->AppendChild($calendar); return $xmlDocument->SaveToFile(INI_DIR . '/settings/settings.xml'); }