<!DOCTYPE html>
<html>
<?php
require_once '../Includes/demodata.php';
$current = DemoData::getCurrentNode();
list($rootTitle, $rootUrl) = DemoData::getRootPage();
//This variable specifies relative path to the folder, where the gallery with uploaded files is located.
//Do not forget about the slash in the end of the folder name.
$galleryPath = '../UploadedFiles/';
$thumbnailsPath = $galleryPath . 'Thumbnails/';
$absGalleryPath = realpath($galleryPath) . DIRECTORY_SEPARATOR;
$descriptions = new DOMDocument('1.0');
$descriptions->load($absGalleryPath . 'files.xml');
?>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../Libraries/jquery.mobile/jquery.mobile-1.0b2.min.css" rel="stylesheet" type="text/css" />
<link href="../Styles/style.css" rel="stylesheet" type="text/css" />
<script src="../Libraries/jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="../Libraries/jquery.mobile/jquery.mobile-1.0b2.min.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" class="page" data-role="page" data-theme="d">
<div data-role="header" id="header" data-backbtn="false">
<img class="logo" src="../Images/logo_dark.png" alt="Aurigma logo" />
<?php echo DemoData::getSecondHeader(); ?>
</div>
<div data-role="content" id="content">
<div id="center">
<div class="demo">
<div class="inner">
<div class="container">
<div>
<a href="index.php" data-role="button" data-inline="true">Upload again</a></div>
<div class="gallery">
<ul class="gallery-link-list">
<?php
for ($i = 0; $i < $descriptions->documentElement->childNodes->length; $i++) :
$xmlFile = $descriptions->documentElement->childNodes->item($i);
$name = htmlentities($xmlFile->getAttribute('name'), ENT_COMPAT, 'UTF-8');
$source = 'showimage.php?';
$source .= 'image=' . rawurlencode($galleryPath . rawurlencode($xmlFile->getAttribute('source')));
$source .= '&title=' . rawurlencode($name);
?>
<li class="item">
<a data-rel="dialog" href="<?php echo $source; ?>"><?php echo $name; ?></a>
</li>
<?php endfor; ?>
</ul>
</div>
</div>
</div>
</div>
<ul class="tabs">
<li class="selected"><span>Description</span></li>
</ul>
<div class="tab-containers">
<div class="tab-container">
<div class="tab-inner">
<?php echo DemoData::getFullDescription($current['demo']); ?>
</div>
</div>
</div>
</div>
</div>
<div data-role="footer" id="footer">
<span class="copyright">© 2011 Aurigma, Inc.</span>
</div>
</form>
</body>
</html>