<?php include 'en/admin/_adminheader.php'; ?>
<h2>Photos and Videos Page: Add a Photo to an Album</h2>
<p>
	To add a photo to a album, select which album it should be added to
	from the drop-down menu and then find the photo with the "Browse" button.
</p>
<p>
	You cannot add photos to albums that contain other albums.
</p>
<p>
	You can upload photos of any size.  They will automatically be resized
	for easy viewing in anyone's browser.
</p>
<form action='/admin/photosandvideos.php' method='post' enctype="multipart/form-data">
	<fieldset id='photo_info'>
		<legend>Photo Information</legend>
		<input type='hidden' name='what' value='photos' id='what' />
		<input type='hidden' name='do' value='doaddphoto' id='do' />
		<div class='field'>
			<label for='which'>Choose album</label>
			<select name='which' id='which'>
			<?php foreach($this->data['albums'] as $album): ?>
				<?php if(isset($album->subalbums->subalbum)): continue; endif; ?>
				<option value='<?php echo $album['id'] ?>'><?php echo $album->name ?></option>
			<?php endforeach; ?>
			</select>
		</div>
		<div class='field'>
			<label for='file'>
				Photo file<br />
				<a href='javascript:AddPhotoElement()' title='Add another photo'>
					Add another photo
				</a>
			</label>
			<div id='new_photos' class='new_photos'>
				<input type='file' name='file[]' id='file' class='oneofmany' /><br />
				<input type='file' name='file[]' id='file' class='oneofmany' /><br />
				<input type='file' name='file[]' id='file' class='oneofmany' />
			</div>
		</div>
		<div>
			<input type='button' value='Cancel' onClick='document.location="/admin/photosandvideos.php?what=photos"' />
			<input type='submit' value='Add photo to album' />
		</div>
	</fieldset>
</form>
