<{php}>
  global $xoopsDB,$xoopsTpl;
  #引入類別物件---------------------------------
  include_once XOOPS_ROOT_PATH.'/modules/ugm_tools/ugmKind.php';
  $tbl="ugm_tools_nav";$kind="nav";$stop_level=2;
  $ugmKind=new ugmKind($tbl,$kind,$stop_level);
  # ----得到陣列 ----------------------------
  $ofsn=0;$level=1;$list="";
  $block=$ugmKind->get_use_theme_nav($ofsn,$level);
  $xoopsTpl->assign('block',$block);
  #<{includeq file="$xoops_rootpath/modules/ugm_tools/templates/ugm_tools_tpl_theme_navbarb.html"}>
<{/php}>

<div class="navbar-wrapper">
  <div class="navbar navbar-inverse  navbar-fixed-top global-nav ">
    <div class="container">
      <div class="navbar-header">
        <button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        </button>
        <a href="<{$xoops_url}>" class="navbar-brand xlogo" title="<{$xoops_sitename}>">
            <{$xoops_sitename}>
        </a>
      </div>
      <div class="navbar-collapse collapse">
        <ul class="nav navbar-nav">
          <{foreach from=$block item=block}>
            <{if $block.sub}>
              <li class="dropdown">
                <a data-toggle="dropdown" class="dropdown-toggle" href="">
                  <{$block.title}><b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                  <{foreach from=$block.sub item=block}>
                    <li>
                      <a href="<{$block.url}>">
                        <{$block.title}>
                      </a>
                    </li>
                  <{/foreach}>
                </ul>
              </li>
            <{else}>
              <li><a href="javascript:<{$block.sn}>;"><{$block.title}></a></li>
            <{/if}>
          <{/foreach}>
        </ul>

        <ul class="nav navbar-nav navbar-right" id="main-menu-right">
          <{if $xoops_isuser}>
            <li class="dropdown" id="preview-menu">
              <a rel="tooltip" title="<{$smarty.const.TF_USER_WELCOME}>" class="dropdown-toggle" data-toggle="dropdown" href="#">
                歡迎：<{$xoops_name}><b class="caret"></b>
              </a>

              <ul class="dropdown-menu">

                <{if $xoops_isadmin}>
                  <li>
                    <a href="<{$xoops_url}>/admin.php">
                      <span class="glyphicon glyphicon-th-list"></span>
                      管理
                     </a>
                  </li>
                <{/if}>
                <li class="divider"></li>
                <li>
                  <a href="<{$xoops_url}>/notifications.php">
                    <span class="glyphicon glyphicon-th-large"></span>
                    通知
                  </a>
                </li>
                <li>
                  <a href="<{$xoops_url}>/user.php">
                    <span class="glyphicon glyphicon-th-large"></span>
                    帳號
                  </a>
                </li>
                <li>
                  <a href="<{$xoops_url}>/user.php?op=logout">
                    <span class="glyphicon glyphicon-th-large"></span>
                    登出
                  </a>
                </li>
              </ul>
            </li>
          <{else}>
            <li class="dropdown">
              <a data-toggle="dropdown" class="dropdown-toggle" href="javascript:<{$block.sn}>;">
                登入<b class="caret"></b>
              </a>
              <ul class="dropdown-menu">
                <li style="padding:0 10px;">
                  <form action="<{$xoops_url}>/user.php" method="post" role="form">
                    <div class="form-group">
                      帳號：
                      <input class="form-control" type="text" name="uname" placeholder="您的帳號">
                    </div>

                    <div class="form-group">
                      密碼：
                      <input class="form-control" type="password" name="pass" placeholder="您的密碼">
                    </div>

                    <div class="checkbox">
                    <label>
                      <input type="checkbox" name="rememberme" value="On" class="formButton"> 記住我
                    </label>
                    </div>

                    <input type="hidden" name="xoops_redirect" value="<{$xoops_url}>">
                    <input type="hidden" name="op" value="login">
                    <input type="submit" class="btn btn-primary btn-block btn-sm" value="會員登入">

                  </form>
                </li>
              </ul>
            </li>
          </ul>
          <{/if}>
        </ul>
      </div>
    </div>
  </div>
</div>
