• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implemented Redirect after Addon Installation

xf_phantom

Well-known member
#1
Could you pls change it to
Code:
      // ugly hack...
       $redirect = XenForo_Link::buildAdminLink('add-ons');
       if (XenForo_Application::isRegistered('addOnRedirect'))
       {
         $redirect = XenForo_Application::get('addOnRedirect');
       }

       if ($redirect instanceof XenForo_ControllerResponse_Reroute){
         return $redirect;
       }


       return $this->responseRedirect(
         XenForo_ControllerResponse_Redirect::SUCCESS,
         $redirect
       );
I know, it looks strange, because why would somebody have a controlleraction without a route, but i have some uses for this, were a own route or usage of a proxyclass would be really too much overhead, because the page will only be necessary after the addon installation and upgrades.
 

Jon W

Well-known member
#2
Or perhaps this would allow for even more flexibility:
Code:
      // ugly hack...
      $redirect = XenForo_Link::buildAdminLink('add-ons');
      if (XenForo_Application::isRegistered('addOnRedirect'))
      {
        $redirect = XenForo_Application::get('addOnRedirect');
      }

      if ($redirect instanceof XenForo_ControllerResponse_Abstract){
        return $redirect;
      }

      return $this->responseRedirect(
        XenForo_ControllerResponse_Redirect::SUCCESS,
        $redirect
      );