r88361 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88360‎ | r88361 | r88362 >
Date:23:50, 17 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r88360
Modified paths:
  • /trunk/extensions/SemanticWatchlist/includes/SWL_ChangeSet.php (modified) (history)
  • /trunk/extensions/SemanticWatchlist/specials/SpecialSemanticWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticWatchlist/specials/SpecialSemanticWatchlist.php
@@ -65,6 +65,11 @@
6666 $this->displayWatchlist();
6767 }
6868
 69+ /**
 70+ * Displays the watchlist.
 71+ *
 72+ * @since 0.1
 73+ */
6974 protected function displayWatchlist() {
7075 global $wgOut, $wgLang;
7176
@@ -82,11 +87,11 @@
8388
8489 krsort( $changeSetsHTML );
8590
86 - foreach ( $changeSetsHTML as $daySets ) {
 91+ foreach ( $changeSetsHTML as $dayKey => $daySets ) {
8792 $wgOut->addHTML( HTML::element(
8893 'h4',
8994 array(),
90 - $wgLang->date( str_pad( $set->getTime(), 14, '0' ) )
 95+ $wgLang->date( str_pad( $dayKey, 14, '0' ) )
9196 ) );
9297
9398 $wgOut->addHTML( '<ul>' );
@@ -105,6 +110,8 @@
106111 * Gets a list of change sets belonging to any of the watchlist groups
107112 * watched by the user, newest first.
108113 *
 114+ * @since 0.1
 115+ *
109116 * @return array of SWLChangeSet
110117 */
111118 protected function getChangeSets() {
@@ -128,6 +135,15 @@
129136 return $changeSets;
130137 }
131138
 139+ /**
 140+ * Gets the HTML for a single change set (edit).
 141+ *
 142+ * @since 0.1
 143+ *
 144+ * @param SWLChangeSet $changeSet
 145+ *
 146+ * @return string
 147+ */
132148 protected function getChangeSetHTML( SWLChangeSet $changeSet ) {
133149 global $wgLang;
134150
@@ -147,7 +163,29 @@
148164 'a',
149165 array( 'href' => $changeSet->getTitle()->getLocalURL( 'action=history' ) ),
150166 wfMsg( 'hist' )
151 - ) . ')' .
 167+ ) . ') . . ' .
 168+ HTML::element(
 169+ 'a',
 170+ array( 'href' => $changeSet->getUser()->getUserPage()->getLocalURL() ),
 171+ $changeSet->getUser()->getName()
 172+ ) . ' (' .
 173+ HTML::element(
 174+ 'a',
 175+ array( 'href' => $changeSet->getUser()->getTalkPage()->getLocalURL() ),
 176+ wfMsg( 'talkpagelinktext' )
 177+ ) . ' | ' .
 178+ ( $changeSet->getUser()->isAnon() ? '' :
 179+ HTML::element(
 180+ 'a',
 181+ array( 'href' => SpecialPage::getTitleFor( 'Contributions', $changeSet->getUser()->getName() )->getLocalURL() ),
 182+ wfMsg( 'contribslink' )
 183+ ) . ' | '
 184+ ) .
 185+ HTML::element(
 186+ 'a',
 187+ array( 'href' => SpecialPage::getTitleFor( 'Block', $changeSet->getUser()->getName() )->getLocalURL() ),
 188+ wfMsg( 'blocklink' )
 189+ ) . ')' .
152190 '</p>'
153191 ;
154192
@@ -164,6 +202,14 @@
165203 return $html;
166204 }
167205
 206+ /**
 207+ * Returns the HTML for the changes to a single propety.
 208+ *
 209+ * @param SMWDIProperty $property
 210+ * @param array of SMWPropertyChange $changes
 211+ *
 212+ * @return string
 213+ */
168214 protected function getPropertyHTML( SMWDIProperty $property, array $changes ) {
169215 $html = '';
170216
Index: trunk/extensions/SemanticWatchlist/includes/SWL_ChangeSet.php
@@ -84,7 +84,7 @@
8585
8686 $changeSet = new SWLChangeSet(
8787 $changeSet,
88 - User::newFromName( $set->set_user_name ),
 88+ User::newFromName( $set->set_user_name, false ),
8989 $set->set_time,
9090 $set->set_id
9191 );
@@ -124,7 +124,7 @@
125125
126126 $changeSet = new SWLChangeSet(
127127 $changeSet,
128 - User::newFromName( $changeSetArray['user_name'] ),
 128+ User::newFromName( $changeSetArray['user_name'], false ),
129129 $changeSetArray['time'],
130130 $changeSetArray['id']
131131 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88360work on special:semanticwatchlistjeroendedauw23:09, 17 May 2011

Status & tagging log