Merge "FormatJson: Skip whitespace cleanup when unnecessary"
[lhc/web/wiklou.git] / includes / specials / SpecialRevisiondelete.php
index 81463e5..4edf33c 100644 (file)
@@ -43,19 +43,19 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        /** @var string Edit token for securing image views against XSS */
        private $token;
 
-       /** @var Title object for target parameter */
+       /** @var Title Title object for target parameter */
        private $targetObj;
 
        /** @var string Deletion type, may be revision, archive, oldimage, filearchive, logging. */
        private $typeName;
 
-       /** @var array of checkbox specs (message, name, deletion bits) */
+       /** @var array Array of checkbox specs (message, name, deletion bits) */
        private $checks;
 
        /** @var array UI Labels about the current type */
        private $typeLabels;
 
-       /** @var RevDel_List object, storing the list of items to be deleted/undeleted */
+       /** @var RevDel_List RevDel_List object, storing the list of items to be deleted/undeleted */
        private $revDelList;
 
        /** @var bool Whether user is allowed to perform the action */
@@ -176,6 +176,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
                # Initialise checkboxes
                $this->checks = array(
+                       # Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name
                        array( $this->typeLabels['check-label'], 'wpHidePrimary',
                                RevisionDeleter::getRevdelConstant( $this->typeName )
                        ),
@@ -277,6 +278,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        /**
         * Show a deleted file version requested by the visitor.
         * TODO Mostly copied from Special:Undelete. Refactor.
+        * @param string $archiveName
         */
        protected function tryShowFile( $archiveName ) {
                $repo = RepoGroup::singleton()->getLocalRepo();
@@ -334,6 +336,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
        /**
         * Get the list object for this request
+        * @return RevDel_List
         */
        protected function getList() {
                if ( is_null( $this->revDelList ) ) {
@@ -352,6 +355,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        protected function showForm() {
                $userAllowed = true;
 
+               // Messages: revdelete-selected-text, revdelete-selected-file, logdelete-selected
                $this->getOutput()->wrapWikiMsg( "<strong>$1</strong>", array( $this->typeLabels['selected'],
                        $this->getLanguage()->formatNum( count( $this->ids ) ), $this->targetObj->getPrefixedText() ) );
 
@@ -449,6 +453,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * @todo FIXME: Wikimedia-specific policy text
         */
        protected function addUsageText() {
+               // Messages: revdelete-text-text, revdelete-text-file, logdelete-text
                $this->getOutput()->wrapWikiMsg( "<strong>$1</strong>\n$2", $this->typeLabels['text'], 'revdelete-text-others' );
                if ( $this->getUser()->isAllowed( 'suppressrevision' ) ) {
                        $this->getOutput()->addWikiMsg( 'revdelete-suppress-text' );
@@ -459,7 +464,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        }
 
        /**
-        * @return String: HTML
+        * @return string HTML
         */
        protected function buildCheckBoxes() {
                $html = '<table>';
@@ -472,6 +477,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                $bitfield = RevisionDeleter::extractBitfield( $this->extractBitParams(), $bitfield );
                        }
                        foreach ( $this->checks as $item ) {
+                               // Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name,
+                               // revdelete-hide-comment, revdelete-hide-user, revdelete-hide-restricted
                                list( $message, $name, $field ) = $item;
                                $innerHTML = Xml::checkLabel( $this->msg( $message )->text(), $name, $name, $bitfield & $field );
                                if ( $field == Revision::DELETED_RESTRICTED ) {
@@ -488,6 +495,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-set' )->escaped() . '</th>';
                        $html .= "<th></th></tr>\n";
                        foreach ( $this->checks as $item ) {
+                               // Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name,
+                               // revdelete-hide-comment, revdelete-hide-user, revdelete-hide-restricted
                                list( $message, $name, $field ) = $item;
                                // If there are several items, use third state by default...
                                if ( $this->submitClicked ) {
@@ -556,6 +565,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * Report that the submit operation succeeded
         */
        protected function success() {
+               // Messages: revdelete-success, logdelete-success
                $this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
                $this->getOutput()->wrapWikiMsg( "<span class=\"success\">\n$1\n</span>", $this->typeLabels['success'] );
                $this->wasSaved = true;
@@ -567,6 +577,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * Report that the submit operation failed
         */
        protected function failure( $status ) {
+               // Messages: revdelete-failure, logdelete-failure
                $this->getOutput()->setPageTitle( $this->msg( 'actionfailed' ) );
                $this->getOutput()->addWikiText( $status->getWikiText( $this->typeLabels['failure'] ) );
                $this->showForm();
@@ -596,9 +607,9 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
        /**
         * Do the write operations. Simple wrapper for RevDel_*List::setVisibility().
-        * @param $bitfield
-        * @param $reason
-        * @param $title
+        * @param int $bitfield
+        * @param string $reason
+        * @param Title $title
         * @return Status
         */
        protected function save( $bitfield, $reason, $title ) {