Пример #1
0
 protected function vPreRun()
 {
     $this->aUser = $_SESSION['admin'];
     Ko_Tool_Str::VConvert2UTF8($this->aUser);
     $this->is_admin = in_array($_SESSION['admin']['uid'], KShequ_Conf::$super_users);
     $this->oGetSmarty()->vAssignHtml('__user', $this->aUser);
     $this->oGetSmarty()->vAssignHtml("is_super", $this->is_admin ? 1 : 0);
     //权限检查
     $this->_vCheckPriority();
     list($top_menus, $cur_menu, $left_nav_html) = $this->_aGetNavData();
     if (!$this->bIsAjaxRequest()) {
         $this->oGetSmarty()->vAssignHtml('__top_menus', $top_menus);
         $this->oGetSmarty()->vAssignHtml('__cur_menus', $cur_menu);
         $this->oGetSmarty()->vAssignRaw('__admin_nav', $left_nav_html);
         $this->oGetSmarty()->vAssignHtml('__admin_with', $this->_aGetRuntimeData());
     }
 }
Пример #2
0
 private function _aHttpBuildQuery($aPara)
 {
     if ($this->_bPageIsGb() != $this->_bIsGb()) {
         if ($this->_bIsGb()) {
             Ko_Tool_Str::VConvert2UTF8($aPara);
         } else {
             Ko_Tool_Str::VConvert2GB18030($aPara);
         }
     }
     return http_build_query($aPara);
 }
Пример #3
0
    $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 = '';
                foreach ($relations as $menu_id) {
                    $msg .= $aList[$menu_id]['text'] . '=>';
                }