Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki-CVS
SVN: [39816] trunk/extensions/FlaggedRevs/FlaggedArticle.php
 

Index | Next | Previous | View Flat


aaron at svn

Aug 22, 2008, 2:24 AM


Views: 144
Permalink
SVN: [39816] trunk/extensions/FlaggedRevs/FlaggedArticle.php

Revision: 39816
Author: aaron
Date: 2008-08-22 09:24:24 +0000 (Fri, 22 Aug 2008)

Log Message:
-----------
* Keep, but hide form in certain cases per bug 15249
* Fix doc
* Whitespace

Modified Paths:
--------------
trunk/extensions/FlaggedRevs/FlaggedArticle.php

Modified: trunk/extensions/FlaggedRevs/FlaggedArticle.php
===================================================================
--- trunk/extensions/FlaggedRevs/FlaggedArticle.php 2008-08-22 08:55:43 UTC (rev 39815)
+++ trunk/extensions/FlaggedRevs/FlaggedArticle.php 2008-08-22 09:24:24 UTC (rev 39816)
@@ -670,13 +670,9 @@
if( ($action !='view' && $action !='purge') || !$this->parent->getTitle()->quickUserCan('edit') ) {
return true;
}
- # Avoid some mistakes by people thinking this is the diff to stable
- if( $wgRequest->getVal( 'diff') && !$this->isDiffFromStable ) {
- return true;
- }
# User must have review rights
if( $wgUser->isAllowed( 'review' ) ) {
- $this->addQuickReview( $data, $this->isDiffFromStable );
+ $this->addQuickReview( $data, (bool)$wgRequest->getVal( 'diff'), !$this->getStableRev() );
}
return true;
}
@@ -914,7 +910,6 @@
if( !FlaggedRevs::allowComments() || !$frev || !$frev->getComment() ) {
return '';
}
-
$notes = "<br/><div class='flaggedrevs_notes plainlinks'>";
$notes .= wfMsgExt('revreview-note', array('parseinline'), User::whoIs( $frev->getUser() ) );
$notes .= '<br/><i>' . $wgUser->getSkin()->formatComment( $frev->getComment() ) . '</i></div>';
@@ -1294,11 +1289,12 @@

/**
* Adds a brief review form to a page.
- * @param OutputPage $out
- * @param Title $title
+ * @param string $data
+ * @param bool $top
+ * @param bool hide
* @param bool $top, should this form always go on top?
*/
- public function addQuickReview( &$data, $top = false ) {
+ public function addQuickReview( &$data, $top = false, $hide = false ) {
global $wgOut, $wgUser, $wgRequest;
# Revision being displayed
$id = $wgOut->getRevisionId();
@@ -1337,7 +1333,12 @@

$reviewTitle = SpecialPage::getTitleFor( 'RevisionReview' );
$action = $reviewTitle->getLocalUrl( 'action=submit' );
- $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'mw-reviewform' ) );
+ $params = array( 'method' => 'post', 'action' => $action, 'id' => 'mw-reviewform' );
+ if( $hide ) {
+ $params['style'] = 'display: none;';
+ $params['id'] = 'mw-hiddenreviewform';
+ }
+ $form = Xml::openElement( 'form', $params );
$form .= Xml::openElement( 'fieldset', array('class' => 'flaggedrevs_reviewform noprint') );
$form .= "<legend><strong>" . wfMsgHtml( 'revreview-flag', $id ) . "</strong></legend>\n";

@@ -1474,7 +1475,7 @@
);
$form .= Xml::closeElement( 'span' );

- $form .= Xml::closeElement( 'div' );
+ $form .= Xml::closeElement( 'div' ) . "\n";

# Hidden params
$form .= Xml::hidden( 'title', $reviewTitle->getPrefixedText() ) . "\n";



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Subject User Time
SVN: [39816] trunk/extensions/FlaggedRevs/FlaggedArticle.php aaron at svn Aug 22, 2008, 2:24 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.