コード例 #1
0
 /**
  * @deprecated use \oat\tao\model\requiredAction\implementation\RequiredActionRedirectUrlPart instead
  *
  * Execute an action
  * @param array $params
  * @return mixed
  */
 public function execute(array $params = [])
 {
     $context = \Context::getInstance();
     $excludedRoutes = $this->getExcludedRoutes();
     $currentRoute = ['extension' => $context->getExtensionName(), 'module' => $context->getModuleName(), 'action' => $context->getActionName()];
     if (!in_array($currentRoute, $excludedRoutes)) {
         $currentUrl = \common_http_Request::currentRequest()->getUrl();
         $url = $this->url . (parse_url($this->url, PHP_URL_QUERY) ? '&' : '?') . 'return_url=' . urlencode($currentUrl);
         $flowController = new FlowController();
         $flowController->redirect($url);
     }
 }
コード例 #2
0
 /**
  * Redirect using the TAO FlowController implementation
  * @see {@link oat\model\routing\FlowController}
  */
 public function redirect($url, $statusCode = 302)
 {
     $flow = new FlowController();
     $flow->redirect($url, $statusCode);
 }