Message class for note texts

Using the Class Message in message.php Note texts can be created. With this new class err_msg.php is to be replaced.

Advantages of the new class:

Disadvantages:

The files are already in common.php included and an Object $gMessage also exists automatically.

If you now want to output an advisory text, the simple call is sufficient:

$gMessage->show('text code');

The texts are managed in message_text.php. There should not occur PHP variables or code snippets. If you need variables so you can set a placeholder with scheme %VAR1%. For further placeholders simply increment (%VAR2%, % VAR3% …). (Most of the texts with variables are already replaced but some still exists)

The variables are set with

$gMessage->addVariableContent($myVariable, 1);

The 2nd passed parameter is the variable number. But it can also be omitted, then the variables must be actually delivered in the correct order. If there is only one variable in the text (is approximately 90% of cases) so you can also use an abbreviated notation and the variable is passed directly when calling.

$gMessage->show('text code', $myVariable1);

If you want to redirect to an URL so you can call

$gMessage->setForwardUrl($myUrl, 2000);

Here the second passed parameter is optional. If it is specified these are the milliseconds after which is automatically redirected to the page. If it is not specified then there is a Next button.

If forwarding to an URL, give the user the opportunity to decide this himself, so can can call the function

$gMessage->setForwardYesNo($myUrl);

Only the URL is passed to reference at Yes. This makes sense, for example, at delete queries.