<?php
/*************************************
 * SPDX-FileCopyrightText: 2009-2020 Vtenext S.r.l. <info@vtenext.com> 
 * SPDX-License-Identifier: AGPL-3.0-only  
 ************************************/
 
/* crmv@176547 */

require_once('modules/VteSync/VteSync.php');

global $current_user;
if (!is_admin($current_user)) die('Not authorized');

global $app_strings, $mod_strings;
global $current_language, $theme;

$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";

$smarty = new VteSmarty();

$smarty->assign("MOD", return_module_language($current_language,'Settings'));
$smarty->assign("CMOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("IMAGE_PATH",$image_path);
$smarty->assign("THEME", $theme);

$vsync = VteSync::getInstance();

$synctypes = $vsync->getSyncTypes();

$smarty->assign("SYNCDATA", array());
$smarty->assign("MODE", 'create');
$smarty->assign("SYNCTYPES", $synctypes);
$smarty->assign("CALLBACK_URL", $vsync->getOAuthRedirectUrl());
$smarty->assign("OAUTH_SCOPES", $vsync->getOAuthScopes());

$smarty->display('modules/VteSync/Settings/Edit.tpl');
