<?
if ($_GET['frame'] == "controls") {
require_once($sys['root']."/system/includes/slideshow/controls.inc");
} elseif ($_GET['frame'] == "display") {
require_once($sys['root']."/system/includes/slideshow/display.inc");
} else {



if ($_GET['uid']) {

	$shareInfo = $share->getInfo($_GET['uid'], $sys['path'], "");
	$sys['fullPath'] = $shareInfo['path'];

} else {

$path = gluePath("/",$sys['path']);
$sys['fullPath'] = gluePath($permissions['path'],$path);

}

$d = dir($sys['fullPath']);
while ($file = @$d->read()) {
	if (
$file != "." && 
$file != ".." && 
!in_array($file, $ignoreFiles) && 
!is_dir(gluePath($sys['fullPath'], $file)) && 
$img->isImage($file)
) {

	if ($file==$_GET['object']) {
		$nextObject = $objects[$i+1];
		$previousObject = $objects[$i-1];
	}
	$objects[] = $file;
	}
}


$path = $_GET['path'];
if (strlen($_GET['object']) == 0) {
	$file = $objects[0];
} else {
	$file = $_GET['object'];
}

$controlsFrameSrc = "?slideshow=1&frame=controls&path=".$str->forURL($path)."&object=".$str->forURL($file)."&uid=".$str->forURL($sys['uid'])."";

$displayFrameSrc = "?slideshow=1&frame=display&path=".$str->forURL($path)."&object=".$str->forURL($file)."&uid=".$str->forURL($sys['uid'])."";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title><?$lang->display("Slideshow");?></title>
<?if ($file) {?>
<!-- frames -->
<frameset rows="80,*">
    <frame name="controlsFrame" id="controlsFrame" src="<?echo $controlsFrameSrc?>" marginwidth="10" marginheight="0" scrolling="no" frameborder="0" noresize>
    <frame name="displayFrame" id="displayFrame" src="<?echo $displayFrameSrc?>" marginwidth="0" marginheight="0" scrolling="auto" frameborder="0">
</frameset>
<?} else {?>
<script language="JavaScript1.2" type="text/javascript">
alert('<?$lang->display("Folder does not contain any image files.");?>');
window.close();
</script>
<?}?>
</head>
<body>
</body>
</html>
<?}?>
