Display FE Message
Since L* 7.4.0 the L*frontend (-class) holds a static method to display any messages/warnings/whatever in the frontend.
This documentation may not be accurate
To customize the layout you can place a copy of
~/upload/templates/lepsem/backend/backend/message.lte
inside the root of the frontend-template e.g.:
~/upload/templates/your_frontend-template/frontend/core/message.lte
You can use other names as "message.lte" (default) inside the method; see line 16 below the following.
Params - call
- /**
- * @param string $sType The css-'class' type off the message: success, error, positiv, whatever.
- * @param array|string $sMessage Any Message array | string.
- * @param string $sRedirect Any redirect (URL), mostly the current page itself.
- * @param int $iRedirectTime The redirect time. Keep in mind that this are js-milliseconds!
- * 3000 are 3 sec! A value like -1 means no timeout; stand still.
- * @param string $sTemplateName Any name of the .lte file in folder DEFAULT_TEMPLATE."/frontend/core/"
- * @param bool $bDirectOutput Prompt the message direct (echo),
- * false returns the generated source. Default is true == prompt!
- *
- */
- public static function displayFEMessage(
- string $sType ="success",
- array|string $aMessage=[],
- string $sRedirect="",
- int $iRedirectTime = -1,
- string $sTemplateName = "message.lte",
- bool $bDirectOutput = true
- );
Example given
LEPTON_frontend::displayFEMessage
Display a (separate) message in the frontend.
There is also a backend rellated method inside the LEPTON_admin class with the same params as above to handle situations without calling "print_footer" or "print_error":
LEPTON_admin::displayMessage
Example given
- echo LEPTON_admin::displayMessage(
- "success",
- [
- $oAUTOGAL->language['SETTINGS_SAVED'],
- $oAUTOGAL->language['SETTINGS_SAVED_2']
- ],
- ADMIN_URL.'/pages/modify.php?page_id='.$page_id,
- 3000, // in millisec!
- "message_autogallery_backend.lte", // inside the template dir of this module!
- false
- );