po/src/my.settings.php

630 lines
30 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/color.php";
include_once "include/common.php";
include_once "include/orderby.php";
include_once "include/site.php";
$settings_user_data = array();
function settings_i18n_data() {
global $settings_user_data;
global $strings;
$settings_user_data = array("identification" => array("idx" => 1, 'link' => "my.settings.php?selector=1", "alt" => $strings['user_identification']),
"contact" => array("idx" => 2, 'link' => "my.settings.php?selector=2", "alt" => $strings['user_contact']),
"calendar" => array("idx" => 3, 'link' => "my.settings.php?selector=3", "alt" => $strings['user_calendar']),
"search" => array("idx" => 4, 'link' => "my.settings.php?selector=4", "alt" => $strings['user_search_engine']),
"photo_browser" => array("idx" => 5, 'link' => "my.settings.php?selector=5", "alt" => $strings['user_photo_browser']),
"photo_upload" => array("idx" => 6, 'link' => "my.settings.php?selector=6", "alt" => $strings['user_photo_upload']));
}
$generate_i18n_data[] = "settings_i18n_data";
$database = site_prolog(PO_USER_TYPE_CLIENT);
$auth_handle = new $po_auth();
$selector = isset($_REQUEST['selector']) ? $_REQUEST['selector'] : 1;
$registration_error = 0;
$save_settings = isset($_REQUEST['save_settings']) ? $_REQUEST['save_settings'] : FALSE;
$all_states = pg_query($database, "select identifier, value from state order by value");
$all_countries = pg_query($database, "select identifier, value from country order by value");
$all_papers = pg_query($database, "select identifier, name from paper");
if ($save_settings != "true") {
refresh_user_prefs($database);
site_update_session();
} else {
pg_query($database, "begin");
switch ($selector) {
case $settings_user_data['identification']['idx']:
if (isset($_REQUEST['hide'])) {
$po_user['hide'] = $_REQUEST['hide'];
}
if ($auth_handle->local_register === TRUE) {
if (isset($_REQUEST['first_name'])) {
$po_user['first_name'] = $_REQUEST['first_name'];
}
if (isset($_REQUEST['email'])) {
$po_user['email'] = $_REQUEST['email'];
}
if (isset($_REQUEST['last_name'])) {
$po_user['last_name'] = $_REQUEST['last_name'];
}
if (isset($_REQUEST['company'])) {
$po_user['company'] = $_REQUEST['company'];
}
}
$password_1 = isset($_REQUEST['password_1']) ? $_REQUEST['password_1'] : "";
$password_2 = isset($_REQUEST['password_2']) ? $_REQUEST['password_2'] : "";
$password_o = isset($_REQUEST['password_o']) ? $_REQUEST['password_o'] : "";
if (($po_user['first_name'] == "") || ($po_user['last_name'] == "")) {
site_push_error($strings['errors_name_mandatory']);
$registration_error = 1;
} elseif ($po_user['email'] == "") {
site_push_error($strings['errors_email_mandatory']);
$registration_error = 1;
} else {
$result = pg_query($database, "update users set first_name = '$po_user[first_name]', last_name = '$po_user[last_name]', hide='$po_user[hide]',
email='$po_user[email]' where identifier = $po_user[id]");
if ($memcache) {
po_log("memcache: delete user_data_s.$po_user[id]", PEAR_LOG_DEBUG);
$memcache->delete("user_data_s.$po_user[id]");
}
}
if ($password_o || $password_1 || $password_2) {
if (($password_2 != $password_1) ||
($password_2 == "") ||
($password_1 == "")) {
site_push_error($strings['errors_password_mismatch']);
$registration_error = 1;
} elseif ($password_o == "") {
site_push_error($strings['errors_old_password_needed']);
$registration_error = 1;
} else {
if ($auth_handle->can_change_pass === TRUE) {
if ($auth_handle->change_pass($po_user['username'], $password_o, $password_1) === FALSE) {
site_push_error($strings['errors_password_change_failed']);
}
}
}
}
break;
case $settings_user_data['contact']['idx']:
if ($auth_handle->local_userinfo === TRUE) {
if (isset($_REQUEST['address1'])) {
$po_user['address1'] = $_REQUEST['address1'];
}
if (isset($_REQUEST['address2'])) {
$po_user['address2'] = $_REQUEST['address2'];
}
if (isset($_REQUEST['city'])) {
$po_user['city'] = $_REQUEST['city'];
}
if (isset($_REQUEST['zipcode'])) {
$po_user['zipcode'] = $_REQUEST['zipcode'];
}
if (isset($_REQUEST['state'])) {
$po_user['state'] = $_REQUEST['state'];
}
if (isset($_REQUEST['country'])) {
$po_user['country'] = $_REQUEST['country'];
}
if (isset($_REQUEST['url'])) {
$po_user['url'] = $_REQUEST['url'];
}
if (isset($_REQUEST['phone'])) {
$po_user['phone'] = $_REQUEST['phone'];
}
$result = pg_query($database, "update users set address1='$po_user[address1]', address2='$po_user[address2]', city='$po_user[city]',
zipcode='$po_user[zipcode]', state=$po_user[state], country=$po_user[country], phone='$po_user[phone]',
url='$po_user[url]', company='$company'
where identifier=$po_user[id]");
}
break;
case $settings_user_data['calendar']['idx']:
if (isset($_REQUEST['start_hour'])) {
$po_options['start_hour'] = $_REQUEST['start_hour'];
$result = store_user_pref($database, $po_user['id'], 'start_hour', $po_options['start_hour']);
}
if (isset($_REQUEST['end_hour'])) {
$po_options['end_hour'] = $_REQUEST['end_hour'];
$result = store_user_pref($database, $po_user['id'], 'end_hour', $po_options['end_hour']);
}
if (isset($_REQUEST['start_day'])) {
$po_options['start_day'] = $_REQUEST['start_day'];
$result = store_user_pref($database, $po_user['id'], 'start_day', $po_options['start_day']);
}
break;
case $settings_user_data['search']['idx']:
if (isset($_REQUEST['search_engine_type'])) {
$po_options['search_engine_type'] = $_REQUEST['search_engine_type'];
$result = store_user_pref($database, $po_user['id'], 'search_engine_type', $po_options['search_engine_type']);
}
if (isset($_REQUEST['search_enable_stemming'])) {
$po_options['search_enable_stemming'] = $_REQUEST['search_enable_stemming'];
$result = store_user_pref($database, $po_user['id'], 'search_enable_stemming', $po_options['search_enable_stemming']);
}
if (isset($_REQUEST['search_masters_only'])) {
$po_options['search_masters_only'] = $_REQUEST['search_masters_only'];
$result = store_user_pref($database, $po_user['id'], 'search_masters_only', $po_options['search_masters_only']);
}
break;
case $settings_user_data['photo_browser']['idx']:
if (isset($_REQUEST['popup_enable'])) {
$popup_enable = $_REQUEST['popup_enable'];
if ($popup_enable != 'f') {
$po_options['popup_enable'] = 't';
$po_options['popup_delay'] = $popup_enable;
} else {
$po_options['popup_enable'] = 'f';
}
$result = store_user_pref($database, $po_user['id'], 'popup_enable', $po_options['popup_enable']);
$result = store_user_pref($database, $po_user['id'], 'popup_delay', $po_options['popup_delay']);
}
/* This set is automagically updated */
$result = store_user_pref($database, $po_user['id'], 'photos_per_page', $po_options['photos_per_page']);
$result = store_user_pref($database, $po_user['id'], 'rows_list_view', $po_options['rows_list_view']);
$result = store_user_pref($database, $po_user['id'], 'photo_view', $po_options['photo_view']);
$result = store_user_pref($database, $po_user['id'], 'order_by', $po_options['order_by']);
$result = store_user_pref($database, $po_user['id'], 'folder_order_by', $po_options['folder_order_by']);
break;
case $settings_user_data['photo_upload']['idx']:
if ($po_user['type'] >= PO_USER_TYPE_USER) {
$sizes = explode(",", $po_options['scaled_generate']);
foreach ($sizes as $size_key) {
if (isset($_REQUEST[$size_key.'_format'])) {
$po_options[$size_key.'_format'] = $_REQUEST[$size_key.'_format'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_format', $po_options[$size_key.'_format']);
}
if (isset($_REQUEST[$size_key.'_quality'])) {
$po_options[$size_key.'_quality'] = $_REQUEST[$size_key.'_quality'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_quality', $po_options[$size_key.'_quality']);
}
if (isset($_REQUEST[$size_key.'_color_space'])) {
$po_options[$size_key.'_color_space'] = $_REQUEST[$size_key.'_color_space'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_color_space', $po_options[$size_key.'_color_space']);
}
if (isset($_REQUEST[$size_key.'_gamma'])) {
$po_options[$size_key.'_gamma'] = $_REQUEST[$size_key.'_gamma'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_gamma', $po_options[$size_key.'_gamma']);
}
if (isset($_REQUEST[$size_key.'_border_width'])) {
$po_options[$size_key.'_border_width'] = $_REQUEST[$size_key.'_border_width'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_border_width', $po_options[$size_key.'_border_width']);
}
if (isset($_REQUEST[$size_key.'_border_height'])) {
$po_options[$size_key.'_border_height'] = $_REQUEST[$size_key.'_border_height'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_border_height', $po_options[$size_key.'_border_height']);
}
if (isset($_REQUEST[$size_key.'_border_color'])) {
$po_options[$size_key.'_border_color'] = $_REQUEST[$size_key.'_border_color'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_border_color', $po_options[$size_key.'_border_color']);
}
if (isset($_REQUEST[$size_key.'_sharpen_sigma'])) {
$po_options[$size_key.'_sharpen_sigma'] = $_REQUEST[$size_key.'_sharpen_sigma'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_sharpen_sigma', $po_options[$size_key.'_sharpen_sigma']);
}
if (isset($_REQUEST[$size_key.'_sharpen_amount'])) {
$po_options[$size_key.'_sharpen_amount'] = $_REQUEST[$size_key.'_sharpen_amount'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_sharpen_amount', $po_options[$size_key.'_sharpen_amount']);
}
if (isset($_REQUEST[$size_key.'_sharpen_threshold'])) {
$po_options[$size_key.'_sharpen_threshold'] = $_REQUEST[$size_key.'_sharpen_threshold'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_sharpen_threshold', $po_options[$size_key.'_sharpen_threshold']);
}
if (isset($_REQUEST[$size_key.'_copy_metadata'])) {
$po_options[$size_key.'_copy_metadata'] = $_REQUEST[$size_key.'_copy_metadata'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_copy_metadata', $po_options[$size_key.'_copy_metadata']);
}
if (isset($_REQUEST[$size_key.'_watermark_location'])) {
$po_options[$size_key.'_watermark_location'] = $_REQUEST[$size_key.'_watermark_location'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_watermark_location', $po_options[$size_key.'_watermark_location']);
}
if (isset($_REQUEST[$size_key.'_watermark_brightness'])) {
$po_options[$size_key.'_watermark_brightness'] = $_REQUEST[$size_key.'_watermark_brightness'];
$result = store_user_pref($database, $po_user['id'], $size_key.'_watermark_brightness', $po_options[$size_key.'_watermark_brightness']);
}
}
/* Default shoooting data */
if (isset($_REQUEST['hide_originals_default'])) {
$po_options['hide_originals_default'] = $_REQUEST['hide_originals_default'];
$result = store_user_pref($database, $po_user['id'], 'hide_originals_default', $po_options['hide_originals_default']);
}
if (isset($_REQUEST['access_default'])) {
$po_options['access_default'] = $_REQUEST['access_default'];
$result = store_user_pref($database, $po_user['id'], 'access_default', $po_options['access_default']);
}
if (isset($_REQUEST['copyright_default'])) {
$po_options['copyright_default'] = $_REQUEST['copyright_default'];
$result = store_user_pref($database, $po_user['id'], 'copyright_default', $po_options['copyright_default']);
}
if (isset($_REQUEST['web_statement_default'])) {
$po_options['web_statement_default'] = $_REQUEST['web_statement_default'];
$result = store_user_pref($database, $po_user['id'], 'web_statement_default', $po_options['web_statement_default']);
}
if (isset($_REQUEST['author_default'])) {
$po_options['author_default'] = $_REQUEST['author_default'];
$result = store_user_pref($database, $po_user['id'], 'author_default', $po_options['author_default']);
}
if (isset($_REQUEST['import_metadata_order'])) {
$po_options['import_metadata_order'] = $_REQUEST['import_metadata_order'];
$result = store_user_pref($database, $po_user['id'], 'import_metadata_order', $po_options['import_metadata_order']);
}
if (isset($_REQUEST['import_last_master'])) {
$po_options['import_last_master'] = $_REQUEST['import_last_master'];
$result = store_user_pref($database, $po_user['id'], 'import_last_master', $po_options['import_last_master']);
}
/* Watermarking options */
if (isset($_REQUEST['watermark_keep']) &&
($_REQUEST['watermark_keep'] != 't')) {
unset($po_options['watermark_photo']);
$result = store_user_pref($database, $po_user['id'], 'watermark_photo', '');
}
/* Raw Options */
if (isset($_REQUEST['ufraw_gamma'])) {
$po_options['ufraw_gamma'] = $_REQUEST['ufraw_gamma'];
$result = store_user_pref($database, $po_user['id'], 'ufraw_gamma', $po_options['ufraw_gamma']);
}
if (isset($_REQUEST['ufraw_gamma_linearity'])) {
$po_options['ufraw_gamma_linearity'] = $_REQUEST['ufraw_gamma_linearity'];
$result = store_user_pref($database, $po_user['id'], 'ufraw_gamma_linearity', $po_options['ufraw_gamma_linearity']);
}
if (isset($_REQUEST['dcraw_brightness'])) {
$po_options['dcraw_brightness'] = $_REQUEST['dcraw_brightness'];
$result = store_user_pref($database, $po_user['id'], 'dcraw_brightness', $po_options['dcraw_brightness']);
}
if (isset($_REQUEST['raw_white_balance'])) {
$po_options['raw_white_balance'] = $_REQUEST['raw_white_balance'];
$result = store_user_pref($database, $po_user['id'], 'raw_white_balance', $po_options['raw_white_balance']);
}
if (isset($_REQUEST['extract_jpgfromraw'])) {
$po_options['jpgfromraw'] = $_REQUEST['extract_jpgfromraw'];
$result = store_user_pref($database, $po_user['id'], 'jpgfromraw', $po_options['jpgfromraw']);
}
if (isset($_REQUEST['jpgfromraw_master'])) {
$po_options['jpgfromraw_master'] = $_REQUEST['jpgfromraw_master'];
$result = store_user_pref($database, $po_user['id'], 'jpgfromraw_master', $po_options['jpgfromraw_master']);
}
if (isset($_REQUEST['raw_bitdepth'])) {
$po_options['raw_bitdepth'] = $_REQUEST['raw_bitdepth'];
$result = store_user_pref($database, $po_user['id'], 'raw_bitdepth', $po_options['raw_bitdepth']);
}
if (isset($_REQUEST['raw_denoise'])) {
$po_options['raw_denoise'] = $_REQUEST['raw_denoise'];
$result = store_user_pref($database, $po_user['id'], 'raw_denoise', $po_options['raw_denoise']);
}
}
break;
}
if (!$result) {
pg_query($database, "rollback");
if (!$registration_error) {
site_push_error($strings['errors_db_insert_failed']);
}
site_epilog($database);
header("Location: my.settings.php?selector=$selector");
exit();
}
pg_query($database, "commit");
/* Store any updated values! */
site_update_session();
}
site_header($strings['generic_my_settings']);
site_navigator(7);
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic_users'])." : ".$strings['generic_my_settings'], "");
theme_display_navigator_box_top($selector, $settings_user_data, "100%");
print "<form action=\"my.settings.php\" method=\"post\" accept-charset=\"".$strings['formats_encoding']."\">\n";
print "<input type=\"hidden\" name=\"selector\" value=\"$selector\"/>\n";
print "<input type=\"hidden\" name=\"save_settings\" value=\"true\"/>\n";
switch ($selector) {
case $settings_user_data['identification']['idx']:
print "<table class=\"listing\">\n";
print "<tr><td>".$strings['generic_username']."</td><td>$po_user[username]</td></tr>\n";
print "<tr><td>".$strings['user_first_name']."</td> <td>";
if ($auth_handle->local_register === TRUE) {
print "<input type=\"text\" name=\"first_name\" value=\"$po_user[first_name]\" />";
} else {
print $po_user['first_name'];
}
print "</td></tr>\n";
print "<tr><td>".$strings['user_last_name']."</td> <td>";
if ($auth_handle->local_register === TRUE) {
print "<input type=\"text\" name=\"last_name\" value=\"$po_user[last_name]\"/>";
} else {
print $po_user['last_name'];
}
print "</td></tr>\n";
print "<tr><td>".$strings['user_email']."</td> <td>";
if ($auth_handle->local_register === TRUE) {
print "<input type=\"text\" name=\"email\" value=\"$po_user[email]\" />";
} else {
print $po_user['email'];
}
print "</td></tr>\n";
print "<tr><td>".$strings['user_hide'] ."</td><td>";
print emit_yes_no_combo("hide", $po_user['hide']);
print "</td></tr>";
if ($auth_handle->can_change_pass === TRUE) {
print "<tr><th colspan=\"2\">".$strings['generic_password']."</th></tr>";
print "<tr><td>".$strings['generic_password_old']."</td> <td><input type=\"password\" name=\"password_o\" value=\"\"/></td></tr>\n";
print "<tr><td>".$strings['generic_password']."</td> <td><input type=\"password\" name=\"password_1\" value=\"\"/></td></tr>\n";
print "<tr><td>".$strings['generic_password_again']."</td><td><input type=\"password\" name=\"password_2\" value=\"\"/></td></tr>\n";
}
print "</table>\n";
break;
case $settings_user_data['contact']['idx']:
print "<table class=\"listing\">\n";
print "<tr><td>".$strings['user_web']."</td> <td><input type=\"text\" name=\"url\" value=\"$po_user[url]\"/></td></tr>\n";
print "<tr><td>".$strings['user_phone']."</td> <td><input type=\"text\" name=\"phone\" value=\"$po_user[phone]\"/></td></tr>\n";
print "<tr><td>".$strings['user_company']."</td> <td width=\"70%\"><input type=\"text\" name=\"company\" value=\"$po_user[company]\" /></td></tr>\n";
print "<tr><td>".$strings['user_address']."</td>";
print "<td><input type=\"text\" name=\"address1\" value=\"$po_user[address1]\" />";
print "<br/>";
print "<input type=\"text\" name=\"address2\" value=\"$po_user[address2]\" />";
print "</td></tr>\n";
print "<tr><td>".$strings['user_city']."</td> <td><input type=\"text\" name=\"city\" value=\"$po_user[city]\" /></td></tr>\n";
print "<tr><td>".$strings['user_post_code']."</td> <td><input type=\"text\" name=\"zipcode\" value=\"$po_user[zipcode]\" /></td></tr>\n";
print "<tr><td>".$strings['user_state']."</td> <td>". emit_combo("state", $all_states, $po_user['state'], "", 0) . "</td></tr>\n";
print "<tr><td>".$strings['user_country']."</td> <td>". emit_combo("country", $all_countries, $po_user['country'], "", 0) . "</td></tr>\n";
print "</table>\n";
break;
case $settings_user_data['calendar']['idx']:
print "<table class=\"listing\">\n";
print "<tr><td>".$strings['profile_week_begins']."</td><td>";
print emit_first_day_combo("start_day", $po_options['start_day']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_start_hour']."</td><td>";
display_hour_combo("start_hour", $po_options['start_hour'], FALSE);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_end_hour']."</td><td>";
display_hour_combo("end_hour", $po_options['end_hour'], FALSE);
print "</td></tr>\n";
print "</table>\n";
break;
case $settings_user_data['search']['idx']:
print "<table class=\"listing\">\n";
print "<tr><td>".$strings['profile_default_engine']."</td><td>";
print emit_search_engine_type_combo("search_engine_type", $po_options['search_engine_type']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_enable_stemming']."</td><td>";
print emit_yes_no_combo("search_enable_stemming", $po_options['search_enable_stemming']);
print "</td></tr>\n";
print "<tr><td>".$strings['search_masters_only']."</td><td>";
print emit_yes_no_combo("search_masters_only", $po_options['search_masters_only']);
print "</td></tr>\n";
print "</table>\n";
break;
case $settings_user_data['photo_browser']['idx']:
print "<input type=\"hidden\" name=\"per_page_req\" value=\"true\"/>\n";
print "<input type=\"hidden\" name=\"order_by_req\" value=\"true\"/>\n";
print "<table class=\"listing\">\n";
print "<tr><td>".$strings['profile_popup_enable']."</td><td>";
print emit_popup_delay_combo("popup_enable", $po_options['popup_delay'], $po_options['popup_enable']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_photos_slide']."</td><td>";
print emit_photos_per_page_combo("photos_per_page", $po_options['photos_per_page'], FALSE);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_photos_list']."</td><td>";
print emit_photos_per_page_combo("rows_list_view", $po_options['rows_list_view'], FALSE);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_default_view']."</td><td>";
print emit_radio_item("photo_view", "slide", $po_options['photo_view'] == 'slide').$strings['generic_slide_view']."<br/>";
print emit_radio_item("photo_view", "list", $po_options['photo_view'] == 'list').$strings['generic_list_view'];
print "</td></tr>";
print "<tr><td>".$strings['profile_default_image_sort']."</td><td>";
display_order_by_combo($po_options['order_by']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_default_folder_sort']."</td><td>";
display_folder_order_by_combo($po_options['folder_order_by']);
print "</td></tr>\n";
print "</table>\n";
break;
case $settings_user_data['photo_upload']['idx']:
if ($po_user['type'] >= PO_USER_TYPE_USER) {
print "<table class=\"listing\">\n";
print "<tr class=\"folder_top\"><th colspan=\"2\">".$strings['import_default_data']."</th></tr>\n";
print "<tr><td>".$strings['generic_high_res_orig']."</td><td>";
print emit_hide_original_combo("hide_originals_default", $po_options['hide_originals_default']);
print "</td></tr>\n";
print "<tr><td>".$strings['generic_access']."</td><td>";
print emit_access_combo("access_default", $po_options['access_default']);
print "</td></tr>\n";
print "<tr><td>".$strings['generic_copyright']."</td>";
print "<td colspan=\"2\"><textarea name=\"copyright_default\" rows=\"2\" cols=\"60\">$po_options[copyright_default]</textarea></td></tr>";
print "<tr><td>".$strings['generic_author']."</td>";
print "<td colspan=\"2\"><textarea name=\"author_default\" rows=\"2\" cols=\"60\">$po_options[author_default]</textarea></td></tr>";
print "<tr><td>".$strings['generic_web_statement']."</td>";
print "<td colspan=\"2\"><textarea name=\"web_statement_default\" rows=\"2\" cols=\"60\">$po_options[web_statement_default]</textarea></td></tr>";
print "<tr><td>".$strings['import_metadata']."</td>";
print emit_td(emit_metadata_order_combo('import_metadata_order', $po_options['import_metadata_order'])) . "</tr>";
print "<tr><td>".$strings['import_import_last_master']."</td>";
print emit_td(emit_yes_no_combo("import_last_master", $po_options['import_last_master']));
print "</tr>";
print "</table>\n";
/* RAW OPTIONS */
print "<table class=\"listing\">\n";
print "<tr class=\"folder_top\"><th colspan=\"2\">".$strings['profile_raw_options']."</th></tr>\n";
print "<tr><td>".$strings['profile_raw_decoder']."</td><td>";
print "$raw_decoder";
print "</td></tr>\n";
print "<tr><td>".$strings['profile_jpgfromraw']."</td><td>";
print emit_yes_no_combo("extract_jpgfromraw", $po_options['jpgfromraw']);
print " " . $strings['generic_master'] ." ";
print emit_yes_no_combo("jpgfromraw_master", $po_options['jpgfromraw_master']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_white_balance']."</td><td>";
display_dcraw_white_balance_combo("raw_white_balance", $po_options['raw_white_balance']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_bitdepth']."</td><td>";
display_dcraw_bitdepth_combo("raw_bitdepth", $po_options['raw_bitdepth']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_raw_denoise']."</td><td>";
print emit_float_combo("raw_denoise", $po_options['raw_denoise'],
0, 300, 10);
print "</td></tr>\n";
// DCRAW-specific
print "<tr><td>".$strings['profile_brightness']."</td><td>";
print emit_float_combo("dcraw_brightness", $po_options['dcraw_brightness'],
0, 3, 0.05);
print "</td></tr>\n";
// UFRAW-specific.
print "<tr><td>".$strings['profile_raw_gamma']."</td><td>";
print emit_float_combo("ufraw_gamma", $po_options['ufraw_gamma'],
0, 1, 0.01);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_raw_gamma_lin']."</td><td>";
print emit_float_combo("ufraw_gamma_linearity", $po_options['ufraw_gamma_linearity'],
0, 1, 0.01);
print "</td></tr>\n";
print "</table>";
/* PHOTO UPLOAD OPTIONS */
if ($po_options['watermark_photo'] > 0) {
print "<table class=\"listing\">\n";
print "<tr class=\"folder_top\">";
print "<th colspan=\"2\">".$strings['profile_watermark_options']."</th>";
print "</tr>\n";
print "<tr>";
print emit_td($strings['profile_watermark_photo']);
print emit_td(emit_a(generate_link('photo', '', array('ver'=>$po_options['watermark_photo'])) ,
"<img src=\"".generate_link('image', '', array('ver'=>$po_options['watermark_photo'], 'size'=>1))."\" alt=\"watermark\"/>", "class=\"nodecor\"") . " " . emit_yes_no_combo("watermark_keep", "t"));
print "</tr>";
}
print "</table>";
$sizes = explode(",", $po_options['scaled_generate']);
foreach ($sizes as $size_key) {
print "<table class=\"listing\">\n";
print "<tr class=\"folder_top\">";
print "<th colspan=\"2\">".$strings['profile_upload_options']." ($size_key)</th>";
print "</tr>\n";
if ($size_key != "full") {
print "<tr><td>".$strings['profile_resolution']."</td><td>";
print $po_options[$size_key.'_max_size'];
print "</td></tr>\n";
}
print "<tr><td>".$strings['profile_gamma']."</td><td>";
print emit_float_combo($size_key."_gamma", $po_options[$size_key.'_gamma'],
0.8, 2.3, 0.10);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_sharpening']."</td><td>";
print "0 x ";
print emit_float_combo($size_key."_sharpen_sigma", $po_options[$size_key.'_sharpen_sigma'],
0.05, 3, 0.05);
print " + ";
print emit_float_combo($size_key."_sharpen_amount", $po_options[$size_key.'_sharpen_amount'],
0, 5, 0.10);
print " + ";
print emit_float_combo($size_key."_sharpen_threshold", $po_options[$size_key.'_sharpen_threshold'],
0, 1, 0.05);
print "</td></tr>\n";
if ($size_key != "thumb") {
print "<tr><td>".$strings['profile_border']."</td><td>";
display_im_border_combo($size_key."_border_width", $po_options[$size_key.'_border_width']);
print " x ";
display_im_border_combo($size_key."_border_height", $po_options[$size_key.'_border_height']);
print " &amp; ";
display_im_color_combo($size_key."_border_color", $po_options[$size_key.'_border_color']);
print "</td></tr>\n";
}
print "<tr><td>".$strings['profile_format']."</td><td>";
print emit_filetype_combo($size_key.'_format', $po_options[$size_key.'_format']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_quality'];
print "</td><td>";
display_im_quality_combo($size_key."_quality", $po_options[$size_key.'_quality']);
print "</td></tr>\n";
print "<tr><td>".$strings['profile_colorspace']."</td><td>";
display_im_colorspace_combo($size_key."_color_space", $po_options[$size_key.'_color_space']);
print "</td></tr>\n";
if ($size_key != "thumb") {
print "<tr><td>".$strings['profile_metadata']."</td>";
print emit_td(emit_yes_no_combo("preview_copy_metadata", $po_options[$size_key.'_copy_metadata']));
print "</tr>\n";
}
if ($size_key != "thumb") {
print "<tr><td>".$strings['profile_watermark_brightness']."</td>";
print "<td>";
display_im_watermark_brightness($size_key."_watermark_brightness", $po_options[$size_key.'_watermark_brightness']);
print "</td>";
print "</tr>\n";
print "<tr><td>".$strings['profile_watermark_mask']."</td>";
print "<td>";
display_im_watermark_mask_location($size_key."_watermark_location", $po_options[$size_key.'_watermark_location']);
print "</td></tr>\n";
}
print "</table>\n";
}
}
break;
}
print $thm_elem['button.save.changes'];
print "</form>\n";
theme_display_navigator_box_bottom("100%");
site_footer($database);
site_epilog($database);
?>