r3008 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r3007‎ | r3008 | r3009 >
Date:14:27, 7 April 2004
Author:gabrielwicke
Status:old
Tags:
Comment:
* talk notice not displayed on talk page
* comment re htmlspecialchars
Modified paths:
  • /trunk/phase3/includes/SkinPHPTal.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SkinPHPTal.php
@@ -97,12 +97,17 @@
9898 $tpl->setRef( "userpage", &$this->userpage);
9999 $tpl->set( "sysop", $wgUser->isSysop() );
100100 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+ }
107112 } else {
108113 $ntl = "";
109114 }
@@ -200,21 +205,31 @@
201206 'ttip' => wfMsg('tooltip-article'),
202207 'akey' => wfMsg('accesskey-article'));
203208
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+ );
209222
210223 if ( $wgTitle->userCanEdit() ) {
211224 if ( $oldid && ! isset( $diff ) ) {
212225 $oid = "&oldid={$oldid}";
213226 }
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+ );
219234 } else {
220235 if ( $oldid && ! isset( $diff ) ) {
221236 $oid = "&oldid={$oldid}";
@@ -320,7 +335,7 @@
321336 $action = $wgRequest->getText( 'action' );
322337 $oldid = $wgRequest->getVal( 'oldid' );
323338 $diff = $wgRequest->getVal( 'diff' );
324 -
 339+ // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes
325340 $nav_urls = array();
326341 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
327342 $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage')));

Status & tagging log