<?php
	require_once("inc/page.inc.php");
	
	htmlStart("Quotes");
	
	page("Quotes");
	
	$quotes = new Filter("quotes");
	foreach($quotes->apply() as $qid) {
		$quote = new Object($qid);
		
		$bron = $quote->getFieldData("bron");
		$text = $quote->getFieldData("quote");
				
		if($quote->getFieldData("text") == NULL) {
			if($quote->getFieldData("link") == NULL) {
				// do nothing;
			} else {
				$text = $r->link($text, $quote->getFieldData("link"));
			}
		} else {
			$text = $r->link($text, "quote/$qid/".string_to_html_filename($bron));
		}
		
		$datum = strftime("%d %B %Y", $quote->getFieldData("datum"));
		
		$datum = ($datum != NULL) ? ", $datum" : "";
		
		$rows[] = array($t->textileThis($text) . "<span class='small'><em>$bron</em>$datum</span>");
		
	}
	print $r->table(NULL, $rows, array("odd", "even"), NULL, array("width" => "640px"));

	htmlEnd();
?>