2026-07-15 13:57:05 +02:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Frontend handler
|
|
|
|
|
*/
|
|
|
|
|
class ZAPController {
|
|
|
|
|
/**
|
|
|
|
|
* String mode
|
|
|
|
|
*/
|
|
|
|
|
private $mode;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Parsable content object
|
|
|
|
|
*/
|
|
|
|
|
private $action;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class prefix
|
|
|
|
|
*/
|
|
|
|
|
private $prefix = 'ZAP';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor
|
|
|
|
|
*/
|
|
|
|
|
public function __construct($mode = 'home') {
|
|
|
|
|
$mode = trim(strip_tags($mode));
|
|
|
|
|
$this->mode = ucfirst($mode);
|
|
|
|
|
$clazz = $this->prefix . $this->mode;
|
|
|
|
|
if (!class_exists($clazz)) {
|
|
|
|
|
die('Wrong parameter');
|
|
|
|
|
}
|
|
|
|
|
$this->action = new $clazz();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string content
|
|
|
|
|
*/
|
|
|
|
|
public function fetch() {
|
2026-07-18 11:56:54 +02:00
|
|
|
if (!($this->action instanceof ZAPHandler)) {
|
|
|
|
|
die('Handler does not implement ZAPHandler interface');
|
|
|
|
|
}
|
2026-07-15 13:57:05 +02:00
|
|
|
return $this->action->getContent();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|