diff --git a/plugin/tour/index.php b/plugin/tour/index.php
index 1d6747a08e..497f010ef0 100644
--- a/plugin/tour/index.php
+++ b/plugin/tour/index.php
@@ -9,6 +9,7 @@
*/
require_once dirname(__FILE__) . '/config.php';
+$pluginPath = api_get_path(PLUGIN_PATH) . 'tour/';
$pluginWebPath = api_get_path(WEB_PLUGIN_PATH) . 'tour/';
$userId = api_get_user_id();
@@ -27,15 +28,21 @@ if ($showTour) {
);
}
+ $theme = $tourPlugin->get('theme');
+
$_template['show_tour'] = $showTour;
$_template['pages'] = json_encode($pages);
$_template['web_path'] = array(
'intro_css' => "{$pluginWebPath}intro.js/introjs.min.css",
- 'intro_theme_css' => "{$pluginWebPath}intro.js/introjs-nassim.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";
+ }
}
diff --git a/plugin/tour/lang/english.php b/plugin/tour/lang/english.php
index 2edeab1842..8add1bd552 100644
--- a/plugin/tour/lang/english.php
+++ b/plugin/tour/lang/english.php
@@ -18,9 +18,12 @@ $showTourHelpLine02 = 'See README file for more information.';
$strings['show_tour_help'] = sprintf("$showTourHelpLine01 %s $showTourHelpLine02", "", "", "
");
+$strings['theme'] = 'Theme';
+$strings['theme_help'] = 'Chose nassim, nazanin, royal. Empty to use the default theme.';
+
/* Strings for plugin UI */
$strings['Skip'] = 'Skip';
$strings['Next'] = 'Next';
$strings['Prev'] = 'Prev';
$strings['Done'] = 'Done';
-$strings['StartButtonText'] = 'Start the tour';
\ No newline at end of file
+$strings['StartButtonText'] = 'Start the tour';
diff --git a/plugin/tour/lang/spanish.php b/plugin/tour/lang/spanish.php
index c051c3c7f2..f6f7f2b878 100644
--- a/plugin/tour/lang/spanish.php
+++ b/plugin/tour/lang/spanish.php
@@ -18,9 +18,12 @@ $showTourHelpLine02 = 'Ver el archivo README para más información.';
$strings['show_tour_help'] = sprintf("$showTourHelpLine01 %s $showTourHelpLine02", "", "", "
");
+$strings['theme'] = 'Tema';
+$strings['theme_help'] = 'Elegir entre nassim, nazanin, royal. Vacío para usar el tema por defecto.';
+
/* Strings for plugin UI */
$strings['Skip'] = 'Saltar';
$strings['Next'] = 'Siguiente';
$strings['Prev'] = 'Anterior';
$strings['Done'] = 'Hecho';
-$strings['StartButtonText'] = 'Empezar el recorrido';
\ No newline at end of file
+$strings['StartButtonText'] = 'Empezar el recorrido';
diff --git a/plugin/tour/src/tour_plugin.class.php b/plugin/tour/src/tour_plugin.class.php
index c8a822b8da..9e9fca13a8 100644
--- a/plugin/tour/src/tour_plugin.class.php
+++ b/plugin/tour/src/tour_plugin.class.php
@@ -17,7 +17,8 @@ class Tour extends Plugin
protected function __construct()
{
$parameters = array(
- 'show_tour' => 'boolean'
+ 'show_tour' => 'boolean',
+ 'theme' => 'text'
);
parent::__construct('1.0', 'Angel Fernando Quiroz Campos', $parameters);
diff --git a/plugin/tour/views/script.tpl b/plugin/tour/views/script.tpl
index 1bddabd426..bf3511773a 100644
--- a/plugin/tour/views/script.tpl
+++ b/plugin/tour/views/script.tpl
@@ -69,10 +69,12 @@
rel: 'stylesheet'
}).appendTo('head');
- $('', {
- href: '{{ tour.web_path.intro_theme_css }}',
- rel: 'stylesheet'
- }).appendTo('head');
+ {% if tour.web_path.intro_theme_css is not null %}
+ $('', {
+ href: '{{ tour.web_path.intro_theme_css }}',
+ rel: 'stylesheet'
+ }).appendTo('head');
+ {% endif %}
$.getScript('{{ tour.web_path.intro_js }}', function() {
chamiloTour.init(page.pageClass);