Implemented files printing
This commit is contained in:
parent
ef663058c7
commit
b40f2aaadf
5 changed files with 26 additions and 3 deletions
|
@ -567,6 +567,9 @@ kolab_files_frame_load = function(frame)
|
|||
|
||||
if (rcmail.file_editor)
|
||||
rcmail.enable_command('files-edit', true);
|
||||
|
||||
rcmail.enable_command('files-print', (rcmail.file_editor && rcmail.file_editor.printable) ||
|
||||
(rcmail.env.file_data && /^image\//i.test(rcmail.env.file_data.type)));
|
||||
};
|
||||
|
||||
|
||||
|
@ -695,6 +698,21 @@ rcube_webmail.prototype.files_save = function()
|
|||
file_api.file_save(this.env.file, content);
|
||||
};
|
||||
|
||||
rcube_webmail.prototype.files_print = function()
|
||||
{
|
||||
if (this.file_editor && this.file_editor.printable)
|
||||
this.file_editor.print();
|
||||
else if (/^image\//i.test(this.env.file_data.type)) {
|
||||
var frame = $('#fileframe').get(0),
|
||||
win = frame ? frame.contentWindow : null;
|
||||
|
||||
if (win) {
|
||||
win.focus();
|
||||
win.print();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
rcube_webmail.prototype.files_set_quota = function(p)
|
||||
{
|
||||
if (p.total) {
|
||||
|
|
|
@ -700,15 +700,14 @@ class kolab_files_engine
|
|||
|
||||
$this->plugin->add_label('filedeleteconfirm', 'filedeleting', 'filedeletenotice');
|
||||
|
||||
// this one is for styling purpose
|
||||
$this->rc->output->set_env('extwin', true);
|
||||
|
||||
// register template objects for dialogs (and main interface)
|
||||
$this->rc->output->add_handlers(array(
|
||||
'fileinfobox' => array($this, 'file_info_box'),
|
||||
'filepreviewframe' => array($this, 'file_preview_frame'),
|
||||
));
|
||||
|
||||
// this one is for styling purpose
|
||||
$this->rc->output->set_env('extwin', true);
|
||||
$this->rc->output->set_env('file', $file);
|
||||
$this->rc->output->set_env('file_data', $this->file_data);
|
||||
$this->rc->output->set_pagetitle(rcube::Q($file));
|
||||
|
|
|
@ -32,6 +32,7 @@ $labels['edit'] = 'Edit';
|
|||
$labels['editfile'] = 'Edit file';
|
||||
$labels['save'] = 'Save';
|
||||
$labels['savefile'] = 'Save file';
|
||||
$labels['printfile'] = 'Print file';
|
||||
$labels['fileedit'] = 'File properties';
|
||||
|
||||
$labels['collection_audio'] = 'Audio';
|
||||
|
|
|
@ -50,6 +50,10 @@
|
|||
background-position: center -213px;
|
||||
}
|
||||
|
||||
#filestoolbar a.button.print {
|
||||
background: url(../../../../skins/larry/images/buttons.png) center -810px no-repeat;
|
||||
}
|
||||
|
||||
#filestoolbar form {
|
||||
display: inline;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<roundcube:button command="files-edit" type="link" class="button edit disabled" classAct="button edit" classSel="button edit pressed" label="kolab_files.edit" title="kolab_files.editfile" />
|
||||
<roundcube:button command="files-save" type="link" class="button save disabled" classAct="button save" classSel="button save pressed" label="kolab_files.save" title="kolab_files.savefile" style="display:none" />
|
||||
<roundcube:button command="files-delete" type="link" class="button delete disabled" classAct="button delete" classSel="button delete pressed" label="delete" title="kolab_files.deletefile" />
|
||||
<roundcube:button command="files-print" type="link" class="button print disabled" classAct="button print" classSel="button print pressed" label="print" title="kolab_files.printfile" />
|
||||
</div>
|
||||
|
||||
<div id="fileinfobox" class="uibox listbox">
|
||||
|
|
Loading…
Add table
Reference in a new issue