File: /var/www/vhosts/creativefellows.nl/figi.creativefellows.nl/classes/CalendarItem.php
<?php
class CalendarItem extends BaseController{
function __construct($entry_data){
foreach($entry_data as $el => $val)
{
$this->$el = $val;
}
$this->convertDate();
//d($this);
}
private function convertDate()
{
$this->datum = "20" . substr($this->datum,6,2) . "-" . substr($this->datum,3,2) . "-" . substr($this->datum,0,2);
}
public function getRevealId()
{
return $this->vl( $this->getTitle() );
}
public function getTitle(){
return $this->titel;
}
private function getHeadingTitle()
{
return '<h1>'. $this->getTitle() .'</h1>';
}
private function getHeadingGenre()
{
return '<h2>'. $this->genre .'</h2>';
}
public function getDate()
{
return strftime("%d-%m-%Y",strtotime($this->datum));
}
public function getType(){
return $this->type;
}
public function getText()
{
return preg_replace('#\s(id|class|style)="[^"]+"#', '', $this->tekst);
}
public function getImage()
{
return $this->image ? '<img src="'. $this->image .'" style="float:right;padding-left:1rem;" />' : '';
}
public function getButton()
{
return '<hr><p><a href="'. $this->getLink() .'" class="button primary">Bestel Tickets</a></p>';
}
private function getCloseButton(){
return '<button class="close-button" data-close aria-label="Close modal" type="button"><span aria-hidden="true">×</span></button>';
}
private function getLink(){
return $this->link;
}
public function getReveal()
{
return '<div class="reveal" id="'. $this->getRevealId() .'" data-reveal>' . $this->getHeadingTitle() . $this->getHeadingGenre() . $this->getImage() . $this->getText() . $this->getButton() . $this->getCloseButton() .'</div>';
}
}
?>