コード例 #1
0
ファイル: menu.php プロジェクト: firaga/operation
});
Ko_Web_Route::VPost('delpri', function () {
    $oPriApi = new KShequ_Menu_PrivacyApi();
    $oPriApi->vDeleteOneMenuPri($_POST['admin_uid'], $_POST['menu_id']);
    echo 1;
    exit;
});
Ko_Web_Route::VGet('suggest', function () {
    $sName = Ko_Web_Request::SInput("name");
    $suggest_result = KDuizhang_Tool::suggest($sName, "admin_user");
    Ko_Tool_Str::VConvert2UTF8($suggest_result);
    echo json_encode(array('ret' => 1, 'msg' => $suggest_result));
    exit;
});
Ko_Web_Route::VGet('suggestmenu', function () {
    $sName = Ko_Web_Request::SInput("name");
    $sName = Ko_Tool_Str::SConvert2GB18030(trim($sName));
    $suggest_result = KDuizhang_Tool::suggest($sName, "sq_menu", 'id', 'text');
    Ko_Tool_Str::VConvert2UTF8($suggest_result);
    $oApi = new KOperation_Menu_Api();
    $tree_api = new KOperation_Menu_TreeApi();
    $aList = $oApi->aGetAll();
    $result = array();
    if (!empty($suggest_result)) {
        foreach ($suggest_result as $v) {
            $relations = $tree_api->aGetParent($v['id'], 0);
            unset($relations[count($relations) - 1]);
            array_unshift($relations, $v['id']);
            if (!empty($relations)) {
                $relations = array_reverse($relations);
                $msg = '';