<?
if(VALID_DOCUMENT != 1) die('what?');
$max_email_count = 3;
?>
<a href="<?=$_SERVER['PHP_SELF']?>?action=show-folder&mailbox=<?=$this->mailbox_name?>&return=ok"><?=$this->mailbox_name_print?></a>
<div style="<?=HEADER_STYLE?>">
<div style="<?=SMALL_STYLE?>">
<?=$this->header->date_print(true)?>
</div>
<div style="<?=BOLD_STYLE?>">
<?='Message № '.$this->key.' of '.$this->_mailbox->num_msgs?>
</div>
<table width="98%" cellspacing="0" cellpadding="1">
<tr>
<td style="<?=TH_STYLE?>">From:</td>
<td width="100%"><?=$this->header->from_print(false,false)?></td>
</tr>
<?if($this->ifnntp){?>
<tr>
<td style="<?=TH_STYLE?>">News:</td>
<td width="100%"><?=$this->header->newsgroups?></td>
</tr>
<?}?>
<? $tmp = "";
for($i=0;$i<min($this->header->to_count,$max_email_count);$i++){
$tmp .= $this->header->to_print($i,false,false).'<br/>';
}
if($max_email_count<$this->header->to_count) $tmp .= '... more '.($this->header->to_count-$max_email_count);
if($tmp){?>
<tr>
<td style="<?=TH_STYLE?>">To:</td>
<td width="100%"><?=$tmp?></td>
</tr>
<?}?>
<? $tmp = "";
for($i=0;$i<min($this->header->cc_count,$max_email_count);$i++){
$tmp .= $this->header->cc_print($i,false,false).'<br/>';
}
if($max_email_count<$this->header->cc_count) $tmp .= '... more '.($this->header->cc_count-$max_email_count);
if($tmp){?>
<tr>
<td style="<?=TH_STYLE?>">Cc:</td>
<td width="100%"><?=$tmp?></td>
</tr>
<?}?>
<tr>
<td style="<?=TH_STYLE?>">Subj:</td>
<td width="100%"><?=$this->header->subject_print()?></td>
</tr>
</table>
<?if(array_not_empty($this->header->labels)){foreach($this->header->labels as $k){
$l = $_SESSION['labels']->find($k);
?>
<span style="color: <?=$l['color']?>"><?=$l['name']?></span>
<?}}?>
</div>
<?foreach($this->parts as $index=>$part){
if($part->if_simple_printable()){?>
<?=$part->get_simple_presentation($this->mailbox_name,$this->key)?>
<hr/>
<?}}?>
<?$attachments_count=0;
reset($this->parts);
foreach($this->parts as $index=>$part){
if($part->if_attachment()){
if(!$part->if_text_multipart()) $attachments_count++;
if($attachments_count==1) print '<br/><b>Attachments:</b><br/>';
?>
<?=$part->get_simple_presentation($this->mailbox_name,$this->key)?>
<hr/>
<?}}?>
<div style="<?=HEADER_STYLE?>">
<?/*?>
<script type="text/javascript">
<!--
function setLabelByCheckbox(form,chk,label){
if(chk.checked){
form['action'].value = "set-label";
}
else{
form['action'].value = "remove-label";
}
form['label'].value = label;
form.submit();
}
//-->
</script>
<form action="<?=$_SERVER['PHP_SELF']?>" method="get">
<input type="hidden" name="action"/>
<input type="hidden" name="mailbox" value="<?=$this->mailbox_name?>"/>
<input type="hidden" name="mailkey" value="<?=$this->key?>"/>
<input type="hidden" name="key" value="<?=$this->key?>"/>
<input type="hidden" name="label"/>
<?foreach($GLOBALS['LABEL_PROPERTIES'] as $k=>$v){?>
<input type="checkbox" <?=(in_array($k,$this->header->labels)?'checked="checked"':'')?> onclick="setLabelByCheckbox(this.form,this,'<?=$k?>');"/>
<span style="color: <?=$v['color']?>"><?=$v['name']?></span>
<?}?>
</form>
<?*/?>
<?$this->print_controls_table()?>
</div>