Actualización
This commit is contained in:
42
main/inc/lib/elfinder/connectorAction.php
Normal file
42
main/inc/lib/elfinder/connectorAction.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
use Chamilo\CoreBundle\Component\Editor\Connector;
|
||||
use Chamilo\CoreBundle\Component\Editor\Finder;
|
||||
|
||||
require_once __DIR__.'/../../global.inc.php';
|
||||
|
||||
error_reporting(-1);
|
||||
|
||||
/** @var Connector $connector */
|
||||
$connector = new Connector();
|
||||
|
||||
// Check driver list in configuration
|
||||
$driverList = api_get_configuration_value('editor_driver_list');
|
||||
if (empty($driverList)) {
|
||||
$driverList = [
|
||||
'PersonalDriver',
|
||||
'CourseDriver',
|
||||
//'CourseUserDriver',
|
||||
//'HomeDriver'
|
||||
];
|
||||
$block = api_get_configuration_value('block_editor_file_manager_for_students');
|
||||
$newDriverList = [];
|
||||
if (($block) && !api_is_allowed_to_edit()) {
|
||||
foreach ($driverList as $driver) {
|
||||
if ($driver === 'CourseDriver') {
|
||||
continue;
|
||||
}
|
||||
$newDriverList[] = $driver;
|
||||
}
|
||||
$driverList = $newDriverList;
|
||||
}
|
||||
}
|
||||
|
||||
$connector->setDriverList($driverList);
|
||||
$operations = $connector->getOperations();
|
||||
|
||||
// Run elFinder
|
||||
$finder = new Finder($operations);
|
||||
$elFinderConnector = new \elFinderConnector($finder);
|
||||
$elFinderConnector->run();
|
||||
25
main/inc/lib/elfinder/filemanager.php
Normal file
25
main/inc/lib/elfinder/filemanager.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
require_once __DIR__.'/../../global.inc.php';
|
||||
|
||||
Chat::setDisableChat();
|
||||
$template = new Template();
|
||||
$template->assign('course_condition', api_get_cidreq());
|
||||
|
||||
$language = 'en';
|
||||
$platformLanguage = api_get_interface_language();
|
||||
$iso = api_get_language_isocode($platformLanguage);
|
||||
$filePart = "vendor/studio-42/elfinder/js/i18n/elfinder.$iso.js";
|
||||
$file = api_get_path(SYS_PATH).$filePart;
|
||||
$includeFile = '';
|
||||
if (file_exists($file)) {
|
||||
$includeFile = '<script type="text/javascript" src="'.api_get_path(WEB_PATH).$filePart.'"></script>';
|
||||
$language = $iso;
|
||||
}
|
||||
$questionId = isset($_REQUEST['question_id']) ? (int) $_REQUEST['question_id'] : 0;
|
||||
|
||||
$template->assign('question_id', $questionId);
|
||||
$template->assign('elfinder_lang', $language);
|
||||
$template->assign('elfinder_translation_file', $includeFile);
|
||||
$template->display('default/javascript/editor/ckeditor/elfinder.tpl');
|
||||
16
main/inc/lib/elfinder/templates.php
Normal file
16
main/inc/lib/elfinder/templates.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
use Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor;
|
||||
|
||||
require_once __DIR__.'/../../global.inc.php';
|
||||
|
||||
$template = new Template();
|
||||
|
||||
$editor = new CkEditor();
|
||||
|
||||
$templates = $editor->simpleFormatTemplates();
|
||||
|
||||
$template->assign('templates', $templates);
|
||||
header('Content-type: application/x-javascript');
|
||||
$template->display('default/javascript/editor/ckeditor/templates.tpl');
|
||||
Reference in New Issue
Block a user