<?php
	require_once("../zp-core/template-functions.php");
	require_once("../zp-core/zp-config.php");
	require_once("json.php");
	
	class FBGallery
	{
		var $title;
		var $albums;
		var $navigation;
		
		function FBGallery($title)
		{
			$this->title = $title;
			$this->navigation = new FBNavigation();
			$this->albums = array();
		}
		
		function addAlbum($album)
		{
			array_push($this->albums, $album);
		}
		
		function getAlbums()
		{
			return $this->albums;
		}
	}
	
	class FBAlbum
	{
		var $title;
		var $url;
		var $thumbnail;
		var $albumDate;
		var $description;
		
		//fetched iff browsing an album page
		var $images;
		var $navigation;
		var $parentAlbumList;
		var $subAlbumList;
		var $galleryTitle;
		
		function FBAlbum($title ='', $url = '', $thumbnail = '', $albumDate = '', $description = '')
		{
			$this->title = $title;
			$this->url = $url;
			$this->thumbnail = $thumbnail;
			$this->albumDate = $albumDate;
			$this->description = $description;
			$this->navigation = new FBNavigation();
			$this->images = array();
			$this->parentAlbumList = array();
			$this->subAlbumList = array();
		}
		
		function addParentAlbum($parentUrl, $parentTitle)
		{
			$this->parentAlbumList[$parentUrl] = $parentTitle;
		}
		
		function addSubAlbum($child)
		{
			array_push($this->subAlbumList, $child);
		}
		
		function addImage($image)
		{
			array_push($this->images, $image);
		}
	}
	
	class FBImage
	{
		var $url;
		var $thumbnail;
		var $title;
		
		//fetched iff displaying the image
		var $prevUrl;
		var $nextUrl;
		
		function FBImage($url, $thumbnail, $title)
		{
			$this->url = $url;
			$this->thumbnail = $thumbnail;
			$this->title = $title;
		}
	}
	
	class FBNavigation
	{
		var $pages;
		var $hasSkippedPages = false;
		
		function FBNavigation()
		{
			$this->pages = array();
		}
		
		function addPage($page)
		{
			array_push($this->pages, $page);
		}
		
		function getPages()
		{
			return $this->pages;
		}
	}
	
	class FBPage
	{
		var $isCurrent;
		var $number;
		var $url;
		
		function FBPage($number, $url, $current=false)
		{
			$this->isCurrent = $current;
			$this->number= $number;
			$this->url = $url;
		}
	}
?>