Esempio n. 1
0
});
Ko_Web_Route::VPost('edit', function () {
    $sText = Ko_Web_Request::SInput('text');
    $sUrl = Ko_Web_Request::SInput('url');
    $iParentId = Ko_Web_Request::IInput("parentid");
    $iMode = Ko_Web_Request::IInput("mode");
    $iId = Ko_Web_Request::IInput("id");
    $oApi = new KOperation_Menu_Api();
    if (!in_array($_SESSION['admin']['id'], KOperation_Conf::$super_users)) {
        KAdmin_Helper::vOutput(0);
    } else {
        KAdmin_Helper::vOutput($iId ? $oApi->iUpdate($iId, $sText, $sUrl, $iParentId, $iMode) : $oApi->iCreate($sText, $sUrl, $iParentId, $iMode));
    }
});
Ko_Web_Route::VGet('privacy', function () {
    $iId = Ko_Web_Request::IInput("id");
    $oApi = new KOperation_Menu_Api();
    $oTreeApi = new KOperation_Menu_TreeApi();
    $oPriApi = new KShequ_Menu_PrivacyApi();
    $aList = $oApi->aGetAll();
    $aMenu = $aList[$iId];
    $aParent = $oTreeApi->aGetParent($iId, 0);
    unset($aParent[count($aParent) - 1]);
    array_unshift($aParent, $iId);
    $pri_list = $oPriApi->aGetPrivacyGroupByMenuId($aParent);
    $tree_list = array();
    $aParent = array_reverse($aParent);
    $split = 0;
    foreach ($aParent as $menu_id) {
        $menu = $aList[$menu_id];
        $menu['pri'] = isset($pri_list[$menu_id]) ? $pri_list[$menu_id] : array();