167 lines
7.0 KiB
PHP
167 lines
7.0 KiB
PHP
<?php
|
|
|
|
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
|
|
// Copyright (C) 2005-2013 Solomon Peachy (pizza@shaftnet.org)
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation; either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program; if not, write to the Free Software
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
include_once "include/config.php";
|
|
include_once "include/common.php";
|
|
include_once "include/site.php";
|
|
include_once "include/print.ps.php";
|
|
include_once "include/orderby.php";
|
|
|
|
$database = site_prolog(PO_USER_TYPE_USER);
|
|
|
|
$print_type = $_REQUEST['print_type'];
|
|
|
|
$photos_in_spooler = pg_query($database, "select photo.identifier, photo.caption, album_content.version from album_content, photo where photo.identifier=album_content.photo and album_content.album = $po_user[spool_album] group by photo.identifier, photo.folder, photo.caption, album_content.version");
|
|
|
|
$num_photos = pg_num_rows($photos_in_spooler);
|
|
|
|
site_header($strings['generic_print']);
|
|
site_navigator(5);
|
|
site_navigator_status("", $strings['spool_photos_in'] ." : $num_photos");
|
|
|
|
$all_papers = pg_query($database, "select identifier, name, size_x, size_y from paper");
|
|
|
|
if (isset($_REQUEST['paper']))
|
|
$po_options['paper'] = $_REQUEST['paper'];
|
|
|
|
$left_margin = 20;
|
|
$top_margin = 20;
|
|
$right_margin = 20;
|
|
$bottom_margin = 20;
|
|
$columns = 4;
|
|
$x_space = 5;
|
|
$y_space = 2;
|
|
$x_size = 0;
|
|
$y_size = 0;
|
|
|
|
$current_paper = pg_fetch_row(pg_query($database, "select name, size_x, size_y from paper where identifier=$po_options[paper]"));
|
|
|
|
$paper_name = $current_paper[0];
|
|
$paper_width = $current_paper[1];
|
|
$paper_height = $current_paper[2];
|
|
|
|
print "<form method=\"post\" action=\"print.2.php\" accept-charset=\"".$strings['formats_encoding']."\">\n";
|
|
print $strings['label_paper_size'] .": \n";
|
|
print "<select onchange=\"location = 'print.php?print_type=$print_type&paper=' + this.options[this.selectedIndex].value;\">\n";
|
|
for ($i=0; $i < pg_num_rows($all_papers); $i++) {
|
|
$papers = pg_fetch_row($all_papers, $i);
|
|
print emit_option("$papers[0]", $papers[1], $papers[0] == $po_options['paper']);
|
|
}
|
|
print "</select>\n";
|
|
|
|
print "<input type=\"hidden\" name=\"x_space\" value=\"$x_space\"/>\n";
|
|
print "<input type=\"hidden\" name=\"y_space\" value=\"$y_space\"/>\n";
|
|
print "<input type=\"hidden\" name=\"x_size\" value=\"$x_size\"/>\n";
|
|
print "<input type=\"hidden\" name=\"y_size\" value=\"$y_size\"/>\n";
|
|
|
|
print "<table class=\"print\"><tr>\n";
|
|
print "<th align=\"center\" colspan=\"3\">".$strings['label_margin']."</td><th> </th>\n";
|
|
print "<th align=\"center\">".$strings['label_columns']."</th><th> </th>\n";
|
|
print "<th align=\"center\" colspan=\"2\">".$strings['label_spacing']."</th><th> </th>\n";
|
|
print "<th align=\"center\" colspan=\"3\">".$strings['label_orientation']."</th>\n";
|
|
print "</tr>";
|
|
print "<tr>\n<td></td><td align=\"center\">";
|
|
print "<input type=\"text\" name=\"top_margin\" value=\"$top_margin\" size=\"4\"/></td><td></td><td></td>";
|
|
print "<td align=\"center\" >";
|
|
print "<select name=\"columns\">\n";
|
|
for ($i=1; $i < 11; $i++) {
|
|
print emit_option($i, $i, $columns == $i);
|
|
}
|
|
print "</select>\n";
|
|
print "</td>\n";
|
|
print "<td></td>\n";
|
|
print "<td></td>\n";
|
|
print "<td align=\"center\"><input type=\"text\" name=\"x_space\" value=\"$x_space\" size=\"4\"/>\n</td>\n";
|
|
print "<td></td>\n";
|
|
print "<td align=\"center\">".emit_radio_item("orientation", "0", true).$strings['label_portrait'] ."</td>\n";
|
|
print "<td> </td>";
|
|
print "<td align=\"center\">".emit_radio_item("orientation", "1", false).$strings['label_landscape'] ."</td>\n";
|
|
print "</tr>\n";
|
|
print "<tr>\n<td align=\"center\">\n<input type=\"text\" name=\"left_margin\" value=\"$left_margin\" size=\"4\" align=\"right\"/>\n</td>\n";
|
|
print "<td>\n<img src=\"themes/print.layout.gif\" alt=\"\"/>\n</td>";
|
|
print "<td align=\"center\">\n<input type=\"text\" name=\"right_margin\" value=\"$right_margin\" size=\"4\"/>\n</td>\n";
|
|
|
|
print "<td></td>\n";
|
|
print "<td><img src=\"themes/print.layout.4.gif\" alt=\"\" />\n</td>";
|
|
print "<td></td>\n";
|
|
print "<td><input type=\"text\" name=\"y_space\" value=\"$y_space\" size=\"4\" align=\"right\"/></td>\n";
|
|
print "<td><img src=\"themes/print.layout.spacing.gif\" alt=\"\" />\n</td>";
|
|
print "<td></td>\n";
|
|
print "<td><img src=\"themes/print.orient.portrait.gif\" alt=\"\" /></td>";
|
|
print "<td></td>\n";
|
|
|
|
print "<td><img src=\"themes/print.orient.landscape.gif\" alt=\"\" /></td>";
|
|
print "</tr>\n";
|
|
print "<tr>\n<td></td><td align=\"center\"><input type=\"text\" name=\"bottom_margin\" value=\"$bottom_margin\" size=\"4\"/>\n</td><td></td>\n";
|
|
print "<td colspan=\"9\"></td>\n";
|
|
print "</tr></table>\n";
|
|
|
|
print "<p>".$strings['label_details']."</p>";
|
|
|
|
print "<table class=\"folder\"><tr><td width=\"33%\">\n";
|
|
|
|
if ($print_type == "brochure") {
|
|
print emit_checkbox_item("display_image", "yes", "", true) . $strings['generic_image']."<br/>\n";
|
|
}
|
|
$list = array ("barcode", "title", "caption", "location",
|
|
"copyright", "camera" );
|
|
foreach ($list as $item) {
|
|
print emit_checkbox_item("display_$item", "yes", "", true) . $strings["generic_$item"]."<br/>\n";
|
|
}
|
|
|
|
print "</td><td width=\"33%\">";
|
|
|
|
$list = array ("camera", "camera_program", "camera_metering", "shutter",
|
|
"aperture", "exp_comp" );
|
|
foreach ($list as $item) {
|
|
print emit_checkbox_item("display_$item", "yes", "", true) . $strings["generic_$item"]."<br/>\n";
|
|
}
|
|
|
|
print "</td><td width=\"33%\">";
|
|
|
|
$list = array ("focal_length", "flash_mode", "flash_comp", "iso",
|
|
"iso_override", );
|
|
foreach ($list as $item) {
|
|
print emit_checkbox_item("display_$item", "yes", "", true) . $strings["generic_$item"]."<br/>\n";
|
|
}
|
|
|
|
print "</td></tr></table>\n";
|
|
|
|
print "<p>".$strings['label_output'].":\n";
|
|
print emit_print_format_combo("output_format", $po_options['print_out']);
|
|
print " ".$strings['generic_order_by'].": \n";
|
|
display_order_by_combo(5);
|
|
print "</p>";
|
|
|
|
print "<input type=\"hidden\" name=\"x_paper\" value=\"$paper_width\"/>\n";
|
|
print "<input type=\"hidden\" name=\"y_paper\" value=\"$paper_height\"/>\n";
|
|
print "<input type=\"hidden\" name=\"paper_name\" value=\"$paper_name\"/>\n";
|
|
print "<input type=\"hidden\" name=\"print_type\" value=\"$print_type\"/>\n";
|
|
|
|
print "<center>";
|
|
print $thm_elem['button.print'];
|
|
print $thm_elem['button.cancel'];
|
|
print "</center>";
|
|
|
|
print "</form>\n";
|
|
|
|
site_footer($database);
|
|
site_epilog($database);
|
|
?>
|