public function handle_request_internel() { $params = $this->getParam(); if ($params['page'] == 'userinfo') { //编辑用户信息 $this->_edit_user($params); } $userinfoObj = Bll_OA::get_OA_info_by_userid($params['userid']); $userinfo = Tool_Array::daoresult_obj_to_arr($userinfoObj->data); if (empty($userinfo)) { $userinfoObj = Bll_OA::get_OA_info_by_username($params['username']); $userinfo = Tool_Array::daoresult_obj_to_arr($userinfoObj->data); if (empty($userinfo)) { $cUrl = $this->build_url("/error/"); $this->response->redirect($cUrl); exit; } } $usergroup = BLL_Authority::get_user_info_by_user_id($params['userid']); $citysArr = explode(',', $usergroup['citys']); $groupid = $usergroup['group_id']; $citys = $this->_init_user_city($citysArr); $citydata = Bll_City::get_city_data(); $citydata = $this->_init_data_city($citydata, 'CityId'); //获取所有角色 $group_all = Bll_Authority::get_all_group_info(); $this->setAttribute('groupid', $groupid); $this->setAttribute('groupall', $group_all); $this->setAttribute('citydata', $citydata); $this->setAttribute('citys', $citys); $this->setAttribute('userinfo', $userinfo); $this->setAttribute('params', $params); return 'Permissions_UserInfo'; }
public function handle_request_internel() { $params = $this->getParam(); $DataCount = Bll_Authority::get_groupinfo_count($params['searchText']); if ($DataCount > 0) { $page = isset($params['p']) ? (int) $params['p'] : 1; if ($this->request->is_post_method()) { $page = 1; } $page_size = 25; $show_num = 10; $DataInfo = Bll_Authority::get_groupinfo($params['searchText'], $page, $page_size); $this->setAttribute('datainfo', $DataInfo); $group_id_str = $this->returnStrKey($DataInfo, 'id'); if (!empty($group_id_str)) { //获取各个角色的成员数量 $groupCountArr = Bll_Authority::get_userinfo($group_id_str); if (!empty($groupCountArr)) { //根据组ID重组数组数据 $groupCountArr = Tool_Array::init_new_arr_by_key($groupCountArr, 'group_id'); $this->setAttribute('groupCountArr', $groupCountArr); } } $m_url = $this->build_url(__CLASS__); $this->set_multipage($page, $page_size, $DataCount, $m_url, $show_num, $params); } $this->setAttribute('params', $params); $this->setAttribute('Count', $DataCount); return 'Permissions_RoleList'; }
private static function _load($file) { $fileList = Core_Loader::getInstance()->getFile($file . PHP_EXT, CONFIG_DIR, true); if (empty($fileList)) { throw new Exception_Base("config file not found - {$file}"); } $fileList = array_reverse($fileList); $config = array(); foreach ($fileList as $f) { $c = (include $f); // 让后面覆盖前面的同名配置 $config = Tool_Array::merge($config, $c); } self::$_config[$file] = $config; }
/** * 获取用户最近使用菜单,菜单截取标题为8个中文字符 * @param $userId * @return array|bool */ public static function get_user_last_menus_info($userId) { //最近使用菜单 $last_used_menus = Bll_UserUsedLog::get_user_last_used_menus($userId, Const_Cms::CMS_SIJI_MENU_DEEPTH); $last_used_menus = Tool_Array::init_new_arr_by_key($last_used_menus, "item_id"); //菜单ID数组 $menus_ids = Tool_Array::get_val_arr($last_used_menus, "item_id"); $menus_total_info = self::get_menus_info_by_ids($menus_ids); $menus_total_info = Tool_Array::init_new_arr_by_key($menus_total_info, "id"); $last_menus = array(); foreach ($last_used_menus as $last_used_menus_key => $last_used_menus_val) { if (empty($menus_total_info[$last_used_menus_key])) { //菜单无效 unset($last_used_menus[$last_used_menus_key]); continue; } $menus_total_info[$last_used_menus_key]['item_title'] = Tool_Font::split_font($menus_total_info[$last_used_menus_key]['item_title'], Const_Cms::CMS_LAST_USED_FONT_LEN, ""); //<=8字,超出截字显示;数字或字母,按半字符计算; $last_menus[] = $menus_total_info[$last_used_menus_key]; } return $last_menus; }