@@ -280,27 +280,22 @@ public function redirectTool(
280280 }
281281
282282 /*public function redirectToShortCut(string $toolName, CToolRepository $repo, ToolChain $toolChain): RedirectResponse
283- {
284- $tool = $repo->findOneBy([
285- 'name' => $toolName,
286- ]);
287-
288- if (null === $tool) {
289- throw new NotFoundHttpException($this->trans('Tool not found'));
290- }
291-
292- $tool = $toolChain->getToolFromName($tool->getTool()->getTitle());
293- $link = $tool->getLink();
294-
295- if (strpos($link, 'nodeId')) {
296- $nodeId = (string) $this->getCourse()->getResourceNode()->getId();
297- $link = str_replace(':nodeId', $nodeId, $link);
298- }
299-
300- $url = $link.'?'.$this->getCourseUrlQuery();
301-
302- return $this->redirect($url);
303- }*/
283+ * {
284+ * $tool = $repo->findOneBy([
285+ * 'name' => $toolName,
286+ * ]);
287+ * if (null === $tool) {
288+ * throw new NotFoundHttpException($this->trans('Tool not found'));
289+ * }
290+ * $tool = $toolChain->getToolFromName($tool->getTool()->getTitle());
291+ * $link = $tool->getLink();
292+ * if (strpos($link, 'nodeId')) {
293+ * $nodeId = (string) $this->getCourse()->getResourceNode()->getId();
294+ * $link = str_replace(':nodeId', $nodeId, $link);
295+ * }
296+ * $url = $link.'?'.$this->getCourseUrlQuery();
297+ * return $this->redirect($url);
298+ * }*/
304299
305300 /**
306301 * Edit configuration with given namespace.
@@ -376,7 +371,7 @@ public function about(
376371
377372 $ courseValues = new ExtraFieldValue ('course ' );
378373
379- $ urlCourse = api_get_path (WEB_PATH ).sprintf ('course/%s/about ' , $ courseId );
374+ $ urlCourse = api_get_path (WEB_PATH ).\ sprintf ('course/%s/about ' , $ courseId );
380375 $ courseTeachers = $ course ->getTeachersSubscriptions ();
381376 $ teachersData = [];
382377
@@ -789,7 +784,7 @@ private function autoLaunch(): void
789784 // Redirecting to the LP
790785 $ url = api_get_path (WEB_CODE_PATH ).'lp/lp_controller.php? ' .api_get_cidreq ();
791786 $ _SESSION [$ session_key ] = true ;
792- header (sprintf ('Location: %s ' , $ url ));
787+ header (\ sprintf ('Location: %s ' , $ url ));
793788
794789 exit ;
795790 }
@@ -826,7 +821,7 @@ private function autoLaunch(): void
826821 'lp/lp_controller.php? ' .api_get_cidreq ().'&action=view&lp_id= ' .$ lp_data ['iid ' ];
827822
828823 $ _SESSION [$ session_key ] = true ;
829- header (sprintf ('Location: %s ' , $ url ));
824+ header (\ sprintf ('Location: %s ' , $ url ));
830825
831826 exit ;
832827 }
@@ -852,7 +847,7 @@ private function autoLaunch(): void
852847 }
853848 } else {
854849 $ url = api_get_path (WEB_CODE_PATH ).'forum/index.php? ' .api_get_cidreq ();
855- header (sprintf ('Location: %s ' , $ url ));
850+ header (\ sprintf ('Location: %s ' , $ url ));
856851
857852 exit ;
858853 }
@@ -870,7 +865,7 @@ private function autoLaunch(): void
870865 } else {
871866 // Redirecting to the document
872867 $ url = api_get_path (WEB_CODE_PATH ).'exercise/exercise.php? ' .api_get_cidreq ();
873- header (sprintf ('Location: %s ' , $ url ));
868+ header (\ sprintf ('Location: %s ' , $ url ));
874869
875870 exit ;
876871 }
@@ -906,7 +901,7 @@ private function autoLaunch(): void
906901 $ exerciseId = $ row ['iid ' ];
907902 $ url = api_get_path (WEB_CODE_PATH ).
908903 'exercise/overview.php?exerciseId= ' .$ exerciseId .'& ' .api_get_cidreq ();
909- header (sprintf ('Location: %s ' , $ url ));
904+ header (\ sprintf ('Location: %s ' , $ url ));
910905
911906 exit ;
912907 }
0 commit comments