r7855 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r7854‎ | r7855 | r7856 >
Date:13:13, 24 March 2005
Author:eloquence
Status:old
Tags:
Comment:
1) omit "N Image:Bla.jpg" entry from Recent Changes for file uploads
2) wikify page titles in log entries which appear in RC
Modified paths:
  • /trunk/phase3/includes/Image.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialLog.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Image.php
@@ -41,7 +41,8 @@
4242 */
4343 function Image( $name, $recache = false ) {
4444
45 - global $wgUseSharedUploads, $wgUseLatin1, $wgSharedLatin1, $wgLang, $wgMemc, $wgDBname;
 45+ global $wgUseSharedUploads, $wgUseLatin1, $wgSharedLatin1, $wgLang, $wgMemc, $wgDBname,
 46+ $wgSharedUploadDBname;
4647
4748 $this->name = $name;
4849 $this->title = Title::makeTitleSafe( NS_IMAGE, $this->name );
@@ -811,7 +812,7 @@
812813
813814 if ( $id == 0 ) {
814815 $article = new Article( $descTitle );
815 - $article->insertNewArticle( $textdesc, $desc, false, false );
 816+ $article->insertNewArticle( $textdesc, $desc, false, false, true );
816817 }
817818 } else {
818819 # Collision, this is an update of an image
Index: trunk/phase3/includes/SpecialLog.php
@@ -260,7 +260,7 @@
261261 $comment = $this->skin->commentBlock( $s->log_comment );
262262 $paramArray = LogPage::extractParams( $s->log_params );
263263
264 - $action = LogPage::actionText( $s->log_type, $s->log_action, $titleLink, $paramArray );
 264+ $action = LogPage::actionText( $s->log_type, $s->log_action, $titleLink, $paramArray, true );
265265 $out = "<li>$time $userLink $action $comment</li>\n";
266266 return $out;
267267 }
Index: trunk/phase3/includes/LogPage.php
@@ -141,7 +141,7 @@
142142 /**
143143 * @static
144144 */
145 - function actionText( $type, $action, $titleLink = NULL, $params = array() ) {
 145+ function actionText( $type, $action, $titleLink = NULL, $params = array(), $filterWikilinks=false ) {
146146 static $actions = array(
147147 'block/block' => 'blocklogentry',
148148 'block/unblock' => 'unblocklogentry',
@@ -158,17 +158,22 @@
159159 $key = "$type/$action";
160160 if( isset( $actions[$key] ) ) {
161161 if( is_null( $titleLink ) ) {
162 - return wfMsgForContent( $actions[$key] );
 162+ $rv=wfMsgForContent( $actions[$key] );
163163 } elseif ( count( $params ) == 0 ) {
164 - return wfMsgForContent( $actions[$key], $titleLink );
 164+ $rv=wfMsgForContent( $actions[$key], $titleLink );
165165 } else {
166166 array_unshift( $params, $titleLink );
167 - return wfMsgReal( $actions[$key], $params, true, true );
 167+ $rv=wfMsgReal( $actions[$key], $params, true, true );
168168 }
169169 } else {
170170 wfDebug( "LogPage::actionText - unknown action $key\n" );
171 - return "$action $titleLink";
 171+ $rv="$action $titleLink";
172172 }
 173+ if($filterWikilinks) {
 174+ $rv=str_replace("[[","",$rv);
 175+ $rv=str_replace("]]","",$rv);
 176+ }
 177+ return $rv;
173178 }
174179
175180 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r48004Document r7855werdna01:28, 4 March 2009

Status & tagging log