<?php
/**
 * IMPORTANT NOTE
 * The code of this system is closed and a private proprietary of Flex Solutions.
 * A written authorization/license from Flex Solutions is required before using or modifying this code.
 * Email: sales@flexsolution.biz, Phone: +962795342585, Website: http://www.flexsolutions.biz
 */
 
/**
 * Dashboard
 * 
 * Yii controller to control Dashboard actions
 * 
 * @version 1.0
 * @author Amaney
 * @package application.controllers
 */
class DashboardLayoutController extends Controller {

    /**
     * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
     * using two-column layout. See 'protected/views/layouts/column2.php'.
     */
    public $layout = '//layouts/column2';

    /**
     * @return array action filters
     */
    public function filters() {
	return array(
	    'accessControl', // perform access control for CRUD operations
	);
    }

    /**
     * Specifies the access control rules.
     * This method is used by the 'accessControl' filter.
     * @return array access control rules
     */
    public function accessRules() {
	return array(
	    array('allow', // allow all users to perform 'index' and 'view' actions
		'actions' => array('SystemConfiguration', 'configuration', 'AssetConfiguration', 'TIDsConfiguration'),
		'roles' => array(User::SYSTEM_ADMIN_ROLE),
	    ),
	    array('allow', // allow all users to perform 'index' and 'view' actions
		'actions' => array('Tids', 'help'),
		'users' => array('*'),
	    ),
	    array('deny', // deny all users
		'users' => array('*'),
	    ),
	);
    }

    public function redirectToLogin() {
	$this->redirect('/site/login');
    }

    public function actionConfiguration() {
	$this->render('configuration', array(
	));
    }

    public function actionTids() {
	$this->render('tids', array(
	));
    }


    public function actionSystemConfiguration() {
	$this->render('system_configuration', array(
	));
    }

    public function actionAssetConfiguration() {
	$this->render('asset_configuration', array(
	));
    }

    public function actionTIDsConfiguration() {
	$this->render('tid configuration', array(
	));
    }

    public function actionHelp() {
	$this->render('help', array(
	));
    }

}