Index: trunk/phase3/includes/SkinPHPTal.php |
— | — | @@ -97,12 +97,17 @@ |
98 | 98 | $tpl->setRef( "userpage", &$this->userpage); |
99 | 99 | $tpl->set( "sysop", $wgUser->isSysop() ); |
100 | 100 | if( $wgUser->getNewtalk() ) { |
101 | | - $ntl = wfMsg( "newmessages", |
102 | | - $this->makeKnownLink( |
103 | | - $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) ) |
104 | | - . ":" . $wgUser->getName(), |
105 | | - wfMsg("newmessageslink") ) |
106 | | - ); |
| 101 | + $usertitle = Title::newFromText( $this->userpage ); |
| 102 | + $usertalktitle = $usertitle->getTalkPage(); |
| 103 | + if($usertalktitle->getPrefixedDbKey() != $this->thispage){ |
| 104 | + |
| 105 | + $ntl = wfMsg( "newmessages", |
| 106 | + $this->makeKnownLink( |
| 107 | + $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) ) |
| 108 | + . ":" . $wgUser->getName(), |
| 109 | + wfMsg("newmessageslink") ) |
| 110 | + ); |
| 111 | + } |
107 | 112 | } else { |
108 | 113 | $ntl = ""; |
109 | 114 | } |
— | — | @@ -200,21 +205,31 @@ |
201 | 206 | 'ttip' => wfMsg('tooltip-article'), |
202 | 207 | 'akey' => wfMsg('accesskey-article')); |
203 | 208 | |
204 | | - $content_actions['talk'] = array('class' => (Namespace::isTalk( $wgTitle->getNamespace()) ? 'selected' : ''), |
205 | | - 'text' => wfMsg('talk'), |
206 | | - 'href' => $this->makeTalkUrl($this->titletxt), |
207 | | - 'ttip' => wfMsg('tooltip-talk'), |
208 | | - 'akey' => wfMsg('accesskey-talk')); |
| 209 | + /* set up the classes for the talk link */ |
| 210 | + $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ? 'selected' : ''); |
| 211 | + $talktitle = Title::newFromText( $this->titletxt ); |
| 212 | + $talktitle = $talktitle->getTalkPage(); |
| 213 | + $this->checkTitle(&$title, &$name); |
| 214 | + $talk_class .= ($talktitle->getArticleId() != 0 ? '':' new'); |
| 215 | + $content_actions['talk'] = array( |
| 216 | + 'class' => $talk_class, |
| 217 | + 'text' => wfMsg('talk'), |
| 218 | + 'href' => $this->makeTalkUrl($this->titletxt), |
| 219 | + 'ttip' => wfMsg('tooltip-talk'), |
| 220 | + 'akey' => wfMsg('accesskey-talk') |
| 221 | + ); |
209 | 222 | |
210 | 223 | if ( $wgTitle->userCanEdit() ) { |
211 | 224 | if ( $oldid && ! isset( $diff ) ) { |
212 | 225 | $oid = "&oldid={$oldid}"; |
213 | 226 | } |
214 | | - $content_actions['edit'] = array('class' => ($action == 'edit' or $action == 'submit') ? 'selected' : '', |
215 | | - 'text' => wfMsg('edit'), |
216 | | - 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid), |
217 | | - 'ttip' => wfMsg('tooltip-edit'), |
218 | | - 'akey' => wfMsg('accesskey-edit')); |
| 227 | + $content_actions['edit'] = array( |
| 228 | + 'class' => ($action == 'edit' or $action == 'submit') ? 'selected' : '', |
| 229 | + 'text' => wfMsg('edit'), |
| 230 | + 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid), |
| 231 | + 'ttip' => wfMsg('tooltip-edit'), |
| 232 | + 'akey' => wfMsg('accesskey-edit') |
| 233 | + ); |
219 | 234 | } else { |
220 | 235 | if ( $oldid && ! isset( $diff ) ) { |
221 | 236 | $oid = "&oldid={$oldid}"; |
— | — | @@ -320,7 +335,7 @@ |
321 | 336 | $action = $wgRequest->getText( 'action' ); |
322 | 337 | $oldid = $wgRequest->getVal( 'oldid' ); |
323 | 338 | $diff = $wgRequest->getVal( 'diff' ); |
324 | | - |
| 339 | + // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes |
325 | 340 | $nav_urls = array(); |
326 | 341 | $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage'))); |
327 | 342 | $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage'))); |