⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Add, edit, delete and back to list confirmation



sergio.lara

sergio.lara
  • profile picture
  • Member

Posted 30 June 2012 - 00:08 AM

Hello again! ^_^

How can I disable the confirmation message, except for delete action?

Thanks again!

fdias

fdias
  • profile picture
  • Member

Posted 30 June 2012 - 00:56 AM

There's only a confirm prompt for the delete. You mean the success messages?

sergio.lara

sergio.lara
  • profile picture
  • Member

Posted 30 June 2012 - 01:26 AM

Hey fdias!

Actually is not about confirming. Is when you hit "Cancel" or "Back to List" button.

fdias

fdias
  • profile picture
  • Member

Posted 30 June 2012 - 02:44 AM

If you are using flexigrid theme (default) then you can do this:

Edit files:

assets\grocery_crud hemes\flexigrid\views\add.php
assets\grocery_crud hemes\flexigrid\views\edit.php


Around line 21 you'll see this:
<a href='<?php echo $list_url?>' onclick='javascript: return goToList()' ><?php echo $this->l('form_back_to_list'); ?></a>

Change to this:
<a href='<?php echo $list_url?>'><?php echo $this->l('form_back_to_list'); ?></a>


This will remove the confirm for the back to list link.

Now around line 71 of the same files change this code:
<input type='button' value='<?php echo $this->l('form_cancel'); ?>' onclick='javascript: return goToList()' />

to this:
<input type='button' value='<?php echo $this->l('form_cancel'); ?>' />


This should remove the prompt for the cancel button.

I haven't tested yet so please let me know if it worked for you.

Boa sorte ;)

Kirk

Kirk
  • profile picture
  • Member

Posted 30 June 2012 - 14:19 PM

Hey fdias! Thanks for helping.

I think I"ll just let the messages as it is. I don't like the idea of doing changes on the grocery crud core. But I would suggest, in case web-johnny see this post, that this kind of feature could be configurable in the future versions. :)