Implemented Redirect after Addon Installation

xf_phantom

Well-known member
Could you pls change it to
Rich (BB 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.
 
Upvote 2
This suggestion has been implemented. Votes are no longer accepted.
Or perhaps this would allow for even more flexibility:
Rich (BB 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
      );
 

Similar threads

Back
Top Bottom