<?php
/*****************************************************************************
 * ConfirmDeletePage.php
 * Contains the confirm delete page template.
 *
 * Kabuki CMS (C) 2013-2016, Aaron van Geffen
 *****************************************************************************/

class ConfirmDeletePage extends SubTemplate
{
	private $photo;

	public function __construct(Image $photo)
	{
		$this->photo = $photo;
	}

	protected function html_content()
	{
		$this->confirm();
		$this->photo();
	}

	private function confirm()
	{
		echo '
				<div id=confirm_box>
					<h1>Confirm deletion</h1>
					<p>You are about to permanently delete the following photo.</p>	
					<a class="btn btn-red" href="', BASEURL, '/confirmdelete?slug=', $this->photo->getSlug(), '&confirmed">Delete</a>
					<a class="btn" href="', $this->photo->getPageUrl(), '"> Cancel</a>
				</div>';
	}

	private function photo()
	{
		echo '
				<div id="photo_frame">
					<a href="', $this->photo->getUrl(), '">';

		if ($this->photo->isPortrait())
			echo '
						<img src="', $this->photo->getThumbnailUrl(null, 960), '" alt="">';
		else
			echo '
						<img src="', $this->photo->getThumbnailUrl(1280, null), '" alt="">';

		echo '
					</a>
				</div>';
	}
}