<?php
/********************************************************************************
 * (c)1337 aheadware.com - All rights reserved
 ********************************************************************************/

// Boot system
require_once __DIR__ . '/../../src/client/config/boot_global.php';
require_once __DIR__ . '/../../src/client/config/boot_local.php';

$res = array();

// Determine current version
$version = '0.0';
$versionArr = json_decode( file_get_contents( Francis_Utils_Config::get( 'path.root' ) . '/version.json' ), true );
if ( is_array( $versionArr ) && isset( $versionArr[ 'version' ] ) ) {
    $version = $versionArr[ 'version' ];
}
$res[ 'version' ] = $version;

// Service
$res[ 'url_service' ] = Francis_Utils_Config::get( 'url.service' );

// Get css
$res[ 'css' ] = TB_Client_Core_View::getAllCss( $version );

// Get JS
$res[ 'js' ] = TB_Client_Core_View::getAllJs();

// Get template filenames
//$res[ 'tmpls'] = TB_Client_Core_View::getPageTemplateFilenames();
header( "Access-Control-Allow-Origin: *" );
header( "Access-Control-Allow-Headers: application/x-www-form-urlencoded" );
header( "Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS" );
header( "Access-Control-Allow-Credentials: true" );
echo json_encode( $res );