From 799911d7e58567ee4856cc0cdf53fcffc394d16b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 16 Apr 2009 04:51:43 +0000 Subject: [PATCH] Tweaked r49408: Improved hiding and changed 1 revision case handling --- includes/DefaultSettings.php | 2 +- includes/LogPage.php | 12 +++++++++++- includes/PageHistory.php | 4 ++-- skins/common/history.js | 6 ++---- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 86d855c503..b8f4426ffb 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1477,7 +1477,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '211'; +$wgStyleVersion = '212'; # Server-side caching: diff --git a/includes/LogPage.php b/includes/LogPage.php index 9faff8187a..0cf8e3c82d 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -91,7 +91,7 @@ class LogPage { $this->type, $this->action, $this->target, $this->comment, $this->params, $newId ); $rc->notifyRC2UDP(); } - return true; + return $newId; } /** @@ -358,6 +358,16 @@ class LogPage { return $this->saveContent(); } + + public function addRelations( $field, $values, $logid ) { + $data = array(); + foreach( $values as $value ) { + $data[] = array('ls_field' => $field,'ls_value' => $value,'ls_log_id' => $logid); + } + $dbw = wfGetDB( DB_MASTER ); + $dbw->insert( 'log_search', $data, __METHOD__ ); + return true; + } /** * Create a blob from a parameter array diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 11d025ee80..d33530cecc 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -156,7 +156,7 @@ class PageHistory { global $wgUser, $wgScript, $wgEnableHtmlDiff; $this->lastdate = ''; $s = wfMsgExt( 'histlegend', array( 'parse') ); - if( $wgUser->isAllowed('deleterevision') ) { + if( $this->linesonpage > 1 && $wgUser->isAllowed('deleterevision') ) { $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); $s .= Xml::openElement( 'form', array( @@ -284,7 +284,7 @@ class PageHistory { if( $wgUser->isAllowed( 'deleterevision' ) ) { // Hide JS by default for non-JS browsing - $hidden = array( 'style' => 'visibility:hidden' ); + $hidden = array( 'style' => 'display:none' ); // If revision was hidden from sysops if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { $del = Xml::check( 'deleterevisions', false, diff --git a/skins/common/history.js b/skins/common/history.js index 599a3ee11d..64754fee88 100644 --- a/skins/common/history.js +++ b/skins/common/history.js @@ -87,9 +87,7 @@ function diffcheck() { // Attach event handlers to the input elements on history page function histrowinit() { var hf = document.getElementById('pagehistory'); - if (!hf) { - return; - } + if (!hf) return; var df = document.getElementById('mw-history-revdeleteform'); if( df ) df.style.visibility = 'visible'; // Enable JS form var lis = hf.getElementsByTagName('li'); @@ -101,7 +99,7 @@ function histrowinit() { } var check = deleteCheck(lis[i]); if( df && check ) { - check.style.visibility = 'visible'; // Enable JS form + check.style.display = 'inline'; // Enable JS form } } diffcheck(); -- 2.20.1