<?php
include_once('config.inc.php');
include_once('classes/core/Site.class.php');

// obtain a new instance of the easy-CMS site object
$site = &Site::getInstance(); // constructor checks the $_GET, $_POST and $_SESSION arrays
$contentsManager = &$site->getContentsManager();

$pictureId = $site->getSubmittedVar('picture_id', 0);

if($pictureId == 0) {
  die();
}

if(is_null($picture = &$contentsManager->getContent($pictureId, "gallery_photo", 1))) {
  die();
}

$langId = $site->getCurrentLangId();

$titleObj   = $picture->getContentFieldValue($langId, 'title');
$imageObj   = $picture->getContentFieldValue($langId, 'image');
$commentObj = $picture->getContentFieldValue($langId, 'comment');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

<style type="text/css">
#main {
	position: absolute;
	left: 50%;
	margin-left: -411px;
	width: 822px;
}

#title {
	height: 30px;
	line-height: 30px;
	font-family: arial, verdana, helvetica;
	font-size: 20px;
	font-weight: bold;
	text-decoration: underline;
	padding-left: 10px;
	padding-right: 10px;
}

#comment {
	height: 200px;
	font-family: arial, verdana, helvetica;
	font-size: 14px;
	font-weight: normal;
	margin-top: 10px;
	padding-left: 10px;
	padding-right: 10px;
}

#picture {
	margin-top: 10px;
	height: 600px;
}
</style>
</head>
<body>
<div id="main">
	<div id="title"><?php echo $titleObj->getValue(); ?></div>
  <?php
  if( strlen($commentObj->getValue()) > 0) {
  	?><div id="comment"><?php echo $commentObj->getValue(); ?></div><?php
  }
  ?>
	<div id="picture"><img src="<?php echo $imageObj->getValue(); ?>" border="0" /></div>
	<div style="font-family: arial, verdana, helvetica; font-size: 12px; text-align: center;"><a href="#" onclick="javascript:window.close();">Fermer cette fen&ecirc;tre</a></div>
</div>
</body>
</html>