<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * Description of Module_url_parser
 *
 * @author Olexandr Vlasiuk
 */
class Module_url_parser
{

    public function parse()
    {
        $ci = get_instance();
        $file = $ci->load->library('ciext_help/file_service')->search_files();
        $uri = $ci->uri->uri_string();
        $get = $ci->load->library('ciext_help/build_link')->get_path($file, $uri);
        if (!empty($get)) {

            return $ci->config->item('admin_page') . '/mconfig/index/ciext_help/index?page=' . trim($get, '/');
        }

        return $ci->config->item('admin_page') . '/mconfig/index/ciext_help/index';
    }

}
