/**
 * Mengambil data menu
 */
function load_menu()
{
    /*$csql_group="select a.cgroup,a.nid from ".PREFIX."groupfrontmenus a
    		LEFT JOIN ".PREFIX."grantedfrontmenus b on a.nid=b.nid_groupfrontmenus
    		WHERE 1
    		AND b.nstatus = '1'
    		AND b.nid_users = '".b_getuserlogin()."'
    		order by nurut, cgroup";*/
    $csql = "select cgroup, nid from " . PREFIX . "groupfrontmenus order by nurut, cgroup";
    //echo $csql_group."<hr>";
    $nresult_group = gcms_query($csql_group);
    $i = 0;
    $menus = array();
    while ($group_menu = gcms_fetch_object($nresult_group)) {
        $csql_child = "select a.*,b.nstatus,b.nid_users,b.nid_frontmenus AS acess_menu from " . PREFIX . "frontmenus as a \r\n\t\t\t\t   LEFT JOIN " . PREFIX . "grantedfrontmenus as b on a.nid=b.nid_frontmenus\r\n\t\t\t\t   WHERE a.nid_groupfrontmenus='" . $group_menu->nid . "'\r\n\t\t\t\t   AND b.nstatus = '1'\r\n\t\t\t\t   AND b.nid_users = '" . b_getuserlogin() . "'\r\n\t\t\t\t   AND a.cparam !='Group'\r\n\t\t\t\t   and a.bhide = '0' \r\n\t\t\t\t   order by a.nurut, a.cmenu";
        //echo $csql_child."<hr>";
        $nresult_child = gcms_query($csql_child);
        $menus[$i][0] = str_replace(" ", "&nbsp;", stripslashes($group_menu->cgroup));
        $j = 1;
        while ($menu = gcms_fetch_object($nresult_child)) {
            $menus[$i][$j][0] = build_menu($menu);
            $menus[$i][$j][1] = stripslashes($menu->cmenu);
            $menus[$i][$j][2] = stripslashes($menu->nid_groupfrontmenus);
            $menus[$i][$j][3] = stripslashes($menu->csubmenu);
            $menus[$i][$j][4] = stripslashes($menu->cparam);
            $menus[$i][$j][5] = $menu->nid_groupfront_submenus;
            $menus[$i][$j][6] = $menu->nid;
            $menus[$i][$j][7] = $menu->nid_users;
            //echo $menus[$i][$j][0]."<hr>";
            $j++;
        }
        $i++;
    }
    return $menus;
}
/**
 * Mengambil data menu
 */
function load_menu()
{
    $csql = "select cgroup, nid from " . PREFIX . "groupfrontmenus order by nurut, cgroup";
    $nresult = gcms_query($csql);
    $i = 0;
    $menus = array();
    while ($ogroup = gcms_fetch_object($nresult)) {
        if (b_admin(b_getuserlogin())) {
            $cwhere = "where a.nid_groupfrontmenus='" . $ogroup->nid . "'";
        } else {
            $cwhere = "left join " . PREFIX . "grantedfrontmenus as b on a.nid=b.nid_frontmenus\r\n                              where a.nid_groupfrontmenus='" . $ogroup->nid . "'  and \r\n                              (b.nid_users='" . b_getuserlogin() . "' or a.bsecure=0)";
        }
        $csql = "select a.* from " . PREFIX . "frontmenus as a {$cwhere} order by a.nurut, a.cmenu";
        $nresult2 = gcms_query($csql);
        if (gcms_fetch_row($nresult2)) {
            if (!$ogroup->bhide) {
                $menus[$i][0] = str_replace(" ", "&nbsp;", stripslashes($ogroup->cgroup));
                $j = 1;
                $nresult2 = gcms_query($csql);
                while ($omenu = gcms_fetch_object($nresult2)) {
                    if ($omenu->bsecure and b_logged() or !$omenu->bsecure) {
                        $menus[$i][$j][0] = build_menu($omenu);
                        $menus[$i][$j][1] = stripslashes($omenu->cmenu);
                        $j++;
                    }
                }
                $i++;
            }
        }
    }
    return $menus;
}
Beispiel #3
0
function build_menu($menus = array())
{
    // Check if current level is parent
    $current_line = isset($menus[0]) ? $menus[0] : array();
    $root_level = get_value($current_line, 'id_menu_parent') <= 0 ? true : false;
    if (count($menus) > 0) {
        foreach ($menus as $menu) {
            // DEBUG:
            // print_r($menu);
            // Counting children menu
            $count_menu_children = count(get_value($menu, 'children'));
            // Build a link
            $link = tag_replace(get_value($menu, 'link'));
            $target = get_value($menu, 'target') != '' ? ' target="' . tag_replace(get_value($menu, 'target')) . '" ' : '';
            $label = lang(get_value($menu, 'label'));
            $img = image(get_value($menu, 'url_img'));
            // Build a single line menu
            if ($count_menu_children > 0) {
                $class = $root_level ? 'dropdown' : 'dropdown dropdown-submenu';
                $caret = $root_level ? '<span class="caret"></span>' : '';
                ?>
				<li class="<?php 
                echo $class;
                ?>
">
					<a href="<?php 
                echo $link;
                ?>
" <?php 
                echo $target;
                ?>
 class="dropdown-toggle" data-toggle="dropdown">
						<?php 
                echo $img . ' ' . $label . $caret;
                ?>
					</a>
					<ul class="dropdown-menu"><?php 
                build_menu(get_value($menu, 'children'));
                ?>
</ul>
				</li>
			<?php 
            } else {
                ?>
				<li><a href="<?php 
                echo $link;
                ?>
" <?php 
                echo $target;
                ?>
 ><?php 
                echo $img . ' ' . $label;
                ?>
</a></li>
			<?php 
            }
        }
    }
}
Beispiel #4
0
function get_menu_link_from_mod($mod, $func)
{
    $omenu = get_page_from_mod_int($mod, $func);
    if ($omenu->nid) {
        return build_menu($omenu);
    } else {
        return "";
    }
}
Beispiel #5
0
 public function __construct()
 {
     parent::__construct();
     global $data, $system, $user, $upload_directory;
     //disable once done dev
     //$this->output->enable_profiler(TRUE);
     $data = array();
     $data['page'] = "home";
     $data['notes'] = array();
     $finalpage = false;
     //CHECK CONFIG.PHP SETUP
     check_config_settings();
     //Verify config.php setup
     //CHECK INSTALLATION
     check_installation(true);
     //Verify Nakid CMS is installed
     //GET SYSTEM INFO
     $system = $this->SystemModel->get_settings_array();
     //Get array of system settings
     //CHECK LOGIN
     $user = $this->SystemModel->get_user($this->session->userdata('uid'));
     //check_login($this->session->userdata('uid'));
     if (!$user) {
         $nonauth = array("login", "forgot_password");
         if (!in_array($this->uri->segment(2), $nonauth)) {
             redirect('system/login');
         }
     } else {
         //KCFINDER OPTIONS (PUT THIS ELSEWHERE)
         //Find Nakid install path
         $paths = explode($_SERVER["SERVER_NAME"], base_url());
         $nakid_install = $paths[1];
         //Get Upload Directory
         $kc_directory = $nakid_install . "/uploads";
         //$upload_directory = NAKID_ROOT."/uploads";
         $upload_directory = "uploads";
         chmod($upload_directory, 0775);
         //Set Session
         session_start();
         $_SESSION['KCFINDER'] = array();
         $_SESSION['KCFINDER']['disabled'] = false;
         //$_SESSION['KCFINDER']['uploadURL'] = $upload_directory;
         $_SESSION['KCFINDER']['uploadURL'] = $kc_directory;
     }
     //BUILD MENU
     $data['menu'] = build_menu($user);
     $dbdata = array('order' => 55);
     //
     if (!licensed()) {
         $data['notes'][] = array(base64_decode('PGRpdiBpZD0iaV9hbV9hX2Jyb2tlX2RldmVsb3BlciI+PHA+PGEgaHJlZj0iaHR0cDovL25ha2lkLm9yZy9kb25hdGUiIHRhcmdldD0iX2JsYW5rIj48c3Ryb25nPlRoaXMgdmVyc2lvbiBvZiBkb21haW4gaXMgY3VycmVudGx5IHVubGljZW5zZWQuPC9zdHJvbmc+IC0gSG93IG11Y2ggaXMgdGhpcyBwcm9ncmFtIHdvcnRoIHRvIHlvdT8gSWYgeW91IGxpa2UgTmFraWQsIHBsZWFzZSBkb25hdGUgdG8gc3VwcG9ydCBmdXR1cmUgdXBkYXRlcy4gQWZ0ZXIgZG9uYXRpbmcgdGhlIGFtb3VudCBvZiB5b3VyIGNob29zaW5nIHlvdSB3aWxsIHJlY2VpdmUgYSBkb21haW4gbGljZW5zZSBrZXkgc28geW91IGRvbid0IGhhdmUgdG8gc2VlIHRoaXMgbmFnIHNjcmVlbiBhbnltb3JlITwvYT48L3A+PC9kaXY+'), 'alert');
     }
 }
function build_menu($items)
{
    ?>
    <ul>
    <?php 
    foreach ($items as $item) {
        ?>
            <li>
                <a
                    <?php 
        if (!$item->is_folder) {
            ?>
                        href="<?php 
            echo URL_PREFIX;
            ?>
/<?php 
            echo $item->name;
            ?>
"
                    <?php 
        }
        ?>
                    title="<?php 
        echo $item->title;
        ?>
"
                    class="<?php 
        echo $item->is_home ? 'homepage' : '';
        ?>
 <?php 
        echo $item->is_selected ? 'selected' : '';
        ?>
">
                        <?php 
        echo $item->title;
        ?>
                </a>
                <?php 
        if (property_exists($item, 'children')) {
            echo build_menu($item->children);
        }
        ?>
            </li>
        <?php 
    }
    ?>
    </ul>
    <?php 
}
Beispiel #7
0
function build_menu($rows, $parent = 0)
{
    $result = "<ul>";
    foreach ($rows as $row) {
        if ($row['parent_id'] == $parent) {
            $result .= "<li>{$row['title']}";
            if (has_children($rows, $row['id'])) {
                $result .= build_menu($rows, $row['id']);
            }
            $result .= "</li>";
        }
    }
    $result .= "</ul>";
    return $result;
}
Beispiel #8
0
 public function __construct()
 {
     parent::__construct();
     global $data, $system, $user;
     $user = false;
     $data = array();
     $data['page'] = "install";
     $data['notes'] = array();
     check_config_settings();
     //Verify config.php setup
     //CHECK INSTALLATION
     check_installation(false);
     //Verify Nakid CMS is installed
     //BUILD MENU
     $data['menu'] = build_menu($user);
 }
Beispiel #9
0
function build_menu($menu_arr, $parrent_id = 0)
{
    if (is_array($menu_arr) and count(@$menu_arr[$parrent_id]) > 0) {
        $tree = '<ul>';
        foreach ($menu_arr[$parrent_id] as $key => $vall) {
            if ($vall[1] == '#') {
                $tree .= '<li><a href="#" style="width:145px;"><p>' . $vall[0] . '</p></a>';
            } else {
                $tree .= '<li><a href="' . set_url($vall[1]) . '" style="width:145px;"><p>' . $vall[0] . '</p></a>';
            }
            $tree .= build_menu($menu_arr, $key);
            $tree .= '</li>';
        }
        $tree .= '</ul>';
    } else {
        return null;
    }
    return $tree;
}
Beispiel #10
0
function build_menu($navigations, $path)
{
    $div_collapse = '<div class="layout_collapse_icon layout_expand"></div>';
    $div_nothing = '<div class="layout_nothing_icon"></div>';
    if (count($navigations) == 0) {
        return '';
    }
    //just exit and do nothing
    $html = '';
    $html .= '<ul class="dropdown">';
    foreach ($navigations as $navigation) {
        if ($navigation['allowed'] || $navigation['have_allowed_children']) {
            if ($navigation['active'] == 1) {
                $html .= '<li>';
                $expand = '';
                if (count($navigation['child']) > 0) {
                    if ($navigation['have_allowed_children']) {
                        $expand .= $div_collapse;
                    } else {
                        $expand .= $div_nothing;
                    }
                } else {
                    $expand .= $div_nothing;
                }
                $pageLinkClass = 'layout_page_link';
                if ($navigation['have_allowed_children']) {
                    $pageLinkClass .= ' layout_have_child';
                } else {
                    $pageLinkClass .= ' layout_no_child';
                }
                if ($navigation['allowed']) {
                    $html .= anchor($navigation['url'], $navigation['title'] . $expand, array('class' => $pageLinkClass));
                } else {
                    $html .= '<a class="' . $pageLinkClass . '">' . $navigation['title'] . $expand . '</a>';
                }
                $html .= build_menu($navigation['child'], $path);
                $html .= '</li>';
            }
        }
    }
    $html .= '</ul>';
    return $html;
}
Beispiel #11
0
function wp_eMember_members()
{
    echo '<div class="wrap"><h2>WP eMembers - Members v' . WP_EMEMBER_VERSION . '</h2>';
    echo check_php_version();
    echo eMember_admin_submenu_css();
    $_GET['members_action'] = isset($_GET['members_action']) ? $_GET['members_action'] : "";
    switch ($_GET['members_action']) {
        case 'add_edit':
            build_menu(2);
            wp_eMember_add_memebers();
            break;
        case 'manage_list':
            build_menu(3);
            wp_eMember_manage_memebers_lists();
            break;
        case 'edit_ip_lock':
            build_menu(1);
            wp_eMember_edit_ip_lock();
            break;
        case 'add_wp_members':
            build_menu(4);
            wp_eMember_add_wp_members();
            break;
        case 'manage_blacklist':
            build_menu(5);
            wp_eMember_manage_blackList();
            break;
        case 'manage_upgrade':
            build_menu(6);
            wp_eMember_manage_upgrade();
            break;
        case 'manage':
        default:
            build_menu(1);
            wp_eMember_manage_members();
            break;
    }
    echo '</div>';
}
Beispiel #12
0
function build_menu($navigations, $path, $invisible = FALSE)
{
    if (count($navigations) == 0) {
        return '';
    }
    //just exit and do nothing
    //check if there is navigation_array that match with array
    $class_invisible = $invisible ? "invisible" : "";
    foreach ($navigations as $navigation) {
        if ($class_invisible == "") {
            break;
        }
        foreach ($path as $current_path) {
            if ($navigation['navigation_name'] == $current_path['navigation_name']) {
                $class_invisible = "";
                break;
            }
        }
    }
    $last_path = count($path) > 0 ? $path[count($path) - 1]['navigation_name'] : "";
    $html = '';
    $html .= '<ul class="layout_nav ' . $class_invisible . '">';
    foreach ($navigations as $navigation) {
        if ($navigation['allowed'] || $navigation['have_allowed_children']) {
            $layout_nav_hot = $last_path == $navigation['navigation_name'] ? 'layout_nav_hot' : '';
            if ($navigation['active'] == 1) {
                $html .= '<li class ="' . $layout_nav_hot . '">';
                if (count($navigation['child']) > 0) {
                    $in_path = false;
                    if ($last_path != $navigation['navigation_name']) {
                        foreach ($path as $current_path) {
                            if ($current_path['navigation_name'] == $navigation['navigation_name']) {
                                $in_path = true;
                                break;
                            }
                        }
                    }
                    if ($navigation['have_allowed_children']) {
                        if ($in_path) {
                            $html .= '<a href="#" class="layout_expand">[-]</a> ';
                        } else {
                            $html .= '<a href="#" class="layout_expand">[+]</a> ';
                        }
                    }
                }
                $pageLinkClass = 'layout_page_link';
                if ($navigation['have_allowed_children']) {
                    $pageLinkClass .= ' layout_have_child';
                } else {
                    $pageLinkClass .= ' layout_no_child';
                }
                if ($navigation['allowed']) {
                    $html .= anchor($navigation['url'], $navigation['title'], array('class' => $pageLinkClass));
                } else {
                    $html .= $navigation['title'];
                }
                $html .= '<div class="layout_clear"></div>';
                if (isset($navigation['description'])) {
                    $html .= '<div class="layout_nav_description invisible">Description : ' . $navigation['description'] . '</div>';
                }
                $html .= build_menu($navigation['child'], $path, TRUE);
                $html .= '</li>';
            }
        }
    }
    $html .= '</ul>';
    return $html;
}
Beispiel #13
0
echo build_menu("format", $format_menu, $format);
?>
</td>
      <td nowrap="nowrap" align="center">Cds</td>
      <td><?php 
echo build_menu("cds", $cds_menu, $cds);
?>
</td>
      <td nowrap="nowrap" align="center">Language</td>
      <td><?php 
echo build_menu("lang", $lang_menu, $lang);
?>
</td>
      <td nowrap="nowrap" align="center">FPS</td>
      <td><?php 
echo build_menu("fps", $fps_menu, $fps);
?>
</td>
    </tr>
	<tr><td align="center" colspan="8"><input type="submit" value="Search" /></td></tr>
  </table>
</form>
</fieldset>
<br/>

<?php 
if (!empty($name)) {
    $search = xmlconvert(requestXML($name, $searchby, $lang, $cds, $format, $fps, $offset));
    print build_result($search, "?" . $pager);
}
?>
Beispiel #14
0
function build_menu($menu, $dots = '.|')
{
    $ret = '';
    foreach ($menu as $val) {
        if (is_array($val)) {
            $tmp = array_shift($val);
            if ($tmp) {
                $ret .= $dots . $tmp . "\n";
            }
            $ret .= build_menu($val, '.' . $dots);
        } else {
            $ret .= $dots . $val;
        }
        $ret .= "\n";
    }
    return trim($ret);
}
Beispiel #15
0
	src="template/default/script/menu.js"></script>
<script type="text/javascript" language="javascript"
	src="template/default/script/ajax.js"></script>
<script type="text/javascript" language="javascript" src="script.js"></script>
</head>
<body
	onload="initButtons();watch_page();check_url();who_is_online();rank();">

<div id="heading"><a href="http://www.teamfrednet.org/"> <img
	alt="teamFREDNET logo" src="img/teamfred_simple_logo.png"
	class="head_logo" /> </a> teamFREDNET MindStorm Lunar Rover Portal</div>
<table style="vertical-align:text-top;">
<tr>
<td style="vertical-align:top;">
<div id="left_col"><?php 
build_menu();
?>
</div>
</td><td style="vertical-align:top;">
<div id="center_col"><?php 
build_content();
?>
</div>
</td><td style="vertical-align:top;">
<div id="right_col">
<div class="rankBox">
<h4 style="padding: 0; margin: 0;">Today top 5</h4>
<ul
	style="list-style-type: none; background-color: #BC99FF; padding: 0; font-size: 10pt">
	<div id="top5_day">Please wait</div>
Beispiel #16
0
          <div class="nav-collapse">
            <?php 
echo build_quicklink($cms['quicklinks']);
?>
          </div><!--/.nav-collapse -->
        </div><!--/.container-fluid -->       
      </div><!--/.navbar-innder -->
    </div><!--/.nav .navbar-fixed-top -->
    
    <div class="container-fluid">
      <div class="row-fluid">
              
        <div id="layout-banner-content-widget" class="span12">
	        <div id="layout-menu">
	            <?php 
echo build_menu($cms['navigations'], $cms['navigation_path']);
?>
	            <div class="clear"></div> 
	        </div>
        	<div id="layout-content-widget" class="span12">
	        	<div id="layout-content" class="span9">
		            <?php 
echo $template['body'];
?>
		            <div class="clear"></div>
		        </div><!--/#layout-content-->       
		        <div id="layout-widget" class="span3">
		            <h4>WIDGET</h4><hr />
                    <?php 
echo build_widget_html($cms['widget'], 'sidebar');
?>
Beispiel #17
0
function build_menu($navigations, $path, $invisible = FALSE)
{
    $div_collapse = '<div class="layout_collapse_icon layout_expand"></div>';
    $div_expand = '<div class="layout_expand_icon layout_expand"></div>';
    $div_nothing = '<div class="layout_nothing_icon"></div>';
    if (count($navigations) == 0) {
        return '';
    }
    //just exit and do nothing
    //check if there is navigation_array that match with array
    $class_invisible = $invisible ? "not_shown" : "";
    foreach ($navigations as $navigation) {
        if ($class_invisible == "") {
            break;
        }
        foreach ($path as $current_path) {
            if ($navigation['navigation_name'] == $current_path['navigation_name']) {
                $class_invisible = "";
                break;
            }
        }
    }
    $last_path = count($path) > 0 ? $path[count($path) - 1]['navigation_name'] : "";
    $html = '';
    $html .= '<ul class="layout_nav nav nav-list ' . $class_invisible . '">';
    foreach ($navigations as $navigation) {
        if ($navigation['allowed'] || $navigation['have_allowed_children']) {
            $layout_nav_hot = $last_path == $navigation['navigation_name'] ? 'active' : '';
            if ($navigation['active'] == 1) {
                $html .= '<li class ="' . $layout_nav_hot . '">';
                $expand = '';
                if (count($navigation['child']) > 0) {
                    $in_path = false;
                    if ($last_path != $navigation['navigation_name']) {
                        foreach ($path as $current_path) {
                            if ($current_path['navigation_name'] == $navigation['navigation_name']) {
                                $in_path = true;
                                break;
                            }
                        }
                    }
                    if ($navigation['have_allowed_children']) {
                        if ($in_path || $last_path == $navigation['navigation_name']) {
                            $expand .= $div_collapse;
                        } else {
                            $expand .= $div_expand;
                        }
                    } else {
                        $expand .= $div_nothing;
                    }
                } else {
                    $expand .= $div_nothing;
                }
                $pageLinkClass = 'layout_page_link';
                if ($navigation['have_allowed_children']) {
                    $pageLinkClass .= ' layout_have_child';
                } else {
                    $pageLinkClass .= ' layout_no_child';
                }
                if ($navigation['allowed']) {
                    $html .= anchor($navigation['url'], $expand . $navigation['title'], array('class' => $pageLinkClass));
                } else {
                    $html .= '<a class="' . $pageLinkClass . '">' . $expand . $navigation['title'] . '</a>';
                }
                if (isset($navigation['description'])) {
                    $html .= '<div class="layout_nav_description not_shown">' . $navigation['description'] . '</div>';
                }
                $invisible = TRUE;
                if ($last_path == $navigation['navigation_name']) {
                    $invisible = FALSE;
                }
                $html .= build_menu($navigation['child'], $path, $invisible);
                $html .= '</li>';
            }
        }
    }
    $html .= '</ul>';
    return $html;
}
Beispiel #18
0
           
                          
        </tr>
    </table>
<?php 
    $current_employee = $_SESSION['current_employee'];
    ?>
        <script type="text/javascript" src="<?php 
    echo SITE_URI_ROOT;
    ?>
js/menu.js"></script>
        <!-- menu //-->
        <div>
                <div id="menu" >
                    <?php 
    echo build_menu($STORAGE['menu']);
    ?>
                    <div id="logoutMenuMessage"><b><a href="<?php 
    echo SITE_URI_ROOT;
    ?>
logout.php">Выйти</a></b></div>
                </div>
                <div id="submenu" >
                    &nbsp;
                </div>
        </div>
        <!-- /menu //-->
    <table cellspacing="0" cellpadding="0" border="0" id="mainTable">
    <tr>
    <td id="leftColumn">
        <!-- site path //-->
Beispiel #19
0
    $coursename = $DB->get_record('course', array('id' => $cid), 'shortname', $strictness = IGNORE_MISSING);
    $PAGE->navbar->add($coursename->shortname, new moodle_url($CFG->wwwroot . '/course/view.php?id=' . $cid));
    $PAGE->navbar->add(get_string('showallfaces', 'block_faces'));
} else {
    if ($rendertype == 'group') {
        $coursename = $DB->get_record('course', array('id' => $cid), 'shortname', $strictness = IGNORE_MISSING);
        $PAGE->navbar->add($coursename->shortname, new moodle_url($CFG->wwwroot . '/course/view.php?id=' . $cid));
        $PAGE->navbar->add(get_string('showfacesbygroup', 'block_faces'));
    }
}
$PAGE->set_url('/blocks/faces/showfaces/show.php');
$PAGE->set_context(context_course::instance($cid));
$PAGE->set_heading(get_string('pluginname', 'block_faces'));
$PAGE->set_title(get_string('pluginname', 'block_faces'));
echo $OUTPUT->header();
echo build_menu($cid);
// Render the page
$selectgroupsec = optional_param('selectgroupsec', '', PARAM_TEXT);
if (isset($selectgroupsec)) {
    if ($selectgroupsec == 'all' || $selectgroupsec == '') {
        echo render_all();
    } else {
        echo render_group();
    }
} else {
    echo render_all();
}
/**
 * 
 * Create the HTML output for the list on the right
 * hand side of the showfaces.php page
Beispiel #20
0
$mod = get_variable('mod', 'REQUEST', false);
$file_path = false;
if ($mod) {
    $result = $_CLASS['core_db']->query('SELECT * FROM ' . CORE_MODULES_TABLE . " WHERE module_name='" . $_CLASS['core_db']->escape($mod) . "'");
    $_CORE_MODULE = $_CLASS['core_db']->fetch_row_assoc($result);
    $_CLASS['core_db']->free_result($result);
}
if (!$mod || !$_CORE_MODULE) {
    $_CORE_MODULE = array('module_title' => '', 'module_name' => '');
    $file_path = $site_file_root . 'admin/index.php';
} else {
    if (file_exists($site_file_root . 'admin/' . $_CORE_MODULE['module_name'] . '.php')) {
        $file_path = $site_file_root . 'admin/' . $_CORE_MODULE['module_name'] . '.php';
    } else {
        $file_path = file_exists($site_file_root . 'modules/' . $_CORE_MODULE['module_name'] . '/admin/index.php') ? $site_file_root . 'modules/' . $_CORE_MODULE['module_name'] . '/admin/index.php' : false;
    }
}
if (!$file_path) {
    trigger_error('NO_ADMIN_MODULE', E_USER_ERROR);
}
if ($_CORE_MODULE['module_name']) {
    if (!$_CLASS['core_auth']->admin_power($_CORE_MODULE['module_name'])) {
        trigger_error('NOT_AUTH', E_USER_ERROR);
    }
}
$_CORE_MODULE['module_title'] = $_CLASS['core_user']->lang['ADMIN'] . ' &gt; ' . $_CORE_MODULE['module_title'];
$_CORE_MODULE['module_sides'] = BLOCK_ALL;
require $site_file_root . 'admin/menu.php';
$main_menu = build_menu($menu);
$_CLASS['core_template']->assign_array(array('LINK_HOME' => generate_link(), 'LINK_ADMIN' => generate_link(false, array('admin' => true)), 'MENU_MAIN' => $main_menu['content'], 'MENU_MAIN_ITEMS' => $main_menu['menu']));
require $file_path;