ProfileAction::appList PHP Method

appList() public method

获取指定用户的应用数据列表
public appList ( ) : array
return array 指定用户的应用数据列表
    public function appList()
    {
        // 获取用户信息
        $user_info = model('User')->getUserInfo($this->uid);
        // 用户为空,则跳转用户不存在
        if (empty($user_info)) {
            $this->error(L('PUBLIC_USER_NOEXIST'));
        }
        // 个人空间头部
        $this->_top();
        $this->_assignUserInfo($this->uid);
        $appArr = $this->_tab_menu();
        $type = t($_GET['type']);
        if (!isset($appArr[$type])) {
            $this->error('参数出错!!');
        }
        $this->assign('type', $type);
        $className = ucfirst($type) . 'Protocol';
        $content = D($className, $type)->profileContent($this->uid);
        if (empty($content)) {
            $content = '暂无内容';
        }
        $this->assign('profileContent', $content);
        // 判断隐私设置
        $userPrivacy = $this->privacy($this->uid);
        if ($userPrivacy['space'] !== 1) {
            $this->_sidebar();
            // 档案类型
            $ProfileType = model('UserProfile')->getCategoryList();
            $this->assign('ProfileType', $ProfileType);
            // 个人资料
            $this->_assignUserProfile($this->uid);
            // 获取用户职业信息
            $userCategory = model('UserCategory')->getRelatedUserInfo($this->uid);
            if (!empty($userCategory)) {
                foreach ($userCategory as $value) {
                    $user_category .= '<a href="#" class="link btn-cancel"><span>' . $value['title'] . '</span></a>&nbsp;&nbsp;';
                }
            }
            $this->assign('user_category', $user_category);
        } else {
            $this->_assignUserInfo($this->uid);
        }
        $this->assign('userPrivacy', $userPrivacy);
        $this->setTitle($user_info['uname'] . '的' . L('PUBLIC_APPNAME_' . $type));
        $this->setKeywords($user_info['uname'] . '的' . L('PUBLIC_APPNAME_' . $type));
        $user_tag = model('Tag')->setAppName('User')->setAppTable('user')->getAppTags(array($this->uid));
        $this->setDescription(t($user_category . $user_info['location'] . ',' . implode(',', $user_tag[$this->uid]) . ',' . $user_info['intro']));
        $this->display();
    }