/** * @Route("/editor/connector", name="editor_connector") * @Method({"GET|POST"}) */ public function editorConnector(Request $request) { error_reporting(-1); $courseId = $request->get('course_id'); $sessionId = $request->get('session_id'); $courseInfo = []; if (!empty($courseId)) { $courseInfo = api_get_course_info_by_id($courseId); } /** @var Connector $connector */ $connector = new Connector($this->container->get('doctrine')->getManager(), [], $this->container->get('router'), $this->container->get('translator.default'), $this->container->get('security.context'), $this->getUser(), $courseInfo); $driverList = array('PersonalDriver', 'CourseDriver'); $connector->setDriverList($driverList); $operations = $connector->getOperations(); // Run elFinder ob_start(); $finder = new Finder($operations); $elFinderConnector = new ElFinderConnector($finder); $elFinderConnector->run(); $content = ob_get_contents(); return $this->render('@ChamiloCore/layout_empty.html.twig', ['content' => $content]); }
<?php /* For licensing terms, see /license.txt */ require_once '../../global.inc.php'; use Chamilo\CoreBundle\Component\Editor\Connector; use Chamilo\CoreBundle\Component\Editor\Finder; error_reporting(-1); /** @var Connector $connector */ $connector = new Connector(); $driverList = array('PersonalDriver', 'CourseDriver'); $connector->setDriverList($driverList); $operations = $connector->getOperations(); // Run elFinder $finder = new Finder($operations); $elFinderConnector = new \elFinderConnector($finder); $elFinderConnector->run();