Cleanup attachment viewer: show filename, size and download button
This commit is contained in:
parent
631f19ca5e
commit
e25891ffa6
5 changed files with 78 additions and 76 deletions
|
@ -993,7 +993,9 @@ class calendar extends rcube_plugin
|
||||||
|
|
||||||
// show part page
|
// show part page
|
||||||
if (!empty($_GET['_frame'])) {
|
if (!empty($_GET['_frame'])) {
|
||||||
$this->rc->output->add_handlers(array('attachmentframe' => array($this, 'attachment_frame')));
|
$this->attachment = $attachment;
|
||||||
|
$this->register_handler('plugin.attachmentframe', array($this, 'attachment_frame'));
|
||||||
|
$this->register_handler('plugin.attachmentcontrols', array($this->ui, 'attachment_controls'));
|
||||||
$this->rc->output->send('calendar.attachment');
|
$this->rc->output->send('calendar.attachment');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -664,6 +664,7 @@ class database_driver extends calendar_driver
|
||||||
$event['allday'] = intval($event['all_day']);
|
$event['allday'] = intval($event['all_day']);
|
||||||
$event['free_busy'] = $free_busy_map[$event['free_busy']];
|
$event['free_busy'] = $free_busy_map[$event['free_busy']];
|
||||||
$event['calendar'] = $event['calendar_id'];
|
$event['calendar'] = $event['calendar_id'];
|
||||||
|
$event['recurrence_id'] = intval($event['recurrence_id']);
|
||||||
|
|
||||||
// parse recurrence rule
|
// parse recurrence rule
|
||||||
if ($event['recurrence'] && preg_match_all('/([A-Z]+)=([^;]+);?/', $event['recurrence'], $m, PREG_SET_ORDER)) {
|
if ($event['recurrence'] && preg_match_all('/([A-Z]+)=([^;]+);?/', $event['recurrence'], $m, PREG_SET_ORDER)) {
|
||||||
|
|
|
@ -520,4 +520,22 @@ class calendar_ui
|
||||||
return html::tag('ul', $attrib, '', html::$common_attrib);
|
return html::tag('ul', $attrib, '', html::$common_attrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function attachment_controls($attrib = array())
|
||||||
|
{
|
||||||
|
$table = new html_table(array('cols' => 3));
|
||||||
|
|
||||||
|
if (!empty($this->calendar->attachment['name'])) {
|
||||||
|
$table->add('title', Q(rcube_label('filename')));
|
||||||
|
$table->add(null, Q($this->calendar->attachment['name']));
|
||||||
|
$table->add(null, '[' . html::a('?'.str_replace('_frame=', '_download=', $_SERVER['QUERY_STRING']), Q(rcube_label('download'))) . ']');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($this->calendar->attachment['size'])) {
|
||||||
|
$table->add('title', Q(rcube_label('filesize')));
|
||||||
|
$table->add(null, Q(show_bytes($this->calendar->attachment['size'])));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $table->show($attrib);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,68 +247,75 @@ a.miniColors-trigger {
|
||||||
margin-top: -3px;
|
margin-top: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#attachmentcontainer
|
#attachmentcontainer {
|
||||||
{
|
position: absolute;
|
||||||
position: absolute;
|
top: 80px;
|
||||||
top: 80px;
|
left: 20px;
|
||||||
left: 20px;
|
right: 20px;
|
||||||
right: 20px;
|
bottom: 20px;
|
||||||
bottom: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#attachmentframe
|
#attachmentframe {
|
||||||
{
|
width: 100%;
|
||||||
width: 100%;
|
height: 100%;
|
||||||
height: 100%;
|
border: 1px solid #999999;
|
||||||
border: 1px solid #999999;
|
background-color: #F9F9F9;
|
||||||
background-color: #F9F9F9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachments-list ul
|
#partheader {
|
||||||
{
|
position: absolute;
|
||||||
margin: 0px;
|
top: 20px;
|
||||||
padding: 0px;
|
left: 220px;
|
||||||
list-style-image: none;
|
right: 20px;
|
||||||
list-style-type: none;
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachments-list ul li
|
#partheader table td {
|
||||||
{
|
padding-left: 2px;
|
||||||
height: 18px;
|
padding-right: 4px;
|
||||||
font-size: 12px;
|
vertical-align: middle;
|
||||||
padding-left: 2px;
|
font-size: 11px;
|
||||||
padding-top: 2px;
|
|
||||||
padding-right: 4px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
-o-text-overflow: ellipsis;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachments-list ul li img
|
|
||||||
{
|
.attachments-list ul {
|
||||||
padding-right: 2px;
|
margin: 0px;
|
||||||
vertical-align: middle;
|
padding: 0px;
|
||||||
|
list-style-image: none;
|
||||||
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachments-list ul li a
|
.attachments-list ul li {
|
||||||
{
|
height: 18px;
|
||||||
text-decoration: none;
|
font-size: 12px;
|
||||||
|
padding-left: 2px;
|
||||||
|
padding-top: 2px;
|
||||||
|
padding-right: 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachments-list ul li a:hover
|
.attachments-list ul li img {
|
||||||
{
|
padding-right: 2px;
|
||||||
text-decoration: underline;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#eventshow .attachments-list ul
|
.attachments-list ul li a {
|
||||||
{
|
text-decoration: none;
|
||||||
display: block;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#eventshow .attachments-list ul li
|
.attachments-list ul li a:hover {
|
||||||
{
|
text-decoration: underline;
|
||||||
float: left;
|
}
|
||||||
|
|
||||||
|
#eventshow .attachments-list ul {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#eventshow .attachments-list ul li {
|
||||||
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,8 @@
|
||||||
<roundcube:include file="/includes/header.html" />
|
<roundcube:include file="/includes/header.html" />
|
||||||
|
|
||||||
<div id="partheader">
|
<div id="partheader">
|
||||||
<!--
|
<roundcube:object name="plugin.attachmentcontrols" cellpadding="2" cellspacing="0" />
|
||||||
<roundcube:object name="attachmentControls" cellpadding="2" cellspacing="0" />
|
|
||||||
-->
|
|
||||||
<div style="position:absolute; top:2px; right:0; width:12em; text-align:right">
|
<div style="position:absolute; top:2px; right:0; width:12em; text-align:right">
|
||||||
[<a href="#close" class="closelink" onclick="self.close()"><roundcube:label name="close" /></a>]
|
[<a href="#close" class="closelink" onclick="self.close()"><roundcube:label name="close" /></a>]
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,34 +18,9 @@
|
||||||
|
|
||||||
|
|
||||||
<div id="attachmentcontainer">
|
<div id="attachmentcontainer">
|
||||||
<roundcube:object name="attachmentFrame" id="attachmentframe" width="100%" height="100%" />
|
<roundcube:object name="plugin.attachmentframe" id="attachmentframe" width="100%" height="100%" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title><roundcube:object name="pagetitle" /></title>
|
|
||||||
<roundcube:include file="/includes/links.html" />
|
|
||||||
</head>
|
|
||||||
<body class="extwin">
|
|
||||||
|
|
||||||
<roundcube:include file="/includes/header.html" />
|
|
||||||
|
|
||||||
<div id="partheader">
|
|
||||||
<!--
|
|
||||||
<roundcube:object name="attachmentControls" cellpadding="2" cellspacing="0" />
|
|
||||||
-->
|
|
||||||
<div style="position:absolute; top:2px; right:0; width:12em; text-align:right">
|
|
||||||
[<a href="#close" class="closelink" onclick="self.close()"><roundcube:label name="close" /></a>]
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="attachmentcontainer">
|
|
||||||
<roundcube:object name="attachmentFrame" id="attachmentframe" width="100%" height="100%" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue