public function testCollectionFileListColumn() { $testdata = <<<EOF Number,Type,Description,Notes,Files 1,Drawing,A drawing of a fish, fishy fishy fishy, /nonexistent/path.jpg;/another/badpath.jpg EOF; $collection = new Collection(); $collection->parseFromCSVData($testdata); $entries = $collection->getEntries(); $this->assertEquals(2, count($entries[0]["Files"])); $this->assertInstanceOf("Image", $entries[0]["Files"][0]); }
<?php require dirname(__FILE__) . "/autoload.php"; $id = $_GET['entry']; $image = $_GET['image']; $width = $_GET['width']; $collection = new Collection(); $collection->parseFromCSVData(file_get_contents(dirname(__FILE__) . "/" . $collection_file_path)); header('Content-Type: image/jpeg'); print $collection->getEntries()[$id]["Files"][$image]->getImage($width);
<!DOCTYPE html> <html> <head> </head> <body> <h1>List view</h1> <?php require dirname(__FILE__) . "/autoload.php"; $collection = new Collection(); $collection->parseFromCSVData(file_get_contents(dirname(__FILE__) . "/" . $collection_file_path)); $entries = $collection->getEntries(); for ($i = 0; $i < count($entries); $i++) { $entry = $entries[$i]; ?> <div> <div> <p><strong><?php print $entry["Type"] . ":" . $entry["Description"]; ?> </strong></p> <p><?php print $entry["Description"]; ?> </p> </div> <div> <a href="itemdetails.php?entry=<?php print $i; ?> "><img src="imageview.php?entry=<?php print $i;