function &($requestData) {
$dir = $this->();
$id = isSet($requestData["id"]) ? $requestData["id"] : null;
$specifiedHandler = $handler = isSet($requestData["pntHandler"])
? $requestData["pntHandler"] : null;
$property = ucFirst(isSet($requestData["pntProperty"]) ? $requestData["pntProperty"] : '');
$type = isSet($requestData["pntType"]) ? $requestData["pntType"] : null;
if ($handler=='PropertyPage')
$handler = "Property$property".'Page';
elseif (!$handler) {
if ($property == 'pntList')
$handler = 'IndexPage';
elseif ($id !== null)
$handler = 'EditDetailsPage';
else
$handler = 'IndexPage';
}
$attempted = array();
$info = null;
$handlerClass = "$type$handler";
$included = $this->($handlerClass, $this->());
$attempted = array_merge($attempted, $this->($handlerClass, $this->()));
if (!$included && $property) {
//there is no specific handler for this type and property, try type-handler
$handler = $specifiedHandler;
$handlerClass = "$type$handler";
$included = $this->($handlerClass, $this->());
$attempted = array_merge($attempted, $this->($handlerClass, $this->()));
}
if (!$included && $type) {
//there is no specific handler for this type, try generic handler from same dir
$handlerClass = "Object$handler";
$included = $this->($handlerClass, $this->());
$attempted = array_merge($attempted, $this->($handlerClass, $this->()));
}
if (!$included) {
$name = $this->();
$errorMessage = "$name - handler not found: $handler, tried: <BR>\n";
$errorMessage .= $this->($attempted);
trigger_error($errorMessage, E_USER_ERROR);
}
// print "<BR>Handler: $handlerClass $included";
$result =& new $handlerClass($this, $requestData);
if ($this->() == 'verbose') {
$info = 'Handlers tried<BR>(one of last two succeeded): ';
$info .= $this->($attempted);
$result->($info);
}
return $result;
}