r49554 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49553‎ | r49554 | r49555 >
Date:04:51, 16 April 2009
Author:aaron
Status:ok
Tags:
Comment:
Tweaked r49408: Improved hiding and changed 1 revision case handling
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)
  • /trunk/phase3/skins/common/history.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/history.js
@@ -87,9 +87,7 @@
8888 // Attach event handlers to the input elements on history page
8989 function histrowinit() {
9090 var hf = document.getElementById('pagehistory');
91 - if (!hf) {
92 - return;
93 - }
 91+ if (!hf) return;
9492 var df = document.getElementById('mw-history-revdeleteform');
9593 if( df ) df.style.visibility = 'visible'; // Enable JS form
9694 var lis = hf.getElementsByTagName('li');
@@ -101,7 +99,7 @@
102100 }
103101 var check = deleteCheck(lis[i]);
104102 if( df && check ) {
105 - check.style.visibility = 'visible'; // Enable JS form
 103+ check.style.display = 'inline'; // Enable JS form
106104 }
107105 }
108106 diffcheck();
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1477,7 +1477,7 @@
14781478 * to ensure that client-side caches don't keep obsolete copies of global
14791479 * styles.
14801480 */
1481 -$wgStyleVersion = '211';
 1481+$wgStyleVersion = '212';
14821482
14831483
14841484 # Server-side caching:
Index: trunk/phase3/includes/PageHistory.php
@@ -156,7 +156,7 @@
157157 global $wgUser, $wgScript, $wgEnableHtmlDiff;
158158 $this->lastdate = '';
159159 $s = wfMsgExt( 'histlegend', array( 'parse') );
160 - if( $wgUser->isAllowed('deleterevision') ) {
 160+ if( $this->linesonpage > 1 && $wgUser->isAllowed('deleterevision') ) {
161161 $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
162162 $s .= Xml::openElement( 'form',
163163 array(
@@ -284,7 +284,7 @@
285285
286286 if( $wgUser->isAllowed( 'deleterevision' ) ) {
287287 // Hide JS by default for non-JS browsing
288 - $hidden = array( 'style' => 'visibility:hidden' );
 288+ $hidden = array( 'style' => 'display:none' );
289289 // If revision was hidden from sysops
290290 if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
291291 $del = Xml::check( 'deleterevisions', false,
Index: trunk/phase3/includes/LogPage.php
@@ -91,7 +91,7 @@
9292 $this->type, $this->action, $this->target, $this->comment, $this->params, $newId );
9393 $rc->notifyRC2UDP();
9494 }
95 - return true;
 95+ return $newId;
9696 }
9797
9898 /**
@@ -358,6 +358,16 @@
359359
360360 return $this->saveContent();
361361 }
 362+
 363+ public function addRelations( $field, $values, $logid ) {
 364+ $data = array();
 365+ foreach( $values as $value ) {
 366+ $data[] = array('ls_field' => $field,'ls_value' => $value,'ls_log_id' => $logid);
 367+ }
 368+ $dbw = wfGetDB( DB_MASTER );
 369+ $dbw->insert( 'log_search', $data, __METHOD__ );
 370+ return true;
 371+ }
362372
363373 /**
364374 * Create a blob from a parameter array

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49408(bug 16607) Added convenience checkboxes for revisiondelete to history pagesaaron17:38, 11 April 2009

Status & tagging log