require_once('class.plakat.php');
define('IMAGE_WIDTH', 10000);
define('IMAGE_HEIGHT', 10000);
class HtmlPlakat extends Plakat
{
var $data;
var $curr;
var $currId;
function HtmlPlakat()
{
$this->Plakat(10, 20, 30);
}
function createHtml($ids, $showYear = false)
{
if (!is_array($ids))
{
$ids = array($ids);
}
$this->data = array();
$this->drawPage($ids, IMAGE_WIDTH, count($ids) * IMAGE_HEIGHT, 500, 0, 0, count($ids) * 3, 1, $showYear, true);
// save the last item to the data array
$this->_nextItem();
$output='';
/*css is in file now*/
/*
$output = '';
*/
$output .= '
';
}
unset($item[$firstKey]);
$groups = array();
$groupIdx = -1;
$lastY = -1000;
foreach ($item as $y => $line)
{
if ($y - $lastY > 50)
{
$groupIdx++;
}
$lineSize = -1;
foreach ($line as $x => $part)
{
if ($lineSize < 0 || $lineSize == $part['size'])
{
$lineSize = $part['size'];
}
else
{
// add "follow" flag for all parts that are not the same size
// as the first part of the same line. This means it will
// follow immediately the previous text without going into
// a new cell
$line[$x]['follow'] = true;
}
}
$lastY = $y;
$groups[$groupIdx][$y] = $line;
}
$output .= '';
$output .= '
';
$output .= '
'.$title.'
';
$output .= '
';
//$this->debug($groups);
foreach ($groups as $g => $group)
{
if ($g > 0)
{
$output .= '