<?php
/**
 * menu_tree.php - The menu controller
 *
 * @author $Author: dtong $
 * @version $Id: menu_tree.php,v 1.6 2011/05/09 04:48:53 dtong Exp $
 * @copyright Copyright (c) 2009, Tiller Software Co., Ltd.
*/

class menu_tree extends CI_Controller{
	function __construct() {
		parent::__construct();
		$this->CI =& get_instance();
		$user = $this->login_model->getLogin();
		//Special case that we can't modify the jstree ajax so we just do redirect when no access or no session
		$this->access_model->checkaccess_any('homepage_access', $user, TRUE, TRUE);
	 	osa_load_lang('menu');
		osa_load_lang('admin');
	   osa_load_lang('header');
	   osa_load_lang('goal');
	   osa_load_lang('user_role');
	   $this->load->library('menu/menu_main');
	}

	/*
	 * function index on the input parameters.
	 *
	 * @param string $folder
	 * 	The folder string.
	 * @param string $file
	 * 	The file string.
	 */
	function index($folder,$file=FALSE) {
		$data = $this->menu_main->get_template($folder,$file);
		@osa_php_session_destroy();
		echo $this->menu_main->generate_html($data);
	}

}