-
Notifications
You must be signed in to change notification settings - Fork 1
/
mod_uwumnavigator.php
40 lines (32 loc) · 1.3 KB
/
mod_uwumnavigator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* @version 1.0.1
* @package mod_uwumnavigator
* @copyright Copyright (C) 2016-2017. All rights reserved. Infalia Private Company
* @license MIT; see LICENSE
* @author Ioannis Tsampoulatidis <[email protected]> - https://github.com/infalia
*/
defined('_JEXEC') or die;
// Include the syndicate functions only once
require_once __DIR__ . '/helper.php';
//add js
$doc = JFactory::getDocument();
$doc->addScript(JURI::base() . '/modules/mod_uwumnavigator/assets/js/uwum_nav.js');
//get token from state if any
$app =JFactory::getApplication();
$token = $app->getUserState('uwum_access_token', null); //user state is set on plg_SL_uwum
//TODO: get host and arguments from module options
$prms = array(
'client_id=' . $params->get('client_id'),
'login_url=' . $params->get('login_url'),
'format=html'
);
$prms = implode('&', $prms);
//$host = "https://wegovnow.liquidfeedback.com/api/1/navigation?client_id=wegovnow.infalia.com";
$host = $params->get('navigation_url') . '?' . $prms;
//$navbar = ModUwumnavigatorHelper::makeNavigation($host, $token);
$session_url = $params->get('session_url');
$login_url = $params->get('login_url');
$navbar = ModUwumnavigatorHelper::getHTMLNavigation($host, $token);
//get default layout
require JModuleHelper::getLayoutPath('mod_uwumnavigator', 'default');