Tweaked r49408: Improved hiding and changed 1 revision case handling
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 16 Apr 2009 04:51:43 +0000 (04:51 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 16 Apr 2009 04:51:43 +0000 (04:51 +0000)
includes/DefaultSettings.php
includes/LogPage.php
includes/PageHistory.php
skins/common/history.js

index 86d855c..b8f4426 100644 (file)
@@ -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:
index 9faff81..0cf8e3c 100644 (file)
@@ -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
index 11d025e..d33530c 100644 (file)
@@ -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,
index 599a3ee..64754fe 100644 (file)
@@ -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();