module_creator addmessage()

This commit is contained in:
OpenXE 2024-06-05 09:50:51 +02:00
parent 52b64ef8bc
commit 765e2ba217

View File

@ -85,10 +85,8 @@ class PLACEHOLDER_MODULECLASSNAME {
public function PLACEHOLDER_DELETE() { public function PLACEHOLDER_DELETE() {
$id = (int) $this->app->Secure->GetGET('id'); $id = (int) $this->app->Secure->GetGET('id');
$this->app->DB->Delete("DELETE FROM `PLACEHOLDER_MODULENAME` WHERE `id` = '{$id}'"); $this->app->DB->Delete("DELETE FROM `PLACEHOLDER_MODULENAME` WHERE `id` = '{$id}'");
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">Der Eintrag wurde gel&ouml;scht.</div>"); $this->app->Tpl->addMessage('error', 'Der Eintrag wurde gel&ouml;scht');
$this->PLACEHOLDER_LIST(); $this->PLACEHOLDER_LIST();
} }
@ -156,12 +154,14 @@ class PLACEHOLDER_MODULECLASSNAME {
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>"); $msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
header("Location: index.php?module=PLACEHOLDER_MODULENAME&action=list&msg=$msg"); header("Location: index.php?module=PLACEHOLDER_MODULENAME&action=list&msg=$msg");
} else { } else {
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich &uuml;bernommen.</div>"); $this->app->Tpl->addMessage('success', 'Die Einstellungen wurden erfolgreich &uuml;bernommen.');
} }
} }
// Load values again from database // Load values again from database
if ($id != 'NULL') {
$dropnbox = "PLACEHOLDER_DROPNBOX"; $dropnbox = "PLACEHOLDER_DROPNBOX";
$result = $this->app->DB->SelectArr("PLACEHOLDER_SQL_LIST"." WHERE id=$id"); $result = $this->app->DB->SelectArr("PLACEHOLDER_SQL_LIST"." WHERE id=$id");
@ -174,6 +174,7 @@ class PLACEHOLDER_MODULECLASSNAME {
} else { } else {
return; return;
} }
}
/* /*
* Add displayed items later * Add displayed items later