Permalink
Browse files

Added layouts to message; nothing really works yet

  • Loading branch information...
1 parent eaf0099 commit 78da06f6952844a0dc1ac07fb1442e1717ec34fd Michal Migurski committed Apr 5, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −0 site/lib/lib.compose.php
  2. +1 −1 site/templates/print.xml.tpl
View
3 site/lib/lib.compose.php
@@ -260,6 +260,7 @@ function compose_from_postvars(&$dbh, $post, $user_id)
$text = trim(sprintf("%s\n\n%s", $post['atlas_title'], $post['atlas_text']));
$message['pages'][] = array('zoom' => $mmap->coordinate->zoom,
+ 'layout' => $print['layout'],
'number' => $key,
'provider' => $provider,
'bounds' => $bounds,
@@ -278,6 +279,7 @@ function compose_from_postvars(&$dbh, $post, $user_id)
$mmap = create_mmap_from_bounds($paper_size, $orientation, $print['north'], $print['west'], $print['south'], $print['east'], $layout);
$index = array('number' => 'i',
+ 'layout' => 'full-page',
'zoom' => $mmap->coordinate->zoom,
'bounds' => get_mmap_bounds($mmap, 0.1),
'provider' => $provider,
@@ -485,6 +487,7 @@ function compose_from_geojson(&$dbh, $data)
$page = add_print_page($dbh, $print['id'], $_page['number']);
$page['text'] = $_page['text'];
+ $page['layout'] = $print['layout']; // TODO: this should be settable per-page
$page['provider'] = $_page['provider'];
$page['zoom'] = $_page['zoom'];
View
2 site/templates/print.xml.tpl
@@ -1,5 +1,5 @@
<print id="{$print.id|escape}{if $print.selected_page}/{$print.selected_page.page_number|escape}{/if}" user="{$print.user_id|escape}" href="http://{$domain}{$base_dir}/print.php?id={$print.id|escape:"url"}{if $print.selected_page}/{$print.selected_page.page_number|escape:"url"}{/if}">
- <paper size="{$print.paper_size|escape}" orientation="{$print.orientation|escape}" layout="{$print.layout|escape}" />
+ <paper size="{$print.paper_size|escape}" orientation="{$print.orientation|escape}" layout="{if $print.selected_page}{$print.selected_page.layout|escape}{else}{$print.layout|escape}{/if}" />
<provider>{$print.provider|escape}</provider>
<preview href="{if $print.selected_page}{$print.selected_page.preview_url|escape}{else}{$print.preview_url|escape}{/if}" />
<pdf href="{$print.pdf_url|escape}" />

0 comments on commit 78da06f

Please sign in to comment.