Add displayError utility function
parent
8e20909f23
commit
9e0267513b
|
@ -3,14 +3,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace Mcp\Page;
|
||||
|
||||
use Mcp\Util\Util;
|
||||
|
||||
class Error extends \Mcp\RequestHandler
|
||||
{
|
||||
public function get(): void
|
||||
{
|
||||
http_response_code(404);
|
||||
$this->app->template('error.php')->parent('__presession.php')->vars([
|
||||
'title' => 'Seite nicht gefunden',
|
||||
'error-message' => 'Die gewünschte Seite wurde nicht gefunden.'
|
||||
])->render();
|
||||
Util::displayError($this->app, 'Die gewünschte Seite wurde nicht gefunden.');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,4 +60,12 @@ class Util
|
|||
$rawXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?><methodCall><methodName>grid_instant_message</methodName><params><param><value><struct><member><name>position_x</name><value><string>0</string></value></member><member><name>position_y</name><value><string>0</string></value></member><member><name>position_z</name><value><string>0</string></value></member><member><name>to_agent_id</name><value><string>".$toUUID."</string></value></member><member><name>from_agent_session</name><value><string>00000000-0000-0000-0000-000000000000</string></value></member><member><name>im_session_id</name><value><string>".$fromUUID."</string></value></member><member><name>from_agent_name</name><value><string>".$fromName."</string></value></member><member><name>from_agent_id</name><value><string>".$fromUUID."</string></value></member><member><name>binary_bucket</name><value><string>AA==</string></value></member><member><name>region_handle</name><value><i4>0</i4></value></member><member><name>region_id</name><value><string>00000000-0000-0000-0000-000000000000</string></value></member><member><name>parent_estate_id</name><value><string>1</string></value></member><member><name>timestamp</name><value><string>".time()."</string></value></member><member><name>dialog</name><value><string>AA==</string></value></member><member><name>offline</name><value><string>AA==</string></value></member><member><name>from_group</name><value><string>FALSE</string></value></member><member><name>message</name><value><string>".$text."</string></value></member></struct></value></param></params></methodCall>";
|
||||
Util::getDataFromHTTP($targetURL, $rawXML, "text/xml");
|
||||
}
|
||||
|
||||
public static function displayError($app, $message): void
|
||||
{
|
||||
$app->template('error.php')->parent('__presession.php')->vars([
|
||||
'title' => 'Fehler',
|
||||
'error-message' => $message
|
||||
])->render();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue