Exemplo n.º 1
0
 function title($pdf, $event_instance)
 {
     $pdf->SetLink($event_instance->get_linker($pdf), $this->y);
     $color = $this->color($event_instance->event->category->color);
     $pdf->SetLineWidth(0.5);
     $pdf->SetFillColor($color['r'], $color['g'], $color['b']);
     $pdf->RoundedRect(10, $this->y, 190, 17, 5, '1001', 'DF');
     $pdf->SetLineWidth(0.2);
     $pdf->SetXY(15, $this->y + 1);
     $pdf->SetFont('', 'B', 30);
     $name = "(" . $event_instance->day->day_nr . "." . $event_instance->event_nr . ") ";
     $name .= $event_instance->event->category->short_name . ": ";
     $name .= $event_instance->event->name;
     $name_width = $pdf->GetStringWidth($name);
     if ($name_width > 120) {
         $name_font_size = max(15, 30 * 120 / $name_width);
         $pdf->SetFont('', 'B', $name_font_size);
         //$name_dy = ( 30 - $name_font_size ) / 4;
         //$pdf->SetXY( 15, $this->y + $name_dy );
     }
     $pdf->MultiCell(130, 30, $name, '', 'L');
     $pdf->SetFont('', 'B', 10);
     $date = new c_date();
     $date->SetDay2000($event_instance->day->subcamp->start + $event_instance->day->day_nr - 1);
     $time = new c_time();
     $time->SetValue($event_instance->starttime);
     $pdf->SetXY(155, $this->y + 1);
     $pdf->drawTextBox('Datum:', 15, 5, 'L', 'M', 0);
     $pdf->SetXY(170, $this->y + 1);
     $pdf->drawTextBox(strtr($date->getString('D d.m.Y'), $GLOBALS[en_to_de]), 30, 5, 'L', 'M', 0);
     $pdf->Link(170, $this->y + 1, 30, 5, $event_instance->day->get_linker($pdf));
     $pdf->SetXY(155, $this->y + 6);
     $pdf->drawTextBox('Zeit:', 15, 5, 'L', 'M', 0);
     $pdf->SetXY(170, $this->y + 6);
     $pdf->drawTextBox($time->getString('H:i') . " Uhr", 30, 5, 'L', 'M', 0);
     $pdf->SetXY(155, $this->y + 11);
     $pdf->drawTextBox('Ort:', 15, 5, 'L', 'M', 0);
     $pdf->SetXY(170, $this->y + 11);
     $pdf->drawTextBox($event_instance->event->place, 30, 5, 'L', 'M', 0);
     $pdf->Bookmark($name, 2, $this->y);
     //$this->y += 22;
     $this->y += 17;
 }