Change the way how get the config data - refs #7279

1.9.x
Angel Fernando Quiroz Campos 11 years ago
parent 868ca2fee5
commit 36836206e8
  1. 7
      plugin/tour/index.php
  2. 15
      plugin/tour/src/tour_plugin.class.php

@ -9,20 +9,17 @@
*/
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();
$tourPlugin = Tour::create();
$jsonContent = file_get_contents($pluginPath . 'config/tour.json');
$json = json_decode($jsonContent, true);
$config = $tourPlugin->getTourCofig();
$pages = array();
foreach ($json as $pageContent) {
foreach ($config as $pageContent) {
$pages[] = array(
'pageClass' => $pageContent['pageClass'],
'show' => $tourPlugin->checkTourForUser($pageContent['pageClass'], $userId)

@ -126,4 +126,19 @@ class Tour extends Plugin
));
}
/**
* Get the configuration to show the tour in pages
* @return array The config data
*/
public function getTourCofig()
{
$pluginPath = api_get_path(PLUGIN_PATH) . 'tour/';
$jsonContent = file_get_contents($pluginPath . 'config/tour.json');
$jsonData = json_decode($jsonContent, true);
return $jsonData;
}
}

Loading…
Cancel
Save