display: control attachmentdiv and displayareadiv class by code, to hide attachmentarea, when no attachments are present

This commit is contained in:
Klaus Leithoff 2013-10-11 09:28:33 +00:00
parent fe217e5458
commit 4354a02fbd
4 changed files with 32 additions and 19 deletions

View File

@ -1151,21 +1151,21 @@ class mail_compose
// if no filemanager -> no vfsFileSelector // if no filemanager -> no vfsFileSelector
if (!$GLOBALS['egw_info']['user']['apps']['filemanager']) if (!$GLOBALS['egw_info']['user']['apps']['filemanager'])
{ {
$content['vfsNotAvailable'] = "mail-index_quotaDisplayNone"; $content['vfsNotAvailable'] = "mail_DisplayNone";
} }
// if no infolog -> no save as infolog // if no infolog -> no save as infolog
if (!$GLOBALS['egw_info']['user']['apps']['infolog']) if (!$GLOBALS['egw_info']['user']['apps']['infolog'])
{ {
$content['noInfologAvailable'] = "mail-index_quotaDisplayNone"; $content['noInfologAvailable'] = "mail_DisplayNone";
} }
// if no tracker -> no save as tracker // if no tracker -> no save as tracker
if (!$GLOBALS['egw_info']['user']['apps']['tracker']) if (!$GLOBALS['egw_info']['user']['apps']['tracker'])
{ {
$content['noTrackerAvailable'] = "mail-index_quotaDisplayNone"; $content['noTrackerAvailable'] = "mail_DisplayNone";
} }
if (!$GLOBALS['egw_info']['user']['apps']['infolog'] && !$GLOBALS['egw_info']['user']['apps']['tracker']) if (!$GLOBALS['egw_info']['user']['apps']['infolog'] && !$GLOBALS['egw_info']['user']['apps']['tracker'])
{ {
$content['noSaveAsAvailable'] = "mail-index_quotaDisplayNone"; $content['noSaveAsAvailable'] = "mail_DisplayNone";
} }
// composeID to detect if we have changes to certain content // composeID to detect if we have changes to certain content
$preserv['composeID'] = $content['composeID'] = $this->composeID; $preserv['composeID'] = $content['composeID'] = $this->composeID;

View File

@ -251,8 +251,8 @@ class mail_ui
$content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = ""; $content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = "";
} else { } else {
$content[self::$nm_index]['quota'] = $sel_options[self::$nm_index]['quota'] = lang("Quota not provided by server"); $content[self::$nm_index]['quota'] = $sel_options[self::$nm_index]['quota'] = lang("Quota not provided by server");
$content[self::$nm_index]['quotaclass'] = $sel_options[self::$nm_index]['quotaclass'] = "mail-index_quotaDisplayNone"; $content[self::$nm_index]['quotaclass'] = $sel_options[self::$nm_index]['quotaclass'] = "mail_DisplayNone";
$content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = "mail-index_quotaDisplayNone"; $content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = "mail_DisplayNone";
} }
$sel_options[self::$nm_index]['foldertree'] = $this->getFolderTree(false); $sel_options[self::$nm_index]['foldertree'] = $this->getFolderTree(false);
@ -1706,6 +1706,8 @@ unset($query['actions']);
//_debug_array($attachments); //_debug_array($attachments);
$content['mail_displayattachments'] = $attachmentHTMLBlock; $content['mail_displayattachments'] = $attachmentHTMLBlock;
$content['mail_id']=$rowID; $content['mail_id']=$rowID;
$content['mailDisplayContainerClass']=(count($attachments)?"mailDisplayContainer mailDisplayContainerFixedHeight":"mailDisplayContainer mailDisplayContainerFullHeight");
$content['mailDisplayAttachmentsClass']=(count($attachments)?"mailDisplayAttachments":"mail_DisplayNone");
//_debug_array($content); //_debug_array($content);
$readonlys = $preserv = $content; $readonlys = $preserv = $content;
$etpl->exec('mail.mail_ui.displayMessage',$content,$sel_options,$readonlys,$preserv,2); $etpl->exec('mail.mail_ui.displayMessage',$content,$sel_options,$readonlys,$preserv,2);
@ -2432,7 +2434,7 @@ blockquote[type=cite] {
color: blue; color: blue;
} }
</style> </style>
<div style="height:100%;width:100%; background-color:white; padding:0px; margin:0px;"> <div class="mailDisplayBody">
<table width="100%" style="table-layout:fixed"><tr><td class="td_display">'; <table width="100%" style="table-layout:fixed"><tr><td class="td_display">';
$EndBody = '</td></tr></table></div>'; $EndBody = '</td></tr></table></div>';

View File

@ -293,6 +293,9 @@ pre {
width:200px !important; width:200px !important;
z-index:99; z-index:99;
} }
.mail_DisplayNone {
display: none !important;
}
.mail-index_quotaDisplayNone { .mail-index_quotaDisplayNone {
display: none !important; display: none !important;
} }
@ -384,8 +387,8 @@ input[type=button] {
padding: 0px; padding: 0px;
height: 16px !important; height: 16px !important;
} }
#mail-display_toolbar { #mail-compose_toolbar > button {
padding: 0px; padding: .2em .4em;
} }
#mail-display_toolbar > button > span { #mail-display_toolbar > button > span {
padding: .2em .4em; padding: .2em .4em;
@ -421,7 +424,7 @@ input[type=button] {
} }
#mail-index_previewAttachmentArea { #mail-index_previewAttachmentArea {
background-color:#efefdf; background-color:#efefdf;
max-height: 10%; max-height: 3em;
max-width: 50%; max-width: 50%;
position: absolute; position: absolute;
overflow:scroll; overflow:scroll;
@ -453,15 +456,26 @@ input[type=button] {
overflow-y: auto; overflow-y: auto;
border: 1px solid silver; border: 1px solid silver;
top: 120px; top: 120px;
bottom: 100px; }
.mailDisplayContainerFixedHeight {
bottom: 123px;
}
.mailDisplayContainerFullHeight {
bottom: .1em;
}
.mailDisplayBody {
height:100%;
width:100%;
background-color:white;
padding:0px;
margin:0px;
} }
.mailDisplayAttachments { .mailDisplayAttachments {
background-color:#efefdf; background-color:#efefdf;
max-height: 10%; height: 121px;
position: fixed; position: fixed;
bottom: 26px; bottom: .1em;
border: 1px solid red; border: 1px solid red;
border-bottom: 0px;
opacity: 1; opacity: 1;
-moz-opacity:1: -moz-opacity:1:
filter: Alpha(opacity=100); filter: Alpha(opacity=100);

View File

@ -33,15 +33,12 @@
<description value="Subject"/> <description value="Subject"/>
<description align="left" id="mail_displaysubject" readonly="true"/> <description align="left" id="mail_displaysubject" readonly="true"/>
</hbox> </hbox>
<hbox class="mail_displayicons">
<html id="mail_displayicons"/>
</hbox>
</vbox> </vbox>
<vbox class="mailDisplay" width="100%"> <vbox class="mailDisplay" width="100%">
<box class="mailDisplayContainer"> <box class="$cont[mailDisplayContainerClass]">
<html id="mail_displaybody"/> <html id="mail_displaybody"/>
</box> </box>
<box class="mailDisplayAttachments"> <box class="$cont[mailDisplayAttachmentsClass]">
<html id="mail_displayattachments"/> <html id="mail_displayattachments"/>
</box> </box>
</vbox> </vbox>