Skip to main content

To alter the output (enqueueMessage)

More
15 years 7 months ago #8408 by korkunov
Proposal.
To alter the output of system messages (enqueueMessage).
Principle - the string concatenation, and only after that output.
Why:
The latter conclusion HIKASHOP_SUCC_SAVED / ERROR are overwrite the previous output message(s).
That is, messages MENU_WITHOUT_ASSOCIATED_MODULE and others simply lose their meaning - they are not visible.

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #8411 by nicolas
I'm not sure I understand the problem. Could you explain again please ?

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #8412 by korkunov
eg.
back\classes\menus.php
if($element=='category' && empty($element)){
$app =& JFactory::getApplication();
$app->enqueueMessage(JText::_('MENU_WITHOUT_ASSOCIATED_MODULE'), 'error');
$app->enqueueMessage(JText::_('ASSOCIATED_MODULE_NEEDED'));
$app->enqueueMessage(JText::sprintf('ADD_MODULE_AUTO',hikashop::completeLink('menus&task=add_module&cid='.(int)$module->id.'&'.JUtility::getToken().'=1')));
}

.....
$app->enqueueMessage(JText::_( 'HIKASHOP_SUCC_SAVED' ));

MENU_WITHOUT_ASSOCIATED_MODULE, ASSOCIATED_MODULE_NEEDED, ADD_MODULE_AUTO displayed 0.00001 sec, then HIKASHOP_SUCC_SAVED displayed.

This is understandable :)

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #8414 by nicolas
After the line :
if($element=='category' && empty($element)){

you can add:
$result=false;

which will result in displaying the error message instead of the successful message.

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #8416 by korkunov
Nothing has changed :(

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #8422 by nicolas
Could you copy/paste the code you have now ? That should have removed the successful message and replaced it with the error message when the associated module is missing.

Please Log in or Create an account to join the conversation.

Time to create page: 0.217 seconds
Powered by Kunena Forum