XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
userinfoAction.class.php
1<?php
12
13if (!defined('XOOPS_ROOT_PATH')) {
14 exit();
15}
16
17require_once XOOPS_MODULE_PATH.'/user/actions/UserInfoAction.class.php';
18
20{
21 protected $isError = false;
22 protected $errMsg = '';
23 protected $url = 'index.php';
24 protected $mController = null;
25 protected $mXoopsUser = null;
26
27 public function __construct($controller)
28 {
29 $this->mController = $controller;
30 $this->mXoopsUser = $controller->mRoot->mContext->mXoopsUser;
31 }
32
33 protected function setUrl($url)
34 {
35 $this->url = $url;
36 }
37
38 public function getUrl()
39 {
40 return $this->url;
41 }
42
43 protected function setErr($msg)
44 {
45 $this->isError = true;
46 $this->errMsg = $msg;
47 }
48
49 public function geterrMsg()
50 {
51 return $this->errMsg;
52 }
53
54 public function getisError()
55 {
56 return $this->isError;
57 }
58
59 public function execute(&$controller = null, &$xoopsUser = null)
60 {
61 if (!is_object($controller)) {
62 $controller = $this->mController;
63 }
64 if (!is_object($xoopsUser)) {
65 $xoopsUser = $this->mXoopsUser;
66 }
67 $result = $this->getDefaultView($controller, $xoopsUser);
68 if (USER_FRAME_VIEW_ERROR == $result) {
69 $this->setErr(_MD_MESSAGE_SETTINGS_MSG19);
70 }
71 $language = $controller->mRoot->mContext->getXoopsConfig('language');
72 require_once XOOPS_MODULE_PATH.'/user/language/'.$language . '/main.php';
73 }
74
75 public function executeView(&$render)
76 {
77 $render->setTemplateName('message_userinfo.html');
78 $render->setAttribute('thisUser', $this->mObject);
79 $render->setAttribute('rank', $this->mRankObject);
80 $render->setAttribute('pmliteUrl', $this->mPmliteURL);
81
82 $userSignature = $this->mObject->getShow('user_sig');
83
84 $render->setAttribute('user_signature', $userSignature);
85 $render->setAttribute('searchResults', $this->mSearchResults);
86
87 $user_ownpage = (is_object($this->mXoopsUser) && $this->mXoopsUser->get('uid') == $this->mObject->get('uid'));
88 $render->setAttribute('user_ownpage', $user_ownpage);
89
90 $render->setAttribute('self_delete', $this->mSelfDelete);
91 if ($user_ownpage && $this->mSelfDelete) {
92 $render->setAttribute('enableSelfDelete', true);
93 } else {
94 $render->setAttribute('enableSelfDelete', false);
95 }
96
97 $definitions = [];
98 $profile = null;
99 XCube_DelegateUtils::call('Legacy_Profile.GetDefinition', new XCube_Ref($definitions), 'view');
100 XCube_DelegateUtils::call('Legacy_Profile.GetProfile', new XCube_Ref($profile), $this->mObject->get('uid'));
101 $render->setAttribute('definitions', $definitions);
102 $render->setAttribute('data', $profile);
103 }
104}