<?php
/*
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2002 Bharat Mediratta
 * 
 * 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 2 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
?>
<?php
// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
		!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
		!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
	print "Security violation\n";
	exit;
}
?>
<?php require("./init.php"); ?>
<?php
// Hack check
if (!$gallery->user->canWriteToAlbum($gallery->album)) {
	exit;
}
	
if ($save) {
	$gallery->album->fields["title"] = $title;
	$gallery->album->fields["bgcolor"] = $bgcolor;
	$gallery->album->fields["textcolor"] = $textcolor;
	$gallery->album->fields["linkcolor"] = $linkcolor;
	$gallery->album->fields["font"] = $font;
	$gallery->album->fields["bordercolor"] = $bordercolor;
	$gallery->album->fields["border"] = $border;
	$gallery->album->fields["background"] = $background;
	$gallery->album->fields["thumb_size"] = $thumb_size;
	$gallery->album->fields["resize_size"] = $resize_size;
	$gallery->album->fields["returnto"] = $returnto;
	$gallery->album->fields["rows"] = $rows;
	$gallery->album->fields["cols"] = $cols;
	$gallery->album->fields["fit_to_window"] = $fit_to_window;
	$gallery->album->fields["use_fullOnly"] = $use_fullOnly;
	$gallery->album->fields["print_photos"] = $print_photos;
	$gallery->album->fields["use_exif"] = $use_exif;
	$gallery->album->fields["display_clicks"] = $display_clicks;
	$gallery->album->fields["public_comments"] = $public_comments;
	$gallery->album->save();

	if ($setNested) {
	
		$gallery->album->setNestedProperties();

	}

	reload();
}

?>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
  <title>アルバムの設定</title>
   
</head>
<body>

<center>
アルバムの設定

<?php echo makeFormIntro("edit_appearance.php", 
			array("name" => "theform", 
				"method" => "POST")); ?>
<input type=hidden name="save" value=1>
<table>
<tr>
<td>アルバムのタイトル</td>
<td><input type=text name="title" value="<?php echo $gallery->album->fields["title"]?>"></td>
</tr>
<tr>
<!-- <td>背景色</td>
<td><input type=text name="bgcolor" value="<?php echo $gallery->album->fields["bgcolor"]?>"></td>
</tr>
<tr>
<td>文字色</td>
<td><input type=text name="textcolor" value="<?php echo $gallery->album->fields["textcolor"]?>"></td>
</tr>
<tr>
<td>リンク色</td>
<td><input type=text name="linkcolor" value="<?php echo $gallery->album->fields["linkcolor"]?>"></td>
</tr>
<tr>
<td>背景画像 (URLで)</td>
<td><input type=text name="background" value="<?php echo $gallery->album->fields["background"]?>"></td>
</tr>
<tr>
<td>フォント</td>
<td><input type=text name="font" value="<?php echo $gallery->album->fields["font"]?>"></td>
</tr>
<tr>
<td>ボーダー</td>
<td><select name="border"><?php echo selectOptions($gallery->album, "border", array("off", 1, 2, 3, 4)) ?></select></td>
</tr>
<tr>
<td>ボーダー色</td>
<td><input type=text name="bordercolor" value="<?php echo $gallery->album->fields["bordercolor"]?>"></td>
</tr>
<tr> -->
<td>サムネイルサイズ</td>
<td><input type=text name="thumb_size" value="<?php echo $gallery->album->fields["thumb_size"]?>"></td>
</tr>
<tr>
<td>中間イメージサイズ</td>
<td><select name="resize_size"><?php echo selectOptions($gallery->album, "resize_size", array("off", 400, 500, 600, 640, 700, 800, 1024)) ?></select></td>
</tr>
<tr>
<td><i>戻る</i>リンクの表示</td>
<td><select name="returnto"><?php echo selectOptions($gallery->album, "returnto", array("yes", "no")) ?></select></td>
</tr>
<tr>
<td>段数</td>
<td>
 <select name="rows">
  <?php echo selectOptions($gallery->album, "rows", array(1, 2, 3, 4, 5, 6, 7, 8, 9)) ?>
 </select>
</td>
</tr>
<tr>
<td>列数</td>
<td>
 <select name="cols">
  <?php echo selectOptions($gallery->album, "cols", array(1, 2, 3, 4, 5, 6, 7, 8, 9)) ?>
 </select>
</td>
</tr>
<tr>
<td>中間イメージの無いイメージをウィンドウに合わせる（XOOPS2ではno）</td>
<td><select name="fit_to_window"><?php echo selectOptions($gallery->album, "fit_to_window", array("yes", "no")) ?></select></td>
</tr>
<tr>
<td>閲覧者へのフルサイズか中間イメージかイメージサイズの選択</td>
<td><select name="use_fullOnly"><?php echo selectOptions($gallery->album, "use_fullOnly", array("yes", "no")) ?></select></td>
</tr>
<tr>
<td>閲覧者に使わせたい印刷サービス</td>
<td><select name="print_photos"><?php echo selectOptions($gallery->album, "print_photos", array("none", "shutterfly", "shutterfly without donation")) ?></select></td>
</tr>
<?php
if ($gallery->app->use_exif) {
?>
<tr>
<td>EXIFデータの表示</td>
<td><select name="use_exif"><?php echo selectOptions($gallery->album, "use_exif", array("no", "yes")) ?></select></td>
</tr>
<?php
} // end if
?>
<tr>
<td>アルバムのクリック数の表示</td>
<td><select name="display_clicks"><?php echo selectOptions($gallery->album, "display_clicks", array("yes", "no")) ?></select></td>
</tr>
<tr>
<td>匿名によるコメント投稿を許可しますか？</td>
<td><select name="public_comments"><?php echo selectOptions($gallery->album, "public_comments", array("no", "yes")) ?></select></td>
</tr>
</table>

<br>
<input type=checkbox name=setNested value="1">サブアルバムに設定値を適用する（アルバムタイトルを除く）
<br>
<br>
<input type=submit name="submit" value="適用">
<input type=reset value="取りやめ">
<input type=submit name="submit" value="閉じる" onclick='parent.close()'>

</form>

<script language="javascript1.2">
<!--   
// position cursor in top form field
document.theform.title.focus();
//-->
</script>

</body>
</html>

