<?php include 'en/admin/_adminheader.php'; ?>
<h2>Photos and Videos Page: Edit an Album</h2>
<form action='/admin/photosandvideos.php' method='post' enctype="multipart/form-data">
	<fieldset id='album_info'>
		<legend>Album Information</legend>
		<input type='hidden' name='what' value='photos' id='what' />
		<input type='hidden' name='do' value='doeditalbum' id='do' />
		<input type='hidden' name='which' value='<?php echo $this->data['album']['id'] ?>' id='which' />
		<div class='field'>
			<label for='subalbumof'>Sub-album of</label>
			<select id='subalbumof' name='subalbumof'>
					<option value='0'>None</option>
				<?php foreach($this->data['albums'] as $album): ?>
					<?php if((string)$album->name == (string)$this->data['album']->name): continue; endif; ?>
					<option value='<?php echo $album['id'] ?>'
						<?php if((int)$album['id'] == (int)$this->data['album']->subalbumof): echo "selected='select'"; endif; ?>>
						<?php echo $album->name ?>
					</option>
				<?php endforeach; ?>
			</select>
		</div>
		<div class='field'>
			<label for='name'>Name of album</label>
			<input type='text' name='name' id='name' value='<?php echo $this->data['album']->name ?>'/>
		</div>
		<div>
			<input type='button' value='Cancel' onClick='document.location="/admin/photosandvideos.php?what=photos"' />
			<input type='submit' value='Edit Album' />
		</div>
	</fieldset>
</form>
