Files
Chamilo/plugin/tour/index.php
T
Xes 73154ae174
Behat tests 1.11.x 🐞 / PHP 7.4 Test on ubuntu-latest (push) Canceled after 0s
PHP-CS-Fixer / composer_install (7.4) (push) Canceled after 0s
Chamilo 1.11.40 (ZIP oficial v1.11.40)
Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip
sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439
Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
2026-08-06 17:59:45 +02:00

49 lines
1.3 KiB
PHP

<?php
/* For licensing terms, see /license.txt */
/**
* Config the plugin.
*
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*
* @package chamilo.plugin.tour
*/
require_once __DIR__.'/config.php';
$pluginPath = api_get_path(SYS_PLUGIN_PATH).'tour/';
$pluginWebPath = api_get_path(WEB_PLUGIN_PATH).'tour/';
$userId = api_get_user_id();
$tourPlugin = Tour::create();
$config = $tourPlugin->getTourConfig();
$showTour = $tourPlugin->get('show_tour') === 'true';
if ($showTour) {
$pages = [];
foreach ($config as $pageContent) {
$pages[] = [
'pageClass' => $pageContent['pageClass'],
'show' => $tourPlugin->checkTourForUser($pageContent['pageClass'], $userId),
];
}
$theme = $tourPlugin->get('theme');
$_template['show_tour'] = $showTour;
$_template['pages'] = json_encode($pages);
$_template['web_path'] = [
'intro_css' => "{$pluginWebPath}intro.js/introjs.min.css",
'intro_theme_css' => null,
'intro_js' => "{$pluginWebPath}intro.js/intro.min.js",
'steps_ajax' => "{$pluginWebPath}ajax/steps.ajax.php",
'save_ajax' => "{$pluginWebPath}ajax/save.ajax.php",
];
if (file_exists("{$pluginPath}intro.js/introjs-$theme.css")) {
$_template['web_path']['intro_theme_css'] = "{$pluginWebPath}intro.js/introjs-$theme.css";
}
}