version_compare(PHP_VERSION, '5')) { die('This file was generated for PHP 5'); } /** * Die Klasse BrowseView ist fr die Ansicht beim st�ern zust�dig. * * @author Christoph */ require_once('class.BrowseView.php'); /** * Die Klasse Controller ist die Elternklasse aller Controller * Searchcontroller) in der Controller Schicht. Jede dieser Controller Klassen * von der abstrakten Controller Klasse und implementiert die Methoden * object und handleEvent(event: string):void. getInstance gibt eine * des Controller Objektes zurck. handleEvent ist fr die Verarbeitung von * zust�dig und entscheidet welche View als Ergebnis verwendet wird. * * @author Christoph */ require_once('class.Controller.php'); /** * Die Klasse SearchView ist fr die Ansicht der Suchmaske zus�dig. * * @author Christoph */ require_once('class.SearchView.php'); /* user defined includes */ // section .:0000000000000BFF-includes begin // section .:0000000000000BFF-includes end /* user defined constants */ // section .:0000000000000BFF-constants begin // section .:0000000000000BFF-constants end /** * Die Klasse SearchContoller kontrolliert die Suchfunktion. * * @access public * @author Christoph */ class SearchController extends Controller { // --- ATTRIBUTES --- /** * Attribut der Klasse SearchContoller * * @access protected * @var object */ protected static $m_controller = null; // --- OPERATIONS --- /** * Gibt eine Referenz des SearchController Objektes zurck * * @access public * @author firstname and lastname of author, * @return java_lang_Object */ public static function getInstance() { $returnValue = null; // section .:0000000000000BF7 begin if (!isset (self :: $m_controller)) self::$m_controller = new SearchController(); $returnValue = self :: $m_controller; // section .:0000000000000BF7 end return $returnValue; } /** * Ist fr die Verarbeitung von Ereignissen zust�dig, welche sich auf die * beziehen * * @access public * @author firstname and lastname of author, * @param string * @return void */ public function handleEvent($event) { // section .:0000000000000BFB begin //berprft das event und fhrt zur richtigen funktion switch ($event) { case 'search' : //print_r($_REQUEST); // Output: Array ( [action] => search [description] => TEST [price] => ) $view = new SearchView($_REQUEST); break; case 'search_form' : include ('templates/search_form.php'); break; case 'browse' : default : $view = new BrowseView(); break; } if (isset ($view)) $view->display(); // section .:0000000000000BFB end } /** * Erzeugt einen Standart Konstruktor * * @access protected * @author firstname and lastname of author, * @return void */ protected function __construct() { // section .:0000000000000BFE begin parent:: __construct(); // section .:0000000000000BFE end } } ?>