<?php
if (!defined("_GNUBOARD_")) exit;

$begin_time = get_microtime();

include_once "{$g4['g4m_path']}/head.sub.php";

//경로 변수를 g4m으로 덮어씌운다.

function view_menu1($key, $no){
    global $menu;

    $str .= view_menu2($key, $no);

    return $str;
}

function view_menu2($key, $no) {
    global $menu, $auth_menu, $is_admin, $auth, $g4;

    $str = "";
    for ($i = 1; $i < count($menu[$key]); $i++) {
        if ($is_admin != "super" && (!array_key_exists($menu[$key][$i][0], $auth) || !strstr($auth[$menu[$key][$i][0]], "r"))){
            continue;
        }
        if ($menu[$key][$i][0] == "-") {
            $str .= "<li class='divide></li>";
        } else {
            $span1 = $span2 = "";
            if (isset($menu[$key][$i][3])) {
                $span1 = "<span style='{$menu[$key][$i][3]}'>";
                $span2 = "</span>";
            }

            $str .= "<li role='presentation'><a role='menuitem' tabindex='-1' href='{$menu[$key][$i][2]}'>{$span1}{$menu[$key][$i][1]}{$span2}</a></li>";

            $auth_menu[$menu[$key][$i][0]] = $menu[$key][$i][1];
        }
    }

    return $str;
}

function print_menu1($key, $no){
    global $menu;

    $str = "<table width=130 cellpadding=1 cellspacing=0 id='menu_{$key}' style='position:absolute; display:none; z-index:1;' onpropertychange=\"selectBoxHidden('menu_{$key}')\"><colgroup><colgroup><colgroup width=10><tr><td rowspan=2 colspan=2 bgcolor=#EFCA95><table width=127 cellpadding=0 cellspacing=0 bgcolor=#FEF8F0><colgroup style='padding-left:10px'>";
    $str .= print_menu2($key, $no);
    $str .= "</table></td><td></td></tr><tr><td bgcolor=#DDDAD5 height=40></td></tr><tr><td width=4></td><td height=3 width=127 bgcolor=#DDDAD5></td><td bgcolor=#DDDAD5></td></tr></table>\n";

    return $str;
}


function print_menu2($key, $no){
    global $menu, $auth_menu, $is_admin, $auth, $g4;

    $str = "";
    for($i=1; $i<count($menu[$key]); $i++)
    {
        if ($is_admin != "super" && (!array_key_exists($menu[$key][$i][0],$auth) || !strstr($auth[$menu[$key][$i][0]], "r")))
            continue;

        if ($menu[$key][$i][0] == "-")
            $str .= "<tr><td class=bg_line{$no}></td></tr>";
        else
        {
            $span1 = $span2 = "";
            if (isset($menu[$key][$i][3]))
            {
                $span1 = "<span style='{$menu[$key][$i][3]}'>";
                $span2 = "</span>";
            }
            $str .= "<tr><td class=bg_menu{$no}>";
            if ($no == 2)
                $str .= "&nbsp;&nbsp;<img src='{$g4['g4m_admin_path']}/img/icon.gif' align=absmiddle> ";
            $str .= "<a href='{$menu[$key][$i][2]}'>{$span1}{$menu[$key][$i][1]}{$span2}</a></td></tr>";

            $auth_menu[$menu[$key][$i][0]] = $menu[$key][$i][1];
        }
    }

    return $str;
}
?>

<script type="text/javascript">
//if (!g4_is_ie) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
var prevdiv = null;
var timerID = null;

function getMouseXY(e) 
{
    if (g4_is_ie) { // grab the x-y pos.s if browser is IE
        tempX = event.clientX + document.body.scrollLeft;
        tempY = event.clientY + document.body.scrollTop;
    } else {  // grab the x-y pos.s if browser is NS
        tempX = e.pageX;
        tempY = e.pageY;
    }  

    if (tempX < 0) {tempX = 0;}
    if (tempY < 0) {tempY = 0;}  

    return true;
}

function imageview(id, w, h)
{

    menu(id);

    var el_id = document.getElementById(id);

    //submenu = eval(name+".style");
    submenu = el_id.style;
    submenu.left = tempX - ( w + 11 );
    submenu.top  = tempY - ( h / 2 );

    selectBoxVisible();

    if (el_id.style.display != 'none')
        selectBoxHidden(id);
}

function help(id, left, top)
{
    menu(id);

    var el_id = document.getElementById(id);

    //submenu = eval(name+".style");
    submenu = el_id.style;
    submenu.left = tempX - 50 + left;
    submenu.top  = tempY + 15 + top;

    selectBoxVisible();

    if (el_id.style.display != 'none')
        selectBoxHidden(id);
}

// TEXTAREA 사이즈 변경
function textarea_size(fld, size)
{
	var rows = parseInt(fld.rows);

	rows += parseInt(size);
	if (rows > 0) {
		fld.rows = rows;
	}
}
</script>

<script type="text/javascript" src="<?php echo $g4['path']?>/js/sideview.js"></script>
<script type="text/javascript">
var save_layer = null;
function layer_view(link_id, menu_id, opt, x, y)
{
    var link = document.getElementById(link_id);
    var menu = document.getElementById(menu_id);

    //for (i in link) { document.write(i + '<br/>'); } return;

    if (save_layer != null)
    {
        save_layer.style.display = "none";
        selectBoxVisible();
    }

    if (link_id == '')
        return;

    if (opt == 'hide')
    {
        menu.style.display = 'none';
        selectBoxVisible();
    }
    else
    {
        x = parseInt(x);
        y = parseInt(y);
        menu.style.left = get_left_pos(link) + x + 'px';
        menu.style.top  = get_top_pos(link) + link.offsetHeight + y + 'px';
        menu.style.display = 'block';
    }

    save_layer = menu;
}
$(function(){
    
     function wResize() {

             var winW = $(window).width();
             var Body = $('body');

         if ( winW < '768') {
             $(".hide-sm input").attr({"disabled":true});
             $(".hide-sm select").attr({"disabled":true});
             $(".show-sm input").attr({"disabled":false});
             $(".show-sm select").attr({"disabled":false});
         }
         if ( winW > '768' ) {
             $(".show-sm input").attr({"disabled":true});
             $(".show-sm select").attr({"disabled":true});
             $(".hide-sm input").attr({"disabled":false});
             $(".hide-sm select").attr({"disabled":false});
         }         

     }

     wResize();

    $(window).resize(function() {
        wResize();
    });
});
    $(function(){
        $(".left_menu").bind('click',function(){
            try {
                android.vibration(50);
            } catch (exception) { 
                console.log(exception);
            }  
        });
        $('.right_menu').click(function(){
            try {
                android.vibration(50);
            } catch (exception) { 
                console.log(exception);
            }  
        });
        $("#navigations").mmenu({
            slideDuration: 1000,
            slidingSubmenus : true,
            closeOnClick : false
        });

        $('nav#menu-right').mmenu({
            position: 'right',
            addCounters: true,
            slideDuration: 1000,
            slidingSubmenus : false
        });
    });


</script>

<link rel="stylesheet" href="<?php echo $g4['g4m_admin_path']?>/admin.style.css" type="text/css">


<body>
<a name='gnuboard4_admin_head'></a>

<!-- Header Bar -->
<div id='page'><!-- wrpper-->
<div class="navbar navbar-inverse" id='header'>
    <div class="container">
        <div class="navbar-header" style="text-align: center; position: relative;  height: 50px">
            <a class='left_menu' href='#navigations' style="display: block; position: absolute; left: 10px; top: 10px; font-size: 1.5em;width: 40px; height: 40px;" >
                <span class='glyphicon glyphicon-align-justify'></span>
            </a>
            <a href="<?php echo $g4['g4m_adm_path'] ?>" style="margin: 0 auto; float: none; line-height: 50px;text-align: center; font-size: 1.5em">관리자</a>
            <a class='right_menu' href='#menu-right' style="display: block; position: absolute; right: 10px; top: 10px; font-size: 1.5em;width: 40px; height: 40px;">
                <span class='glyphicon glyphicon-user'></span>
            </a>
        </div>

    </div>
</div>
    
<div class="bs-header" id="content">
    <div class="container">
        <div class='row'>
            <div class="col-xs-12 col-sm-12 col-md-12 ">
                <ol class='breadcrumb'>
                    <li><a href='<?php echo $g4['g4m_admin_path'] ?>/'>Admin</a> &gt; </li>
                    <?php
                    $tmp_menu = "";
                    if (isset($sub_menu))
                        $tmp_menu = substr($sub_menu, 0, 3);
                    if (isset($menu["menu{$tmp_menu}"][0][1])) {
                        if ($menu["menu{$tmp_menu}"][0][2]) {
                            echo "<li><a href='" . $menu["menu{$tmp_menu}"][0][2] . "'&gt;";
                            echo $menu["menu{$tmp_menu}"][0][1];
                            echo "</a> &gt; </li> ";
                        } else
                            echo $menu["menu{$tmp_menu}"][0][1] . " &gt;";
                    }
                    ?>
                    <li><?php echo $g4['title'] ?> <span class=small>: <?php echo $member['mb_id'] ?>님</span></li>
                </ol>
            </div>
        </div>
    </div>
</div>
 
<div class="container">
    <div class="row row-offcanvas row-offcanvas-left">
        <!-- 우측 컨텐츠 블럭 -->
        <div class="col-xs-12 col-sm-12">
            <!-- //head.php -->
            <!-- 컨텐츠 영역 -->
            
