Index: trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | class SpecialAddRelationship extends UnlistedSpecialPage { |
17 | 17 | |
18 | 18 | /** |
19 | | - * Constructor |
| 19 | + * Constructor -- set up the new special page |
20 | 20 | */ |
21 | 21 | public function __construct() { |
22 | 22 | parent::__construct( 'AddRelationship' ); |
— | — | @@ -37,61 +37,61 @@ |
38 | 38 | |
39 | 39 | $wgOut->addExtensionStyle( $wgUserRelationshipScripts . '/UserRelationship.css' ); |
40 | 40 | |
41 | | - $usertitle = Title::newFromDBkey( $wgRequest->getVal( 'user' ) ); |
| 41 | + $userTitle = Title::newFromDBkey( $wgRequest->getVal( 'user' ) ); |
42 | 42 | |
43 | | - if ( !$usertitle ) { |
| 43 | + if ( !$userTitle ) { |
44 | 44 | $wgOut->setPageTitle( wfMsgHtml( 'ur-error-title' ) ); |
45 | 45 | $wgOut->addWikiText( wfMsgNoTrans( 'ur-add-no-user' ) ); |
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
49 | | - $user = Title::makeTitle( NS_USER, $usertitle->getText() ); |
| 49 | + $user = Title::makeTitle( NS_USER, $userTitle->getText() ); |
50 | 50 | |
51 | | - $this->user_name_to = $usertitle->getText(); |
| 51 | + $this->user_name_to = $userTitle->getText(); |
52 | 52 | $this->user_id_to = User::idFromName( $this->user_name_to ); |
53 | | - $this->relationship_type = $wgRequest->getVal( 'rel_type' ); |
| 53 | + $this->relationship_type = $wgRequest->getInt( 'rel_type' ); |
54 | 54 | if ( !$this->relationship_type || !is_numeric( $this->relationship_type ) ) { |
55 | 55 | $this->relationship_type = 1; |
56 | 56 | } |
57 | 57 | |
58 | 58 | if ( ( $wgUser->getID() == $this->user_id_to ) && ( $wgUser->getID() != 0 ) ) { |
59 | 59 | $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) ); |
60 | | - $out .= '<div class="relationship-error-message">' |
61 | | - . wfMsg( 'ur-add-error-message-yourself' ) . |
| 60 | + $out .= '<div class="relationship-error-message">' . |
| 61 | + wfMsg( 'ur-add-error-message-yourself' ) . |
62 | 62 | '</div> |
63 | 63 | <div> |
64 | 64 | <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />'; |
65 | | - if ( $wgUser->isLoggedIn() ) { |
66 | | - $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />'; |
67 | | - } |
| 65 | + if ( $wgUser->isLoggedIn() ) { |
| 66 | + $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />'; |
| 67 | + } |
68 | 68 | $out .= '</div>'; |
69 | 69 | |
70 | 70 | $wgOut->addHTML( $out ); |
71 | 71 | |
72 | 72 | } elseif ( $wgUser->isBlocked() ) { |
73 | 73 | $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) ); |
74 | | - $out .= '<div class="relationship-error-message">' |
75 | | - . wfMsg( 'ur-add-error-message-blocked' ) . |
| 74 | + $out .= '<div class="relationship-error-message">' . |
| 75 | + wfMsg( 'ur-add-error-message-blocked' ) . |
76 | 76 | '</div> |
77 | 77 | <div> |
78 | 78 | <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />'; |
79 | | - if ( $wgUser->isLoggedIn() ) { |
80 | | - $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />'; |
81 | | - } |
| 79 | + if ( $wgUser->isLoggedIn() ) { |
| 80 | + $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />'; |
| 81 | + } |
82 | 82 | $out .= '</div>'; |
83 | 83 | |
84 | 84 | $wgOut->addHTML( $out ); |
85 | 85 | |
86 | 86 | } elseif ( $this->user_id_to == 0 ) { |
87 | 87 | $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) ); |
88 | | - $out .= '<div class="relationship-error-message">' |
89 | | - . wfMsg( 'ur-add-error-message-no-user' ) . |
| 88 | + $out .= '<div class="relationship-error-message">' . |
| 89 | + wfMsg( 'ur-add-error-message-no-user' ) . |
90 | 90 | '</div> |
91 | 91 | <div> |
92 | 92 | <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />'; |
93 | | - if ( $wgUser->isLoggedIn() ) { |
94 | | - $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />'; |
95 | | - } |
| 93 | + if ( $wgUser->isLoggedIn() ) { |
| 94 | + $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />'; |
| 95 | + } |
96 | 96 | $out .= '</div>'; |
97 | 97 | |
98 | 98 | $wgOut->addHTML( $out ); |
— | — | @@ -105,7 +105,8 @@ |
106 | 106 | } |
107 | 107 | |
108 | 108 | $avatar = new wAvatar( $this->user_id_to, 'l' ); |
109 | | - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />'; |
| 109 | + $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . |
| 110 | + $avatar->getAvatarImage() . '" alt="" border="0" />'; |
110 | 111 | |
111 | 112 | $out = ''; |
112 | 113 | $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) ); |
— | — | @@ -131,7 +132,8 @@ |
132 | 133 | } |
133 | 134 | |
134 | 135 | $avatar = new wAvatar( $this->user_id_to, 'l' ); |
135 | | - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />'; |
| 136 | + $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . |
| 137 | + $avatar->getAvatarImage() . '" alt="" border="0" />'; |
136 | 138 | |
137 | 139 | $out = ''; |
138 | 140 | $wgOut->setPageTitle( wfMsg( 'ur-add-error-message-pending-request-title' ) ); |
— | — | @@ -177,7 +179,8 @@ |
178 | 180 | $rel = $rel->addRelationshipRequest( $this->user_name_to, $this->relationship_type, $wgRequest->getVal( 'message' ) ); |
179 | 181 | |
180 | 182 | $avatar = new wAvatar( $this->user_id_to, 'l' ); |
181 | | - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />'; |
| 183 | + $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . |
| 184 | + $avatar->getAvatarImage() . '" alt="" border="0" />'; |
182 | 185 | |
183 | 186 | $out = ''; |
184 | 187 | |
— | — | @@ -214,8 +217,6 @@ |
215 | 218 | function displayForm() { |
216 | 219 | global $wgOut, $wgUploadPath; |
217 | 220 | |
218 | | - $form = ''; |
219 | | - |
220 | 221 | if ( $this->relationship_type == 1 ) { |
221 | 222 | $wgOut->setPageTitle( wfMsg( 'ur-add-title-friend', $this->user_name_to ) ); |
222 | 223 | $add = wfMsg( 'ur-add-message-friend', $this->user_name_to ); |
— | — | @@ -227,18 +228,17 @@ |
228 | 229 | } |
229 | 230 | |
230 | 231 | $avatar = new wAvatar( $this->user_id_to, 'l' ); |
231 | | - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />'; |
| 232 | + $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . |
| 233 | + $avatar->getAvatarImage() . '" alt="" border="0" />'; |
232 | 234 | |
233 | | - $user_link = Title::makeTitle( NS_USER, $this->user_name_to ); |
234 | | - |
235 | | - $form .= "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\"> |
| 235 | + $form = "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\"> |
236 | 236 | <div class=\"relationship-action\"> |
237 | 237 | {$avatar_img} |
238 | 238 | " . $add . |
239 | 239 | '<div class="cleared"></div> |
240 | 240 | </div> |
241 | | - <div class="relationship-textbox-title">' |
242 | | - . wfMsg( 'ur-add-personal-message' ) . |
| 241 | + <div class="relationship-textbox-title">' . |
| 242 | + wfMsg( 'ur-add-personal-message' ) . |
243 | 243 | '</div> |
244 | 244 | <textarea name="message" id="message" rows="3" cols="50"></textarea> |
245 | 245 | <div class="relationship-buttons"> |
Index: trunk/extensions/SocialProfile/UserRelationship/SpecialRemoveRelationship.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | class SpecialRemoveRelationship extends UnlistedSpecialPage { |
16 | 16 | |
17 | 17 | /** |
18 | | - * Constructor |
| 18 | + * Constructor -- set up the new special page |
19 | 19 | */ |
20 | 20 | public function __construct() { |
21 | 21 | parent::__construct( 'RemoveRelationship' ); |
— | — | @@ -45,16 +45,19 @@ |
46 | 46 | |
47 | 47 | $this->user_name_to = $usertitle->getText(); |
48 | 48 | $this->user_id_to = User::idFromName( $this->user_name_to ); |
49 | | - $this->relationship_type = UserRelationship::getUserRelationshipByID( $this->user_id_to, $wgUser->getID() ); |
| 49 | + $this->relationship_type = UserRelationship::getUserRelationshipByID( |
| 50 | + $this->user_id_to, |
| 51 | + $wgUser->getID() |
| 52 | + ); |
50 | 53 | |
51 | 54 | if ( $this->relationship_type == 1 ) { |
52 | | - $confirmtitle = wfMsg( 'ur-remove-relationship-title-confirm-friend', $this->user_name_to ); |
53 | | - $confirmmsg = wfMsg( 'ur-remove-relationship-message-confirm-friend', $this->user_name_to ); |
| 55 | + $confirmTitle = wfMsg( 'ur-remove-relationship-title-confirm-friend', $this->user_name_to ); |
| 56 | + $confirmMsg = wfMsg( 'ur-remove-relationship-message-confirm-friend', $this->user_name_to ); |
54 | 57 | $error = wfMsg( 'ur-remove-error-not-loggedin-friend' ); |
55 | 58 | $pending = wfMsg( 'ur-remove-error-message-pending-friend-request', $this->user_name_to ); |
56 | 59 | } else { |
57 | | - $confirmtitle = wfMsg( 'ur-remove-relationship-title-confirm-foe', $this->user_name_to ); |
58 | | - $confirmmsg = wfMsg( 'ur-remove-relationship-message-confirm-foe', $this->user_name_to ); |
| 60 | + $confirmTitle = wfMsg( 'ur-remove-relationship-title-confirm-foe', $this->user_name_to ); |
| 61 | + $confirmMsg = wfMsg( 'ur-remove-relationship-message-confirm-foe', $this->user_name_to ); |
59 | 62 | $error = wfMsg( 'ur-remove-error-not-loggedin-foe' ); |
60 | 63 | $pending = wfMsg( 'ur-remove-error-message-pending-foe-request', $this->user_name_to ); |
61 | 64 | } |
— | — | @@ -75,8 +78,8 @@ |
76 | 79 | $wgOut->addHTML( $out ); |
77 | 80 | } elseif ( $this->relationship_type == false ) { |
78 | 81 | $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) ); |
79 | | - $out .= '<div class="relationship-error-message">' |
80 | | - . wfMsg( 'ur-remove-error-message-no-relationship', $this->user_name_to ) . |
| 82 | + $out .= '<div class="relationship-error-message">' . |
| 83 | + wfMsg( 'ur-remove-error-message-no-relationship', $this->user_name_to ) . |
81 | 84 | '</div> |
82 | 85 | <div> |
83 | 86 | <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />'; |
— | — | @@ -88,9 +91,9 @@ |
89 | 92 | $wgOut->addHTML( $out ); |
90 | 93 | } elseif ( UserRelationship::userHasRequestByID( $this->user_id_to, $wgUser->getID() ) == true ) { |
91 | 94 | $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) ); |
92 | | - $out .= '<div class="relationship-error-message"> |
93 | | - ' . $pending . ' |
94 | | - </div> |
| 95 | + $out .= '<div class="relationship-error-message">' . |
| 96 | + $pending . |
| 97 | + '</div> |
95 | 98 | <div> |
96 | 99 | <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />'; |
97 | 100 | if ( $wgUser->isLoggedIn() ) { |
— | — | @@ -101,8 +104,8 @@ |
102 | 105 | $wgOut->addHTML( $out ); |
103 | 106 | } elseif ( $wgUser->getID() == 0 ) { |
104 | 107 | $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) ); |
105 | | - $out .= '<div class="relationship-error-message">' |
106 | | - . $error . |
| 108 | + $out .= '<div class="relationship-error-message">' . |
| 109 | + $error . |
107 | 110 | '</div> |
108 | 111 | <div> |
109 | 112 | <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />'; |
— | — | @@ -115,18 +118,25 @@ |
116 | 119 | } else { |
117 | 120 | $rel = new UserRelationship( $wgUser->getName() ); |
118 | 121 | if ( $wgRequest->wasPosted() && $_SESSION['alreadysubmitted'] == false ) { |
119 | | - |
120 | 122 | $_SESSION['alreadysubmitted'] = true; |
121 | | - $rel->removeRelationshipByUserID( $this->user_id_to, $wgUser->getID() ); |
122 | | - $rel->sendRelationshipRemoveEmail( $this->user_id_to, $wgUser->getName(), $this->relationship_type ); |
| 123 | + $rel->removeRelationshipByUserID( |
| 124 | + $this->user_id_to, |
| 125 | + $wgUser->getID() |
| 126 | + ); |
| 127 | + $rel->sendRelationshipRemoveEmail( |
| 128 | + $this->user_id_to, |
| 129 | + $wgUser->getName(), |
| 130 | + $this->relationship_type |
| 131 | + ); |
123 | 132 | $avatar = new wAvatar( $this->user_id_to, 'l' ); |
124 | | - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="" />'; |
| 133 | + $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . |
| 134 | + $avatar->getAvatarImage() . '" alt="" border="" />'; |
125 | 135 | |
126 | | - $wgOut->setPageTitle( $confirmtitle ); |
| 136 | + $wgOut->setPageTitle( $confirmTitle ); |
127 | 137 | $out .= "<div class=\"relationship-action\"> |
128 | | - {$avatar_img} |
129 | | - " . $confirmmsg . " |
130 | | - <div class=\"relationship-buttons\"> |
| 138 | + {$avatar_img}" . |
| 139 | + $confirmMsg . |
| 140 | + "<div class=\"relationship-buttons\"> |
131 | 141 | <input type=\"button\" class=\"site-button\" value=\"" . wfMsg( 'ur-main-page' ) . "\" size=\"20\" onclick=\"window.location='index.php?title=" . wfMsgForContent( 'mainpage' ) . "'\"/> |
132 | 142 | <input type=\"button\" class=\"site-button\" value=\"" . wfMsg( 'ur-your-profile' ) . "\" size=\"20\" onclick=\"window.location='" . $wgUser->getUserPage()->escapeFullURL() . "'\"/> |
133 | 143 | </div> |
— | — | @@ -149,9 +159,9 @@ |
150 | 160 | function displayForm() { |
151 | 161 | global $wgOut, $wgUploadPath; |
152 | 162 | |
153 | | - $form = ''; |
154 | 163 | $avatar = new wAvatar( $this->user_id_to, 'l' ); |
155 | | - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="avatar" />'; |
| 164 | + $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . |
| 165 | + $avatar->getAvatarImage() . '" alt="avatar" />'; |
156 | 166 | |
157 | 167 | if ( $this->relationship_type == 1 ) { |
158 | 168 | $title = wfMsg( 'ur-remove-relationship-title-friend', $this->user_name_to ); |
— | — | @@ -161,10 +171,11 @@ |
162 | 172 | $remove = wfMsg( 'ur-remove-relationship-message-foe', $this->user_name_to, wfMsg( 'ur-remove' ) ); |
163 | 173 | } |
164 | 174 | $wgOut->setPageTitle( $title ); |
165 | | - $form .= "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\"> |
| 175 | + |
| 176 | + $form = "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\"> |
166 | 177 | <div class=\"relationship-action\"> |
167 | | - {$avatar_img} |
168 | | - " . $remove . |
| 178 | + {$avatar_img}" . |
| 179 | + $remove . |
169 | 180 | '<div class="relationship-buttons"> |
170 | 181 | <input type="hidden" name="user" value="' . addslashes( $this->user_name_to ) . '" /> |
171 | 182 | <input type="button" class="site-button" value="' . wfMsg( 'ur-remove' ) . '" size="20" onclick="document.form1.submit()" /> |
— | — | @@ -173,7 +184,8 @@ |
174 | 185 | <div class="cleared"></div> |
175 | 186 | </div> |
176 | 187 | |
177 | | - </form>'; |
| 188 | + </form>'; |
| 189 | + |
178 | 190 | return $form; |
179 | 191 | } |
180 | 192 | } |
Index: trunk/extensions/SocialProfile/UserRelationship/SpecialViewRelationships.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | class SpecialViewRelationships extends SpecialPage { |
16 | 16 | |
17 | 17 | /** |
18 | | - * Constructor |
| 18 | + * Constructor -- set up the new special page |
19 | 19 | */ |
20 | 20 | public function __construct() { |
21 | 21 | parent::__construct( 'ViewRelationships' ); |
— | — | @@ -33,11 +33,11 @@ |
34 | 34 | $output = ''; |
35 | 35 | |
36 | 36 | /** |
37 | | - * Get querystring variables |
| 37 | + * Get query string variables |
38 | 38 | */ |
39 | 39 | $user_name = $wgRequest->getVal( 'user' ); |
40 | | - $rel_type = $wgRequest->getVal( 'rel_type' ); |
41 | | - $page = $wgRequest->getVal( 'page' ); |
| 40 | + $rel_type = $wgRequest->getInt( 'rel_type' ); |
| 41 | + $page = $wgRequest->getInt( 'page' ); |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Redirect Non-logged in users to Login Page |
— | — | @@ -76,8 +76,8 @@ |
77 | 77 | */ |
78 | 78 | if ( $user_id == 0 ) { |
79 | 79 | $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) ); |
80 | | - $out .= '<div class="relationship-error-message">' |
81 | | - . wfMsg( 'ur-error-message-no-user' ) . |
| 80 | + $out .= '<div class="relationship-error-message">' . |
| 81 | + wfMsg( 'ur-error-message-no-user' ) . |
82 | 82 | '</div> |
83 | 83 | <div class="relationship-request-buttons"> |
84 | 84 | <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" onclick=\'window.location="index.php?title=' . wfMsgForContent( 'mainpage' ) . '"\' />'; |
— | — | @@ -108,7 +108,9 @@ |
109 | 109 | $total = $friend_count; |
110 | 110 | $rem = wfMsg( 'ur-remove-relationship-friend' ); |
111 | 111 | $output .= '<div class="back-links"> |
112 | | - <a href="' . $back_link->escapeFullURL() . '">' . wfMsg( 'ur-backlink', $rel->user_name ) . '</a> |
| 112 | + <a href="' . $back_link->escapeFullURL() . '">' . |
| 113 | + wfMsg( 'ur-backlink', $rel->user_name ) . |
| 114 | + '</a> |
113 | 115 | </div> |
114 | 116 | <div class="relationship-count">' . |
115 | 117 | wfMsgExt( |
— | — | @@ -123,7 +125,9 @@ |
124 | 126 | $total = $foe_count; |
125 | 127 | $rem = wfMsg( 'ur-remove-relationship-foe' ); |
126 | 128 | $output .= '<div class="back-links"> |
127 | | - <a href="' . $back_link->escapeFullURL() . '">' . wfMsg( 'ur-backlink', $rel->user_name ) . '</a> |
| 129 | + <a href="' . $back_link->escapeFullURL() . '">' . |
| 130 | + wfMsg( 'ur-backlink', $rel->user_name ) . |
| 131 | + '</a> |
128 | 132 | </div> |
129 | 133 | <div class="relationship-count">' |
130 | 134 | . wfMsgExt( |
— | — | @@ -146,9 +150,9 @@ |
147 | 151 | |
148 | 152 | // Safe titles |
149 | 153 | $user = Title::makeTitle( NS_USER, $relationship['user_name'] ); |
150 | | - $add_relationship_link = SpecialPage::getTitleFor( 'AddRelationship' ); |
151 | | - $remove_relationship_link = SpecialPage::getTitleFor( 'RemoveRelationship' ); |
152 | | - $give_gift_link = SpecialPage::getTitleFor( 'GiveGift' ); |
| 154 | + $addRelationshipLink = SpecialPage::getTitleFor( 'AddRelationship' ); |
| 155 | + $removeRelationshipLink = SpecialPage::getTitleFor( 'RemoveRelationship' ); |
| 156 | + $giveGiftLink = SpecialPage::getTitleFor( 'GiveGift' ); |
153 | 157 | |
154 | 158 | $avatar = new wAvatar( $relationship['user_id'], 'ml' ); |
155 | 159 | |
— | — | @@ -160,7 +164,8 @@ |
161 | 165 | $username_space = stripos( $relationship['user_name'], ' ' ); |
162 | 166 | |
163 | 167 | if ( ( $username_space == false || $username_space >= "30" ) && $username_length > 30 ) { |
164 | | - $user_name_display = substr( $relationship['user_name'], 0, 30 ) . ' ' . substr( $relationship['user_name'], 30, 50 ); |
| 168 | + $user_name_display = substr( $relationship['user_name'], 0, 30 ) . |
| 169 | + ' ' . substr( $relationship['user_name'], 30, 50 ); |
165 | 170 | } else { |
166 | 171 | $user_name_display = $relationship['user_name']; |
167 | 172 | } |
— | — | @@ -174,15 +179,15 @@ |
175 | 180 | <div class=\"relationship-actions\">"; |
176 | 181 | if ( $indivRelationship == false ) { |
177 | 182 | $output .= $wgLang->pipeList( array( |
178 | | - '<a href="' . $add_relationship_link->escapeFullURL( 'user=' . $user_safe . '&rel_type=1' ) . '">' . wfMsg( 'ur-add-friend' ) . '</a>', |
179 | | - '<a href="' . $add_relationship_link->escapeFullURL( 'user=' . $user_safe . '&rel_type=2' ) . '">' . wfMsg( 'ur-add-foe' ) . '</a>', |
| 183 | + '<a href="' . $addRelationshipLink->escapeFullURL( 'user=' . $user_safe . '&rel_type=1' ) . '">' . wfMsg( 'ur-add-friend' ) . '</a>', |
| 184 | + '<a href="' . $addRelationshipLink->escapeFullURL( 'user=' . $user_safe . '&rel_type=2' ) . '">' . wfMsg( 'ur-add-foe' ) . '</a>', |
180 | 185 | '' |
181 | 186 | ) ); |
182 | 187 | } elseif ( $user_name == $wgUser->getName() ) { |
183 | | - $output .= '<a href="' . $remove_relationship_link->escapeFullURL( 'user=' . $user_safe ) . '">' . $rem . '</a>'; |
| 188 | + $output .= '<a href="' . $removeRelationshipLink->escapeFullURL( 'user=' . $user_safe ) . '">' . $rem . '</a>'; |
184 | 189 | $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' ); |
185 | 190 | } |
186 | | - $output .= '<a href="' . $give_gift_link->escapeFullURL( 'user=' . $user_safe ) . '">' . wfMsg( 'ur-give-gift' ) . '</a>'; |
| 191 | + $output .= '<a href="' . $giveGiftLink->escapeFullURL( 'user=' . $user_safe ) . '">' . wfMsg( 'ur-give-gift' ) . '</a>'; |
187 | 192 | |
188 | 193 | $output .= '</div> |
189 | 194 | <div class="cleared"></div> |
— | — | @@ -202,12 +207,12 @@ |
203 | 208 | $total = intval( str_replace( ',', '', $total ) ); |
204 | 209 | $numofpages = $total / $per_page; |
205 | 210 | |
206 | | - $page_link = SpecialPage::getTitleFor( 'ViewRelationships' ); |
| 211 | + $pageLink = SpecialPage::getTitleFor( 'ViewRelationships' ); |
207 | 212 | |
208 | 213 | if ( $numofpages > 1 ) { |
209 | 214 | $output .= '<div class="page-nav">'; |
210 | 215 | if ( $page > 1 ) { |
211 | | - $output .= '<a href="' . $page_link->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . ( $page - 1 ) ) . '">' . wfMsg( 'ur-previous' ) . '</a> '; |
| 216 | + $output .= '<a href="' . $pageLink->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . ( $page - 1 ) ) . '">' . wfMsg( 'ur-previous' ) . '</a> '; |
212 | 217 | } |
213 | 218 | |
214 | 219 | if ( ( $total % $per_page ) != 0 ) { |
— | — | @@ -224,19 +229,16 @@ |
225 | 230 | if ( $i == $page ) { |
226 | 231 | $output .= ( $i . ' ' ); |
227 | 232 | } else { |
228 | | - $output .= '<a href="' . $page_link->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . $i ) . "\">$i</a> "; |
| 233 | + $output .= '<a href="' . $pageLink->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . $i ) . "\">$i</a> "; |
229 | 234 | } |
230 | 235 | } |
231 | 236 | |
232 | 237 | if ( ( $total - ( $per_page * $page ) ) > 0 ) { |
233 | | - $output .= ' <a href="' . $page_link->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . ( $page + 1 ) ) . '">' . wfMsg( 'ur-next' ) . '</a>'; |
| 238 | + $output .= ' <a href="' . $pageLink->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . ( $page + 1 ) ) . '">' . wfMsg( 'ur-next' ) . '</a>'; |
234 | 239 | } |
235 | 240 | $output .= '</div>'; |
236 | 241 | } |
237 | 242 | |
238 | | - /** |
239 | | - * Build next/prev nav |
240 | | - */ |
241 | 243 | $wgOut->addHTML( $output ); |
242 | 244 | } |
243 | 245 | } |