<?php

/**
 * Copyright (C) 2009 Wskm Inc.All rights reserved.  
 * [Gart] www.wskmphp.com 
 * $Id: inc_base.php 200 2010-11-15 12:58:03Z ws99 $ 
 */

!defined('IN_ART') && exit('Access Denied');

@set_time_limit(0);
define('IN_ADMIN',true);
define('IS_NOCACHE',true);
define('ADMIN_ROOT', substr(dirname(__FILE__),0,-8));
define('ADMIN_INC_DIR', ADMIN_ROOT.'includes'.DIRECTORY_SEPARATOR);

define('ADMIN_MVC_DIR',ADMIN_ROOT.'core'.DIRECTORY_SEPARATOR);
define('ADMIN_MOD_DIR',ADMIN_MVC_DIR.'model'.DIRECTORY_SEPARATOR);
define('ADMIN_APP_DIR',ADMIN_MVC_DIR.'app'.DIRECTORY_SEPARATOR);
define('OBGZIP',false);

require_once(dirname(ADMIN_ROOT).DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'inc_common.php');

wskm::helper('util');
loadLang('admin_common');
include('fun_common.php');

$adminstyleid=$adminstylename='';
$adminstyleid=(int)(!empty($_GET['adminstyleid']) ? $_GET['adminstyleid'] :
		(!empty($_POST['adminstyleid']) ? $_POST['adminstyleid'] :0));

$db=WSKM::SQL();
if ($adminstyleid < 1) {
	$adminstyleid=$db->fetch_column('SELECT value FROM '.TABLE_PREFIX."settings WHERE variable='adminStyleId'  ");
}
if ($adminstyleid > 0) {
	$adminstylename=$db->fetch_column('SELECT name FROM '.TABLE_PREFIX."themes WHERE styleid='{$adminstyleid}'  ");
}

define('ADMIN_STYLEID', $adminstyleid);
define('ADMIN_STYLENAME',$adminstylename);

define('ADMIN_CACHE_DIR',WSKM::getConfig('adminCacheDir').DS);
define('ADMIN_TPL_DIR',WSKM::getConfig('adminTplDir').DS);

define('ATHEME_URL', ART_URL.'admin/themes/'.ADMIN_STYLENAME.'/');
define('ATHEME_IMG', ART_URL.'admin/themes/'.ADMIN_STYLENAME.'/images/');
define('ATHEME_JS',  ART_URL.'admin/themes/'.ADMIN_STYLENAME.'/js/');
define('ATHEME_CSS', ART_URL.'admin/themes/'.ADMIN_STYLENAME.'/css/');

define('MVC_FUN','usingAdminMVC');
define('URLMODE', URLMODE_NONE);

WSKM::setConfig('appDefault','admin');
WSKM::setConfig('appPrefix','adminapp_');
WSKM::setConfig('modelPrefix','adminmod_');

usingAdminClass('auth');
usingAdminClass('common');

?>