To alter the output (enqueueMessage)

  • Posts: 50
  • Thank you received: 4
13 years 1 month ago #8408

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.

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
13 years 1 month ago #8411

I'm not sure I understand the problem. Could you explain again please ?

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

  • Posts: 50
  • Thank you received: 4
13 years 1 month ago #8412

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.

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
13 years 1 month ago #8414

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.

  • Posts: 50
  • Thank you received: 4
13 years 1 month ago #8416

Nothing has changed :(

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
13 years 1 month ago #8422

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.053 seconds
Powered by Kunena Forum