1. 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

Discussion in 'Closed Suggestions' started by xf_phantom, Aug 7, 2013.

  1. xf_phantom

    xf_phantom Well-Known Member

    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.
     
    Dan and Jon W like this.
  2. Jon W

    Jon W Well-Known Member

    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
          );
     
    Dan, Daniel Hood and xf_phantom like this.
  3. Mike

    Mike XenForo Developer Staff Member

    In 1.3, you can set it to a XenForo_ControllerResponse_Abstract.
     
    xf_phantom, Chris D, Dan and 2 others like this.

Share This Page