r91806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91805‎ | r91806 | r91807 >
Date:19:46, 9 July 2011
Author:kaldari
Status:ok
Tags:
Comment:
adding links to campaign logs, tweaking log layout
Modified paths:
  • /trunk/extensions/CentralNotice/centralnotice.css (modified) (history)
  • /trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
@@ -94,7 +94,7 @@
9595 }
9696
9797 class CentralNoticeLogPager extends ReverseChronologicalPager {
98 - var $special;
 98+ var $viewPage, $special;
9999
100100 function __construct( $special ) {
101101 $this->special = $special;
@@ -103,6 +103,8 @@
104104 // Override paging defaults
105105 list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset( 20, '' );
106106 $this->mLimitsShown = array( 20, 50, 100 );
 107+
 108+ $this->viewPage = SpecialPage::getTitleFor( 'CentralNotice' );
107109 }
108110
109111 /**
@@ -133,10 +135,18 @@
134136 */
135137 function formatRow( $row ) {
136138 global $wgLang;
137 -
138 - // Create a user object so we can pull the name, user page link, etc.
 139+
 140+ // Create a user object so we can pull the name, user page, etc.
139141 $loggedUser = User::newFromId( $row->notlog_user_id );
140 -
 142+ // Create the user page link
 143+ $userLink = $this->getSkin()->makeLinkObj( $loggedUser->getUserPage(),
 144+ $loggedUser->getName() );
 145+
 146+ // Create the campaign link
 147+ $campaignLink = $this->getSkin()->makeLinkObj( $this->viewPage,
 148+ htmlspecialchars( $row->notlog_not_name ),
 149+ 'method=listNoticeDetail&notice=' . urlencode( $row->notlog_not_name ) );
 150+
141151 // Begin banner row
142152 $htmlOut = Xml::openElement( 'tr' );
143153
@@ -144,13 +154,13 @@
145155 $wgLang->date( $row->notlog_timestamp ) . ' ' . $wgLang->time( $row->notlog_timestamp )
146156 );
147157 $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ),
148 - $loggedUser->getName()
 158+ $userLink
149159 );
150160 $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ),
151161 $row->notlog_action
152162 );
153163 $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ),
154 - $row->notlog_not_name
 164+ $campaignLink
155165 );
156166
157167 // End banner row
@@ -164,7 +174,7 @@
165175 */
166176 function getStartBody() {
167177 $htmlOut = '';
168 - $htmlOut .= Xml::openElement( 'table', array( 'cellpadding' => 9 ) );
 178+ $htmlOut .= Xml::openElement( 'table', array( 'id' => 'cn-campaign-logs', 'cellpadding' => 4 ) );
169179 $htmlOut .= Xml::openElement( 'tr' );
170180 $htmlOut .= Xml::element( 'th', array( 'align' => 'left' ),
171181 wfMsg ( 'centralnotice-timestamp' )
Index: trunk/extensions/CentralNotice/centralnotice.css
@@ -57,6 +57,9 @@
5858 margin-left:1.6em;
5959 margin-right:1.6em;
6060 }
 61+#preferences table#cn-campaign-logs {
 62+ width: auto;
 63+}
6164
6265 /* Vector-specific definitions */
6366 body.skin-vector #preferences fieldset.prefsection {

Status & tagging log