File: D:/HostingSpaces/SBogers64/klimroosbudel.nl/wwwroot/lib/general/image_reader.class.php
<?php
/**
* c_home.class.php
* Created by Komma Mediadesign.
* Author: mike
* Date: 11/02/14
*/
class Image_Reader
{
private $_page;
public function __construct($page)
{
$this->_page=$page;
}
/*
* Index of the home page
*/
private function read()
{
if ($handle = opendir(DOCUMENT_IMAGE_ROOT . 'static/' . $this->_page))
{
$data = array();
while (false !== ($entry = readdir($handle)))
{
if ($entry != "." && $entry != "..")
{
$data[] = $entry;
}
}
closedir($handle);
return $data;
}
return false;
}
public function createList()
{
$output = '';
if ($data = $this->read())
{
foreach ($data as $image)
{
$output .= '<li><img src="' . IMAGE_ROOT . 'static/' . $this->_page . '/' . $image . '" class="slider" /></li>';
}
}
return $output;
}
}