<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Description of site_menu
 *
 * @author Igor Ratsun
 */
class site_menu  extends MX_Controller {
    
    public function index() {
        $this->load->library('ciext/ciext');
        $this->ciext->load_jquery();
        $this->load->model('site_menu/site_menu_model');
        $content = array(
            'level_0' => $this->site_menu_model->get_items()
        );
        
        $template = $this->parser->parse('site_menu/template', $content, TRUE);
        
        // Remove markers
        preg_match_all('/\{remove_marker_start\}[\w\W]*?\{remove_marker_end\}?/i', $template, $match);
        if (isset($match[0]) && is_array($match[0])) {
            foreach ($match[0] as $v) {
                $template = str_replace($v, '', $template);
            }
        }

        return $template;
    }
}
