<?php
/*
Officity - Web application platform - Version 6.0 - 2011-07-05

François Dispaux, Boris Verdeyen, Thomas Hermant,
Jérémie Roy, Grégory Meurice, Abdelila Harbi, 
Marc Mignonsin, Jonathan Sanchez, Julien Gonzalez, Pierre Fouchez

Sushee and Officity is © Copyright 2011 Nectil SA.

`/var/www/installer/public_html/officity-source/apps/system/system.url.php` is part of Officity.

Sushee is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Officity and Sushee are distributed in the hope that they will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Sushee. If not, see <http://www.gnu.org/licenses/>.
*/
	/* SYSTEM PATHS */
    
	// /var/www/[HOST]/public_html/
	// residents-proof...
	define(
		'ROOT_PATH',
		 dirname(__FILE__).'/../../'
	);

	// /var/www/[HOST]/public_html/Kernel/
	if (@file_exists(ROOT_PATH.'sushee'))
	{
		define(
			'KERNEL_PATH',
		 	ROOT_PATH.'sushee/'
		);
	}
	else
	{
		define(
			'KERNEL_PATH',
		 	ROOT_PATH.'Kernel/'
		);
	}

    // /var/www/[HOST]/public_html/Library/
	define(
		'LIBRARY_PATH',
		 ROOT_PATH.'Library/'
	);

	// /var/www/[HOST]/public_html/Files/
	define(
		'FILES_PATH',
		 ROOT_PATH.'Files/'
	);
	
	// /var/www/[HOST]/public_html/apps/
	define(
		'APPS_PATH',
		 ROOT_PATH.APPS_FOLDER.'/'
	);

	// /var/www/[HOST]/public_html/apps/system/
	define(
		'SYSTEM_PATH',
		 APPS_PATH.'system/'
	);

	// /var/www/[HOST]/public_html/apps/system/class/
	define(
		'SYSTEM_CLASS_PATH',
		 SYSTEM_PATH.'class/'
	);

	// /var/www/[HOST]/public_html/apps/system/tools/
	define(
		'SYSTEM_TOOLS_PATH',
		 SYSTEM_PATH.'tools/'
	);
	
	// /var/www/[HOST]/public_html/apps/system/packages/
	define(
		'SYSTEM_PACKAGES_PATH',
		 SYSTEM_PATH.'packages/'
	);

	/* URLs */
	// http://www.[HOST].officity.com/
	/*define(
		'ROOT_URL',
		 'http://'.$_SERVER['SERVER_NAME'].'/'
	);*/

    // http(s)://www.[HOST].officity.com/
    require_once(KERNEL_PATH.'common/common_functions.inc.php');
    
    define(
        'ROOT_URL',
        $GLOBALS['nectil_url'].'/'
    );

	// http(s)://www.[HOST].officity.com/apps/
	define(
		'APPS_URL',
		 ROOT_URL.APPS_FOLDER.'/'
	);

	// http(s)://www.[HOST].officity.com/apps/system/
	define(
		'SYSTEM_URL',
		 APPS_URL.'system/'
	);

	// http(s)://www.[HOST].officity.com/apps/system/tools/
	define(
		'SYSTEM_TOOLS_URL',
		 SYSTEM_URL.'tools/'
	);

    // http(s)://www.[HOST].officity.com/apps/system/images/
	define(
		'SYSTEM_IMAGES_URL',
		 SYSTEM_URL.'images/'
	);
	
	/* XSL /RESPONSE/URL/... */
	
    $_GET['rootURL'] = ROOT_URL;
	$_GET['appsURL'] = APPS_URL;

	$_GET['systemURL'] = SYSTEM_URL;
	$_GET['systemToolsURL'] = SYSTEM_TOOLS_URL;
    $_GET['systemImagesURL'] = SYSTEM_IMAGES_URL;
?>
