require_once dirname(__FILE__) . '/protected/includes.php'; $yii = dirname(__FILE__) . '/framework/yii.php'; $config = dirname(__FILE__) . "/protected/config/{$config_frontend}"; // Remove the following lines when in production mode defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3); require_once $yii; $yiiapp = Yii::createWebApplication($config); require_once dirname(__FILE__) . '/protected/router.php'; $site_offline = isset(Yii::app()->params->siteoffline) ? Yii::app()->params->siteoffline : 0; if ($site_offline != 0) { $offlineMessage = isset(Yii::app()->params->offlineMessage) ? Yii::app()->params->offlineMessage : "Please check back again soon."; echo $offlineMessage; die; } $params = Router::parseLink(); global $pagetype, $cur_temp; $debug = isset($_REQUEST['debug']) ? $_REQUEST['debug'] : 0; $pagetype = 1; if ($debug == 0) { $pagetype = 1; } else { $pagetype = 2; } if (isset($params['app']) and isset($params['view']) and $pagetype == 1) { $cur_temp = "wapsite"; setSysConfig("sys.template", $cur_temp); setSysConfig("sys.template.path", ROOT_PATH . "themes/{$cur_temp}/"); setSysConfig("sys.template.url", "/themes/{$cur_temp}/"); // thu tu uu tien: theme/$template => protected/apps/frontend/$app/views => /protected/views/frontend if (isset($params['app'])) {
//error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED & ~E_STRICT); global $yiiapp; error_reporting(E_ALL); $config_backend = "backend.php"; require_once dirname(__FILE__) . '/protected/includes.php'; $yii = dirname(__FILE__) . '/framework/yii.php'; $config = dirname(__FILE__) . "/protected/config/{$config_backend}"; // Remove the following lines when in production mode defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3); require_once $yii; $yiiapp = Yii::createWebApplication($config); require_once dirname(__FILE__) . '/protected/backrouter.php'; require_once dirname(__FILE__) . '/protected/backfunctions.php'; $params = Router::parseLink($_SERVER['REQUEST_URI']); global $pagetype, $cur_temp; $debug = isset($_REQUEST['debug']) ? $_REQUEST['debug'] : 0; $pagetype = 1; $app = Request::getVar('app', "cpanel"); $view = Request::getVar('view', "home"); $layout = Request::getVar('layout', "display"); if ($app != null and $pagetype == 1) { $cur_temp = "standard"; setSysConfig("sys.template", $cur_temp); setSysConfig("sys.template.path", ROOT_PATH . "themes/backend/{$cur_temp}/"); setSysConfig("sys.template.url", "/themes/backend/{$cur_temp}/"); $_path_controller = ROOT_PATH . 'protected/apps/backend/' . $app . '/controllers/'; if (is_dir($_path_controller)) { $yiiapp->setControllerPath($_path_controller); } else {