diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js
index 7b6bb6dfa9..63fa076091 100644
--- a/api/js/etemplate/et2_extension_nextmatch.js
+++ b/api/js/etemplate/et2_extension_nextmatch.js
@@ -2140,6 +2140,31 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
return;
}
+ // Set CSS for orientation
+ this.div.addClass(value.orientation);
+ this.egw().set_preference(app,pref+'_orientation',value.orientation);
+
+
+ // Try to tell browser about orientation
+ var css = '@page { size: '+ value.orientation + '; }',
+ head = document.head || document.getElementsByTagName('head')[0],
+ style = document.createElement('style');
+
+ style.type = 'text/css';
+ style.media = 'print';
+
+ if (style.styleSheet){
+ style.styleSheet.cssText = css;
+ } else {
+ style.appendChild(document.createTextNode(css));
+ }
+
+ head.appendChild(style);
+ this.orientation_style = style;
+
+ // Trigger resize, so we can fit on a page
+ this.dynheight.outerNode.css('max-width',this.div.css('max-width'));
+
// Handle columns
this.set_columns(value.columns);
this.egw().set_preference(app,pref,value.columns);
@@ -2257,7 +2282,8 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
value: {
content: {
row_count: Math.min(100,total),
- columns: this.egw().preference(pref,app) || columns_selected
+ columns: this.egw().preference(pref,app) || columns_selected,
+ orientation: this.egw().preference(pref+'_orientation',app)
},
sel_options: {
columns: columns
@@ -2274,7 +2300,9 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
*/
afterPrint: function() {
- this.div.removeClass('print');
+ this.div.removeClass('print landscape portrait');
+ jQuery(this.orientation_style).remove();
+ delete this.orientation_style;
// Put scrollbar back
jQuery('.egwGridView_scrollarea',this.div).css('overflow-y','');
diff --git a/api/src/Etemplate.php b/api/src/Etemplate.php
index 4b804248d3..37ebcaf37c 100644
--- a/api/src/Etemplate.php
+++ b/api/src/Etemplate.php
@@ -261,7 +261,7 @@ class Etemplate extends Etemplate\Widget\Template
echo $GLOBALS['egw']->framework->header();
if ($output_mode != 2 && !$GLOBALS['egw_info']['flags']['nonavbar'])
{
- parse_navbar();
+ $GLOBALS['egw']->framework->navbar();
}
else // mark popups as such, by enclosing everything in div#popupMainDiv
{
diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css
index 74b49cc77a..ad881eec9f 100644
--- a/api/templates/default/etemplate2.css
+++ b/api/templates/default/etemplate2.css
@@ -555,9 +555,13 @@ for printing
.et2_nextmatch.print > div {
height: auto !important;
}
-.et2_nextmatch.print {
+.et2_nextmatch.print.landscape {
/* This is fairly arbitrary, but makes it fit in Chrome and Firefox*/
- max-width: 700pt !important;
+ max-width: 710pt !important;
+}
+.et2_nextmatch.print.portrait {
+ /* This is fairly arbitrary, but makes it fit in Chrome and Firefox*/
+ max-width: 570pt !important;
}
/**
* Diff widget
diff --git a/api/templates/default/nm_print_dialog.xet b/api/templates/default/nm_print_dialog.xet
index 03af10c742..9bd3c96637 100644
--- a/api/templates/default/nm_print_dialog.xet
+++ b/api/templates/default/nm_print_dialog.xet
@@ -7,6 +7,7 @@
+
\ No newline at end of file