Example #1
0
        echo '<th>2차메뉴</th>';
        echo '<th>3차메뉴</th>';
        echo '<th>4차메뉴</th>';
        echo '<th>5차메뉴</th>';
        echo '<th>고유키(PK)</th>';
        echo '<th>메뉴코드</th>';
        echo '<th>현재주소</th>';
        echo '<th>물리주소</th>';
        echo '<th>메뉴형식</th>';
        echo '<th>모바일</th>';
        echo '<th>새창</th>';
        echo '<th>숨김</th>';
        echo '<th>차단</th>';
        echo '<th>리다이렉트</th>';
        echo '<th>연결주소</th>';
        echo '</thead>';
        echo '<tbody>';
        echo getMenuXls($s, $table['s_menu'], 0, 0, 0, 0, array('', '모듈', '위젯', '코딩'), '');
        echo '</tbody>';
        echo '</table>';
        exit;
    } else {
        header("Content-Type: application/octet-stream");
        header("Content-Disposition: attachment; filename=menu_" . $_HS['id'] . ".txt");
        header("Content-Description: PHP4 Generated Data");
        echo $_HS['name'] . "-메뉴구조\r\n";
        echo "-------------------------------------------------------------------------\r\n\r\n";
        echo getMenuTxt($s, $table['s_menu'], 0, 0, 0, 0, '');
        exit;
    }
}
Example #2
0
function getMenuTxt($site, $table, $j, $parent, $depth, $uid, $code)
{
    global $g;
    static $j, $string;
    $xdepth = $depth + 1;
    $CD = getDbSelect($table, ($site ? 'site=' . $site . ' and ' : '') . 'depth=' . $xdepth . ' and parent=' . $parent . ' order by gid asc', '*');
    while ($C = db_fetch_array($CD)) {
        $j++;
        $code = $code . $C['id'] . '/';
        $_code = substr($code, 0, strlen($code) - 1);
        for ($i = 0; $i < $depth; $i++) {
            $string .= "\t";
        }
        $string .= '[' . $xdepth . ']' . ($C['hidden'] ? '[숨김]' : '') . ($C['reject'] ? '[차단]' : '') . ($C['target'] ? '[새창]' : '') . $C['name'] . " = " . RW('c=' . $_code) . "\r\n";
        if ($C['isson']) {
            getMenuTxt($site, $table, $j, $C['uid'], $C['depth'], $uid, $code);
        }
        if ($xdepth == 1) {
            $string .= "\r\n";
        }
        $code = '';
    }
    return $string;
}