- Posts: 50
- Thank you received: 4
To alter the output (enqueueMessage)
15 years 7 months ago #8408
by korkunov
To alter the output (enqueueMessage) was created 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.
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.
15 years 7 months ago #8411
by nicolas
Replied by nicolas on topic Re: To alter the output (enqueueMessage)
I'm not sure I understand the problem. Could you explain again please ?
Please Log in or Create an account to join the conversation.
15 years 7 months ago #8412
by korkunov
Replied by korkunov on topic Re: To alter the output (enqueueMessage)
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
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.
15 years 7 months ago #8414
by nicolas
Replied by nicolas on topic Re: To alter the output (enqueueMessage)
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.
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.
15 years 7 months ago #8416
by korkunov
Replied by korkunov on topic Re: To alter the output (enqueueMessage)
Nothing has changed
Please Log in or Create an account to join the conversation.
15 years 7 months ago #8422
by nicolas
Replied by nicolas on topic Re: To alter the output (enqueueMessage)
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.185 seconds