Пример #1
0
    /**
     * @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;
    }
Пример #2
0
		var LoginUrl = "reg.php";
		var ActionUrl = "processing.php";
		var LanguageUrl = "langs.js.php";
		var WmVersion = "<?php 
echo JS_VERS;
?>
";
<?php 
echo $_js_rtl;
?>
	</script>
	<script type="text/javascript" src="langs.js.php?v=<?php 
echo JS_VERS;
?>
&lang=<?php 
echo ConvertUtils::AttributeQuote(defaultLanguage);
?>
"></script>
<?php 
if (USE_JS_GZIP && IS_SUPPORT_GZIP) {
    ?>
	<script type="text/javascript" src="cache-loader.php?v=<?php 
    echo JS_VERS;
    ?>
&t=def"></script>
	<script type="text/javascript" src="cache-loader.php?v=<?php 
    echo JS_VERS;
    ?>
&t=reg"></script>
<?php 
} else {
Пример #3
0
            $attachmentsKeys = array_keys($message->Attachments->Instance());
            foreach ($attachmentsKeys as $key) {
                $attachment =& $message->Attachments->Get($key);
                $tempName = $key . '_' . ConvertUtils::ClearFileName($attachment->GetTempName());
                $fileName = ConvertUtils::ClearFileName(ConvertUtils::ClearUtf8($attachment->GetFilenameFromMime(), $GLOBALS[MailInputCharset], $account->GetUserCharset()));
                $view = $download = null;
                $size = $tempFiles->SaveFile($tempName, $attachment->GetBinaryBody());
                if ($size > -1) {
                    $download = 'attach.php?tn=' . urlencode($tempName) . '&filename=' . urlencode($fileName);
                    $lowerAttachFileName = strtolower($fileName);
                    $contentType = ConvertUtils::GetContentTypeFromFileName($fileName);
                    if (substr($lowerAttachFileName, -4) == '.eml') {
                        $view = 'message-view.php?type=' . MESSAGE_VIEW_TYPE_ATTACH . '&tn=' . urlencode($tempName);
                    } else {
                        if (false !== strpos($contentType, 'image')) {
                            $view = 'message-view.php?type=' . MESSAGE_VIEW_TYPE_ATTACH . '&tn=' . urlencode($tempName);
                        }
                    }
                }
                $attachString .= ' <a href="' . ConvertUtils::AttributeQuote($download) . '">' . $fileName . '</a>';
                $attachString .= null !== $view ? ' (<a href="' . ConvertUtils::AttributeQuote($view) . '">' . JS_LANG_View . '</a>)' : '';
                $attachString .= ',';
                unset($attachment);
            }
        }
        $attachString = trim($attachString, ', ');
        $textCharset = $message->GetTextCharset();
        $fullBodyText = $message->HasHtmlText() ? ConvertUtils::ReplaceJSMethod(PrintHtmlBodyForViewMsgScreen($message, $account, true)) : nl2br($message->GetCensoredTextBody(true));
        break;
}
PrintMessagePreview($account->DefaultSkin, $_rtl, $fullBodyText, $textCharset, $fromString, $toString, $dateString, $subjectString, $attachString, $ccString, $viewType == MESSAGE_VIEW_TYPE_PRINT);
Пример #4
0
			<input type="text" name="txtWmServerRootPath" onchange="change();" value="<?php 
echo ConvertUtils::AttributeQuote($settings->WmServerRootPath);
?>
" size="50" class="wm_input" maxlength="500">
		</td>
	</tr>
	<tr><td colspan="3">
<div class="wm_safety_info">
<b>Path to Server</b> - path to the MailRoot folder of AfterLogic XMail Server in your system, for instance C:/Program Files/AfterLogic XMail Server/MailRoot/.
</div><br />
	</td></tr>
	<tr>
		<td align="right">Server Host: </td>
		<td colspan="2">
			<input type="text" name="txtWmServerHostName" onchange="change();" value="<?php 
echo ConvertUtils::AttributeQuote($settings->WmServerHost);
?>
" size="50" class="wm_input" maxlength="500">
		</td>
	</tr>
	<tr><td colspan="3">
<div class="wm_safety_info">
<b>Server Host</b> - IP address or hostname where AfterLogic XMail Server resides.
</div><br />
	</td></tr>
	
	<tr>
		<td align="right">
			<input type="checkbox" name="intWmAllowManageXMailAccounts" onchange="change();" id="intWmAllowManageXMailAccounts" <?php 
echo (bool) $settings->WmAllowManageXMailAccounts ? 'checked="checked"' : '';
?>
Пример #5
0
                        //$filename = ConvertUtils::ConvertEncoding($attachment->GetFilenameFromMime(), $GLOBALS[MailInputCharset], $message->account->GetUserCharset());
                        $filename = ConvertUtils::ClearFileName($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['attachtempdir']);
                        $fs->SaveAttach($attachment, $attfolder, $tempname);
                        $ContentType = ConvertUtils::GetContentTypeFromFileName($filename);
                        $JSfilenameTrim .= '
					att = document.getElementById("at_' . $key . '");
					if (att.innerHTML.length > 16) 
							att.innerHTML = att.innerHTML.substring(0, 15) + "&#8230;";
					';
                        echo '
					<div style="float: left;"><a href="attach.php?tn=' . urlencode($tempname) . '&filename=' . urlencode($filename) . '">
							<img src="./images/icons/' . GetAttachImg($filename) . '" title="Click to download ' . ConvertUtils::AttributeQuote($filename . ' (' . $filesize) . ')" /></a><br />
							<span id="at_' . $key . '" title="Click to download ' . ConvertUtils::AttributeQuote($filename . ' (' . $filesize) . ')">' . $filename . '</span><br />';
                        if (strpos($ContentType, 'image') !== false) {
                            echo '<a href="#" onclick="PrevImg(\'view-image.php?tn=' . urlencode($tempname) . '\')">' . JS_LANG_View . '</a>';
                        }
                        echo '</div>';
                    }
                }
                echo '</div>
			</td>
			<td rowspan="3" id="td_vert_resizer"><div id="vert_resizer"></div></td>';
            } else {
                echo '</td><td></td>';
            }
            ?>
			
			<td id="td_message">
Пример #6
0
    function ToHTML()
    {
        return '
	<table id="iftare_table" width="100%">
		<tr>
			<td>
				<iframe name="iframe_container" width="100%" frameborder="0" id="iframe_container"></iframe>
			</td>
		</tr>
	</table>
<form name="messform" id="messform" action="base-iframe.php?mode=full" target="iframe_container" method="POST">
<input type="hidden" name="m_id" id="m_id" value="' . ConvertUtils::AttributeQuote(Post::val('m_id', '')) . '" />
<input type="hidden" name="m_uid" id="m_uid" value="' . ConvertUtils::AttributeQuote(Post::val('m_uid', '')) . '" />
<input type="hidden" name="f_id" id="f_id" value="' . ConvertUtils::AttributeQuote(Post::val('f_id', '')) . '" />
<input type="hidden" name="f_name" id="f_name" value="' . ConvertUtils::AttributeQuote(Post::val('f_name', '')) . '" />
<input type="hidden" name="charset" id="charset" value="' . ConvertUtils::AttributeQuote(Post::val('charset', '')) . '" />
<input type="hidden" name="plain" id="plain" value="' . ConvertUtils::AttributeQuote(Post::val('plain', '-1')) . '" />
<input type="hidden" name="mtype" id="mtype" value="msg" />
</form>

			';
    }
Пример #7
0
}
?>
				</div>
					
				<div style="float: left;">
					<form action="" method="GET">
						<input type="hidden" name="mode" class="wm_input" value="wm_edit" />
						<input type="hidden" name="uid" class="wm_input" value="-1" />
						<input type="submit" value="Create User"  class="wm_button" style="width: 150px" />
					</form>		
				</div>
				
				<div style="float: right;">
					<form action="" method="GET">
						<input type="hidden" name="mode" class="wm_input" value="wm_users" />
						<input type="text" name="search_text" class="wm_input" size="30" value="<?php 
echo ConvertUtils::AttributeQuote($searchText);
?>
" />
						<input type="submit" value="Search"  class="wm_button" />
					</form>		
				</div>	
			</td>	
		</tr>	
	</table>	
	
	
		</td>
	</tr>
</table>
<!-- [end center] -->
Пример #8
0
			<input type="checkbox" name="intEnableLogging" onchange="change();" id="intEnableLogging" <?php 
echo (bool) $settings->EnableLogging ? 'checked="checked"' : '';
?>
 value="1" />
		</td>
		<td><label for="intEnableLogging">Enable logging</label></td>
	</tr>
	<tr><td colspan="2">
<div class="wm_safety_info">
<b>Enable logging</b> - enables detailed logging helpful for troubleshooting.
</div><br />
	</td></tr>
	<tr>
		<td></td>
		<td>&nbsp;Path for log&nbsp;&nbsp;<input type="text" name="txtPathForLog" onchange="change();" value="<?php 
echo ConvertUtils::AttributeQuote(INI_DIR . '/' . LOG_PATH . '/' . LOG_FILENAME);
?>
" class="wm_input" readonly="readonly" style="width: 330px">
		<br /><br />
<div class="wm_safety_info">
<b>Path for log</b> - path to the log file (cannot be changed).<br />The buttons below allow viewing and clearing the log file.
</div>
		<br />
			<input type="button" onclick="PopUpWindow('?mode=showlog&t=0');" value="View entire log (<?php 
echo file_exists(INI_DIR . '/' . LOG_PATH . '/' . LOG_FILENAME) ? GetFriendlySize(filesize(INI_DIR . '/' . LOG_PATH . '/' . LOG_FILENAME)) : '0KB';
?>
)" class="wm_button" style="font-size: 11px; width: 150px" />
			<input type="button" onclick="PopUpWindow('?mode=showlog&t=1');" value="View last 50KB of log" class="wm_button" style="font-size: 11px; width: 150px" />
			<input type="button" onclick="document.location.replace('?mode=clearlog');" value=" Clear log " class="wm_button" style="font-size: 11px;" />
		</td>
	</tr>
Пример #9
0
		</td>
	</tr>	
	<!-- 4 -->
	<tr>
		<td colspan="2">
		</td>
	</tr>
	<tr>
		<td align="right"><br /><strong>ODBC Connection String:</strong>
		<?php 
echo $isOdbcWork ? '' : '<br /><font color="red">(ODBC dosn\'t work)</font> ';
?>
		</td>
		<td align="left"><br />
		<input type="text" class="wm_input" onkeyup="RedThis(this);" name="odbcConnectionString" id="odbcConnectionString" value="<?php 
echo ConvertUtils::AttributeQuote($settings->DbCustomConnectionString);
?>
" size="45">
		</td>
	</tr>
		<tr>
		<td align="right"></td>
		<td>
			<input type="checkbox" value="1" onchange="change();" class="wm_checkbox" name="useCS" id="useCS" <?php 
echo $settings->UseCustomConnectionString ? 'checked="checked"' : '';
?>
 onclick="DoIt();" />
			<label for="useCS">Use connection string</label>	
		</td>
	</tr>	
Пример #10
0
    function ToHTML()
    {
        return '
<table class="wm_settings">
		<tr>
			<td class="wm_settings_nav">
				' . NavigationPrint($this->_pagebuilder, 2) . '
			</td>
			<td class="wm_settings_cont">
				<table class="wm_settings_common">
					<tr>
						<td>
							<form action="' . ACTIONFILE . '?action=save&req=contactset" method="POST">
							' . JS_LANG_ContactsPerPage . ': <input class="wm_input" type="text" size="2" id="contacts_per_page"
							name="contacts_per_page" value="' . ConvertUtils::AttributeQuote($this->data['contactsPerPage']) . '" maxlength="2" />
						</td>
					</tr>
				</table>

				<table class="wm_settings_buttons">
					<tr>
						<td>
							<input class="wm_button" type="submit" name="subm" value="' . ConvertUtils::AttributeQuote(JS_LANG_Save) . '" ID="Submit1"/>
							</form>
						</td>
					</tr>
				</table>

			</td>
		</tr>
	</table>
						
			';
    }
Пример #11
0
?>
>Use Account-name as Login</option>
			</select>
		</td>
	</tr>
	<tr>
		<td align="right" valign="top"><br />
			<input type="radio" name="hideLoginRadionButton" onchange="change();" value="2" id="hideLoginRadionButton3" style="vertical-align: middle" <?php 
echo isset($checkmass[2]) ? $checkmass[2] : '';
?>
 onclick="DoIt()" />
		</td>
		<td><br />
			<label for="hideLoginRadionButton3">Hide email field</label>
			<br /><br />&nbsp;<input type="text" name="txtUseDomain" onchange="change();" value="<?php 
echo ConvertUtils::AttributeQuote($settings->DefaultDomainOptional);
?>
" id="txtUseDomain" class="wm_input" size="20" />&nbsp;&nbsp;domain to use
			<br /><br />
			<input type="checkbox" name="intDisplayDomainAfterLoginField" onchange="change();" value="1" id="intDisplayDomainAfterLoginField" style="vertical-align: middle" <?php 
echo isset($checkmass[5]) ? $checkmass[5] : '';
?>
 />
			<label for="intDisplayDomainAfterLoginField"">Display domain after login field</label>
			<br /><br />
			<input type="checkbox" name="intLoginAsConcatination" onchange="change();" id="intLoginAsConcatination" value="1" style="vertical-align: middle" <?php 
echo isset($checkmass[6]) ? $checkmass[6] : '';
?>
 />
			<label for="intLoginAsConcatination">Login as concatenation of "Login" field + "@" + domain</label>
		</td>
Пример #12
0
    function ToHTML()
    {
        $text = isset($this->_pagebuilder->_proc->sArray[SEARCH_ARRAY][S_TEXT]) ? $this->_pagebuilder->_proc->sArray[SEARCH_ARRAY][S_TEXT] : '';
        return '
<div class="wm_toolbar_search_item" style="margin-left: 0px;" id="search_control">
	<img class="wm_search_arrow" id="search_control_img" src="skins/' . $this->_pagebuilder->SkinName() . '/menu/arrow_down.gif" />
</div>
<div class="wm_toolbar_search_item" onmouseover="this.className=\'wm_toolbar_search_item_over\'" 
onmouseout="this.className=\'wm_toolbar_search_item\'" id="search_small_form" style="margin-right: 0px;">
	<form action="?' . S_GETMODECONTACT . '=mini" method="POST" id="searchformmini">
	<input type="text" id="smallLookFor" name="smallLookFor" class="wm_search_input" value="' . ConvertUtils::AttributeQuote($text) . '" >
	<img class="wm_menu_small_search_img" src="skins/' . $this->_pagebuilder->SkinName() . '/menu/search_button.gif" 
	onclick="document.getElementById(\'searchformmini\').submit();" >
	</form>
</div>	
' . $this->_hidePart;
    }
Пример #13
0
 /**
  * @return string;
  */
 function _filesToHtml()
 {
     $output = '';
     $this->_jsFiles = array_unique($this->_jsFiles);
     foreach ($this->_jsFiles as $value) {
         $output .= '<script type="text/javascript" src="' . ConvertUtils::AttributeQuote($value) . '"></script>' . "\r\n";
     }
     return $output;
 }
Пример #14
0
	</tr>

	<tr>
		<td align="right">SMTP login: </td>
		<td colspan="2" align="left">
			<input type="text" style="width: 350px" onchange="change();" name="fm_smtp_login" value="<?php 
echo isset($editAccount->MailOutLogin) ? ConvertUtils::AttributeQuote($editAccount->MailOutLogin) : '';
?>
" class="wm_input" maxlength="100">
		</td>
	</tr>
	<tr>
		<td align="right">SMTP password: </td>
		<td colspan="2" align="left">
			<input type="password" style="width: 350px" onchange="change();" name="fm_smtp_password" class="wm_input" maxlength="100" value="<?php 
echo isset($editAccount) && !empty($editAccount->MailOutPassword) ? ConvertUtils::AttributeQuote(DUMMYPASSWORD) : '';
?>
">
		</td>
	</tr>

	<tr>
		<td colspan="3" align="left">
			<input type="checkbox" name="fm_smtp_authorisation" onchange="change();" style="vertical-align: middle" id="fm_smtp_authorisation" value="1" class="wm_checkbox" <?php 
echo isset($editAccount->MailOutAuthentication) && (int) $editAccount->MailOutAuthentication == 1 ? 'checked="checked"' : '';
?>
 /> 
			<label for="fm_smtp_authorisation">Use SMTP authentication (You may leave SMTP login/password fields blank, if they're the same as POP3 login/password)</label>
		</td>
	</tr>
	
Пример #15
0
	<tr>
		<td align="right">&nbsp;</td>
		<td colspan="2">
			<input type="checkbox" style="vertical-align: middle" name="intDirectModeIsDefault" onchange="change();" id="intDirectModeIsDefault" <?php 
echo (int) $settings->DirectModeIsDefault == 1 ? 'checked="checked"' : '';
?>
 value="1" />
			<label for="intDirectModeIsDefault">Direct mode is default</label>
		</td>
	</tr>
	<tr>
		<td align="right">Attachment size limit: </td>

		<td colspan="2">
			<input type="text" class="wm_input" name="intAttachmentSizeLimit" id="intAttachmentSizeLimit" onchange="change();" style="width: 85px" value="<?php 
echo ConvertUtils::AttributeQuote($settings->AttachmentSizeLimit);
?>
" maxlength="10"> bytes
			&nbsp;&nbsp;&nbsp;
			<input type="checkbox" style="vertical-align: middle" onchange="change();" onclick="DoIt();" name="intEnableAttachSizeLimit" id="intEnableAttachSizeLimit" value="1" <?php 
echo (int) $settings->EnableAttachmentSizeLimit == 0 ? '' : 'checked="checked"';
?>
 />
			<label for="intEnableAttachSizeLimit">Enable Attachment size limit</label>
		</td>
	</tr>
	<tr>
		<td align="right">Mailbox size limit: </td>
		<td colspan="2">
			<input type="text" class="wm_input" name="intMailboxSizeLimit" id="intMailboxSizeLimit" onchange="change();" style="width: 85px" value="<?php 
echo (int) $settings->MailboxSizeLimit;
Пример #16
0
    /**
     * @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;
        }
    }
Пример #17
0
		} else if (self.innerWidth) {
			w = self.innerWidth;
		}
		return w;
	}
	var infoCont = document.getElementById('info_cont');
	if (infoCont) {
		infoCont.style.right = 'auto';
		infoCont.style.left = Math.round((GetWidth() - infoCont.offsetWidth)/2) + 'px';
	}
</script>
<script type="text/javascript" src="langs.js.php?v=<?php 
    echo JS_VERS;
    ?>
&lang=<?php 
    echo ConvertUtils::AttributeQuote($account->DefaultLanguage);
    ?>
"></script>
<?php 
    if (USE_JS_GZIP && IS_SUPPORT_GZIP) {
        ?>
<script type="text/javascript" src="cache-loader.php?v=<?php 
        echo JS_VERS;
        ?>
&t=def"></script>
<script type="text/javascript" src="cache-loader.php?v=<?php 
        echo JS_VERS;
        ?>
&t=wm"></script>
<script type="text/javascript" src="cache-loader.php?v=<?php 
        echo JS_VERS;
Пример #18
0
/**
 * @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;
}
Пример #19
0
    function ToHTML()
    {
        $swicther = $this->_proc->account->AllowDhtmlEditor ? '
		<tr>
			<td></td>
			<td class="wm_html_editor_switcher">
				<a href="#" id="mode_switcher">' . JS_LANG_SwitchToPlainMode . '</a>
			</td>
		</tr>' : '';
        $senders = !$this->isSafety ? '<table class="wm_view_message" id="showpicturestable">
	<tr>
		<td class="wm_safety_info">
			<span class="">
				<span>' . PicturesBlocked . ' </span>
				<a href="#" onclick="ShowPictures()">' . ShowPictures . '</a>.</span>
			</span>
		</td>
	</tr>
</table>' : '';
        $ahref = array('', '', '');
        $aend = '';
        if ($this->_proc->settings->AllowContacts) {
            $ahref[0] = '<a href="#" onclick="PopupContacts(\'contactlist.php?f=1\');">';
            $ahref[1] = '<a href="#" onclick="PopupContacts(\'contactlist.php?f=2\');">';
            $ahref[2] = '<a href="#" onclick="PopupContacts(\'contactlist.php?f=3\');">';
            $aend = '</a>';
        }
        return $senders . '
<form action="" method="POST" id="messageForm">
<table class="wm_new_message">
		<tr>
			<td class="wm_new_message_title">' . JS_LANG_From . ': </td>
			<td>
				<input class="wm_input" tabindex="1" type="text" size="93" name="from" value="' . ConvertUtils::AttributeQuote($this->From) . '" />
				<input type="hidden" name="priority_input" id="priority_input" value="" />
				<input type="hidden" name="ishtml" id="ishtml" value="">
				' . $this->inputs . '
			</td>
		</tr>
		<tr>
			<td class="wm_new_message_title">' . $ahref[0] . JS_LANG_To . $aend . ': </td>
			<td>
				<input class="wm_input" autocomplete="on" tabindex="2" type="text" size="93" id="toemail" name="toemail" value="' . ConvertUtils::AttributeQuote($this->To) . '" />
			</td>
		</tr>
		<tr>
			<td class="wm_new_message_title">' . $ahref[1] . JS_LANG_CC . $aend . ': </td>
			<td><nobr>
				<input class="wm_input" tabindex="3" type="text" size="93" id="toCC" name="toCC" value="' . ConvertUtils::AttributeQuote($this->CC) . '" /><span>&nbsp;</span>
				<a href="#" onClick="ChangeBCCMode(); return false;" id="bcc_mode_switcher">' . JS_LANG_ShowBCC . '</a><nobr>
			</td>
		</tr>
		<tr class="wm_hide" id="bcc">
			<td class="wm_new_message_title">' . $ahref[2] . JS_LANG_BCC . $aend . ': </td>
			<td>
				<input class="wm_input" tabindex="4" type="text" size="93" name="toBCC" id="toBCC" value="" />
			</td>
		</tr>
		<tr>
			<td class="wm_new_message_title">' . JS_LANG_Subject . ': </td>
			<td>
				<input class="wm_input" tabindex="5" type="text" size="93" name="subject" id="subject" value="' . ConvertUtils::AttributeQuote($this->Subject) . '" />
			</td>
		</tr>
		<tr id="plain_mess">
			<td colspan="2">
				<div id="editor_cont" class="wm_input" style="width: 684px; height: 330px;">
					<textarea id="editor_area" style="width: 680px; height: 328px; border: 0px; border-left: solid 1px white;" name="message">' . $this->Body . '</textarea>
				</div>
			</td>
		</tr>
		' . $swicther . '
	</table>
	<table class="wm_new_message" id="attachmentTable">
	' . $this->attacmentsHtml . '
	</table>
	</form>
<table class="wm_new_message">
		<tr>
			<td colspan="2" class="wm_attach">
			<iframe class="wm_hide" src="" id="uploadIframe" name="uploadIframe"></iframe>
			<form action="upload.php" target="uploadIframe" method="POST" enctype="multipart/form-data">
				' . JS_LANG_AttachFile . ': 
				<input class="wm_file" type="file" name="fileupload" />
				<input class="wm_button" type="submit" name="attachbtn" value="' . ConvertUtils::AttributeQuote(JS_LANG_Attach) . '" />
			</form>
			</td>
		</tr>
  	</table>
';
    }
Пример #20
0
			<input type="checkbox" class="wm_checkbox" onchange="change();" name="intAllowUsersChangeSkin" id="intAllowUsersChangeSkin" value="1" <?php 
echo (bool) $settings->AllowUsersChangeSkin ? 'checked="checked"' : '';
?>
 />
			<label for="intAllowUsersChangeSkin">Allow users to change skin</label>
		</td>
	</tr>
	<tr>
		<td align="right">Default language: </td>
		<td>
			<select name="txtDefaultLanguage" class="wm_input" onchange="change();" style="width: 150px;">
			<?php 
$langList =& FileSystem::GetLangList();
for ($i = 0, $c = count($langList); $i < $c; $i++) {
    $temp = $settings->DefaultLanguage == $langList[$i] ? 'selected="selected"' : '';
    echo '<option value="' . ConvertUtils::AttributeQuote($langList[$i]) . '" ' . $temp . '> ' . $langList[$i] . '</option>' . "\n";
}
?>
			</select>
		</td>
	</tr>
	<tr>
		<td align="right">&nbsp;</td>
		<td>
			<input type="checkbox" class="wm_checkbox" name="intAllowUsersChangeLanguage" onchange="change();" id="intAllowUsersChangeLanguage" value="1" <?php 
echo (bool) $settings->AllowUsersChangeLanguage ? 'checked="checked"' : '';
?>
 />
			<label for="intAllowUsersChangeLanguage">Allow users to change interface language</label>
		</td>
	</tr>