po/src/xml.generator.php

136 lines
7.9 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/tools.php";
include_once "include/common.php";
include_once "include/export.php";
include_once "include/site.php";
$database = site_prolog(PO_USER_TYPE_USER);
$file_name_root = $_REQUEST['file_name'];
$file_number_digits = $_REQUEST['file_number_digits'];
$file_format = $_REQUEST['file_format'];
$file_number_start = $_REQUEST['file_number_start'];
$frame_number = $_REQUEST['frame_number'];
$date_of_exposure = check_date_validity($_REQUEST['exposure_timestamp']);
$storage_size = $_REQUEST['storage_size'];
$image_data = array ("folder" => $_REQUEST['folder'],
"author" => $_REQUEST['author'],
"title" => $_REQUEST['title'],
"keywords" => $_REQUEST['keywords'],
"caption" => $_REQUEST['caption'],
"copyright" => $_REQUEST['copyright'],
"date_of_exposure" => $date_of_exposure,
"location" => $_REQUEST['location'],
"storage_location_type" => $_REQUEST['storage_location_type'],
"storage_location_id" => $_REQUEST['storage_location_id'],
"storage_index" => $_REQUEST['storage_index'],
"access_rights" => $_REQUEST['access_rights'],
"hide_original" => $_REQUEST['hide_original'],
"camera" => $_REQUEST['camera'],
"film" => $_REQUEST['film'],
"focal_length" => $_REQUEST['focal_length'],
"aperture" => $_REQUEST['aperture'],
"shutter" => $_REQUEST['shutter'],
"exp_comp" => $_REQUEST['exp_comp'],
"exp_diff" => $_REQUEST['exp_diff'],
"camera_metering" => $_REQUEST['camera_metering'],
"camera_program" => $_REQUEST['camera_program'],
"flash_mode" => $_REQUEST['flash_mode'],
"flash_comp" => $_REQUEST['flash_comp'],
"scan_resolution" => $_REQUEST['scan_resolution'],
"scan_bitdepth" => $_REQUEST['scan_bitdepth'],
"scan_multiscan" => $_REQUEST['scan_multiscan'],
"iso_override" => $_REQUEST['iso_override'],
"latitude" => $_REQUEST['latitude'],
"longitute" => $_REQUEST['longitude'],
"altitude" => $_REQUEST['altitude'],
"direction" => $_REQUEST['direction'],
"equipment" => $_REQUEST['equipment']);
site_header($strings['generic_tools'], $strings['tools_xml_template_generator']);
site_navigator(10);
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic_users'])." : <a href=\"my.tools.php\">".$strings['generic_my_tools']."</a> : <a href=\"xml.generator.php\">".$strings['tools_xml_template_generator'] ."</a> : ".$strings['tools_xml_template_file'], "");
theme_display_navigator_box_top($tools_data['generator']['idx'], $tools_data, "100%");
print "<div align=\"left\"\">";
print "<code>";
print convert_xml2html(create_xml_header());
print convert_xml2html(create_xml_bulkupload_header());
print convert_xml2html(create_xml_folder_header($image_data['folder']));
$tmp_value = pg_fetch_row(pg_query($database, "select value from shutter where identifier=".$image_data['shutter']."")); $image_data['shutter'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from ev_comp where identifier=".$image_data['exp_comp']."")); $image_data['exp_comp'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from ev_comp where identifier=".$image_data['exp_diff']."")); $image_data['exp_diff'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from camera_metering where identifier=".$image_data['camera_metering']."")); $image_data['camera_metering'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from camera_program where identifier=".$image_data['camera_program']."")); $image_data['camera_program'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from flash_mode where identifier=".$image_data['flash_mode']."")); $image_data['flash_mode'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from ev_comp where identifier=".$image_data['flash_comp']."")); $image_data['flash_comp'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from scan_resolution where identifier=".$image_data['scan_resolution']."")); $image_data['scan_resolution'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from scan_bitdepth where identifier=".$image_data['scan_bitdepth']."")); $image_data['scan_bitdepth'] = $tmp_value[0];
$tmp_value = pg_fetch_row(pg_query($database, "select value from scan_multiscan where identifier=".$image_data['scan_multiscan']."")); $image_data['scan_multiscan'] = $tmp_value[0];
$camera_program = ereg_replace ("Camera Program Automatic", "auto", $image_data['camera_program']);
$camera_program = ereg_replace ("Aperture Priority", "aperture", $image_data['camera_program']);
$camera_program = ereg_replace ("Shutter Priority", "shutter", $image_data['camera_program']);
$camera_program = ereg_replace ("Manual", "manual", $image_data['camera_program']);
$camera_metering = ereg_replace ("Spot", "spot", $image_data['camera_metering']);
$camera_metering = ereg_replace ("Center", "center", $image_data['camera_metering']);
$camera_metering = ereg_replace ("3D Matrix", "matrix", $image_data['camera_metering']);
$camera_metering = ereg_replace ("3D Color Matrix", "colormatrix", $image_data['camera_metering']);
$camera_metering = ereg_replace ("Zone", "zone", $image_data['camera_metering']);
for ($i = 0; $i < $frame_number; $i++) {
$image_data['file'][0]['name'] = sprintf("%s%s.%s", $file_name_root, str_pad($file_number_start + $i, $file_number_digits, "0", STR_PAD_LEFT), $file_format);
$image_data['file'][0]['master'] = 't';
print "&nbsp;<br/>\n";
print "<code>\n";
print convert_xml2html(create_xml_photo($image_data));
print "</code>\n";
print "&nbsp;<br/>\n";
if ($storage_size) {
if ($image_data['storage_index'] == $storage_size) {
$image_data['storage_index'] = 0;
$image_data['storage_location_id']++;
}
}
$image_data['storage_index'] ++;
}
print convert_xml2html(create_xml_folder_footer());
print convert_xml2html(create_xml_bulkupload_footer());
print "</code>";
print "</div>";
print $thm_elem['button.back'];
theme_display_navigator_box_bottom("100%");
site_footer($database);
site_epilog($database);
?>