Jump to content

Tools::redirectAdmin back to self instead of opening a new window


dazmania

Recommended Posts

Hi all,

 

I'm attempting to use the postProcess function in my module, all I would like to do is run some task and then return the user to the same page that they were on. To do this I try to use Tools::redirectAdmin but my browser opens another window.

 

Is there a way to prevent a new window from opening ?

 

Here is the code:

        public function postProcess()
        {
                if (Tools::isSubmit('dosomething') ) {
                        $order_id = Tools::getValue('dosomething');
                        $file = fopen("/var/tmp/didsomething","a");
                        echo fwrite($file, $order_id);
                        fclose($file);


                        Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);

                }

Many thanks !

( again )

 

D

Link to comment
Share on other sites

Hi thanks for posting back to me.

 

You mean:

public function postProcess()
{
if (Tools::isSubmit('dosomething') ) {
$order_id = Tools::getValue('dosomething');
$file = fopen("/var/tmp/didsomething","a");
echo fwrite($file, $order_id);
fclose($file);

echo javascript (<script>location.reload();</script>)

}

 

I'm not sure that this will work. I post params to Adminmymodule ( dosomething ) and then would like to return back to the same page without opening a new window.

The call looks like:

mydomain/index.php?controller=Adminmymodule&token=14a8e744b208adc9691f8ad15c18b5d3&submitAction=dosomething&dosomething=5

 

When I've processed the data I want to return to

mydomain/index.php?controller=Adminmymodule&token=14a8e744b208adc9691f8ad15c18b5d3

 

Without opening a new browser window / tab.

 

Cheers,

D
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...