Add the option to set the theme for the plugin - refs #7279

1.9.x
Angel Fernando Quiroz Campos 11 years ago
parent 222261d16f
commit 8f58c486ee
  1. 9
      plugin/tour/index.php
  2. 5
      plugin/tour/lang/english.php
  3. 5
      plugin/tour/lang/spanish.php
  4. 3
      plugin/tour/src/tour_plugin.class.php
  5. 10
      plugin/tour/views/script.tpl

@ -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";
}
}

@ -18,9 +18,12 @@ $showTourHelpLine02 = 'See README file for more information.';
$strings['show_tour_help'] = sprintf("$showTourHelpLine01 %s $showTourHelpLine02", "<strong>", "</strong>", "<br>");
$strings['theme'] = 'Theme';
$strings['theme_help'] = 'Chose <i>nassim</i>, <i>nazanin</i>, <i>royal</i>. 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';
$strings['StartButtonText'] = 'Start the tour';

@ -18,9 +18,12 @@ $showTourHelpLine02 = 'Ver el archivo README para más información.';
$strings['show_tour_help'] = sprintf("$showTourHelpLine01 %s $showTourHelpLine02", "<strong>", "</strong>", "<br>");
$strings['theme'] = 'Tema';
$strings['theme_help'] = 'Elegir entre <i>nassim</i>, <i>nazanin</i>, <i>royal</i>. 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';
$strings['StartButtonText'] = 'Empezar el recorrido';

@ -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);

@ -69,10 +69,12 @@
rel: 'stylesheet'
}).appendTo('head');
$('<link>', {
href: '{{ tour.web_path.intro_theme_css }}',
rel: 'stylesheet'
}).appendTo('head');
{% if tour.web_path.intro_theme_css is not null %}
$('<link>', {
href: '{{ tour.web_path.intro_theme_css }}',
rel: 'stylesheet'
}).appendTo('head');
{% endif %}
$.getScript('{{ tour.web_path.intro_js }}', function() {
chamiloTour.init(page.pageClass);

Loading…
Cancel
Save