Dan-nl has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132983

Change subject: no wikitext comments
......................................................................

no wikitext comments

* removed the comments from the appropriate methods
* re-arranged the separation between the wikitext sections
Bug 64634

Change-Id: I700b4e398448177016a06cf2fc3caa3f6c90a633
---
M includes/Handlers/UploadHandler.php
M includes/Models/MediawikiTemplate.php
2 files changed, 10 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset 
refs/changes/83/132983/1

diff --git a/includes/Handlers/UploadHandler.php 
b/includes/Handlers/UploadHandler.php
index f9f1656..f13021e 100644
--- a/includes/Handlers/UploadHandler.php
+++ b/includes/Handlers/UploadHandler.php
@@ -138,15 +138,14 @@
         */
        protected function addMetadata() {
                return
-                       PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL .
-                       '<!-- Metadata Mapped -->' . PHP_EOL .
                        '<!-- <metadata_mapped_json>' .
                        json_encode( 
$this->_MediawikiTemplate->mediawiki_template_array ) .
-                       '</metadata_mapped_json> -->' . PHP_EOL . PHP_EOL .
-                       '<!-- Metadata Raw -->' . PHP_EOL .
+                       '</metadata_mapped_json> -->' .
+                       PHP_EOL . PHP_EOL .
                        '<!-- <metadata_raw>' . PHP_EOL .
                        htmlspecialchars( 
$this->_MediawikiTemplate->metadata_raw, ENT_QUOTES, 'UTF-8' ) . PHP_EOL .
-                       '</metadata_raw> -->' . PHP_EOL;
+                       '</metadata_raw> -->' .
+                       PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL;
        }
 
        /**
@@ -158,7 +157,7 @@
         * sanitized
         */
        protected function addGlobalCategories() {
-               $result = null;
+               $result = '';
 
                $this->setGlobalCategories();
                $categories = $this->_global_categories;
@@ -166,13 +165,6 @@
                if ( empty( $categories ) ) {
                        return $result;
                }
-
-               $result =
-                       PHP_EOL . PHP_EOL .
-                       '<!-- ' .
-                       wfMessage( 'gwtoolset-global-categories' )->escaped() .
-                       ' -->' .
-                       PHP_EOL;
 
                foreach ( $categories as $category ) {
                        $result .=
@@ -200,7 +192,7 @@
         * sanitized
         */
        protected function addItemSpecificCategories() {
-               $result = null;
+               $result = '';
 
                $this->setItemSpecificCategories();
                $categories = $this->_item_specific_categories;
@@ -208,13 +200,6 @@
                if ( empty( $categories ) ) {
                        return $result;
                }
-
-               $result =
-                       PHP_EOL . PHP_EOL .
-                       '<!-- ' .
-                       wfMessage( 'gwtoolset-specific-categories' )->escaped() 
.
-                       ' -->' .
-                       PHP_EOL;
 
                foreach( $categories as $category ) {
                        $result .= '[[' .
@@ -429,10 +414,8 @@
                return
                        '=={{int:filedesc}}==' . PHP_EOL . PHP_EOL .
                        $this->_MediawikiTemplate->getTemplateAsWikiText( 
$this->user_options ) .
-                       PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL .
                        
$this->_MediawikiTemplate->getGWToolsetTemplateAsWikiText() .
                        $this->addMetadata() .
-                       PHP_EOL . PHP_EOL .
                        $this->addGlobalCategories() .
                        $this->addItemSpecificCategories();
        }
diff --git a/includes/Models/MediawikiTemplate.php 
b/includes/Models/MediawikiTemplate.php
index 06062c3..f6d783d 100644
--- a/includes/Models/MediawikiTemplate.php
+++ b/includes/Models/MediawikiTemplate.php
@@ -150,7 +150,6 @@
         */
        public function getGWToolsetTemplateAsWikiText() {
                return
-                       '<!-- GWToolset Template -->' . PHP_EOL .
                        '{{Uploaded with GWToolset' . PHP_EOL .
                        ' | gwtoolset-title-identifier = ' .
                                        Utils::sanitizeString(
@@ -160,9 +159,8 @@
                                        Utils::sanitizeString(
                                                
$this->mediawiki_template_array['gwtoolset-url-to-the-media-file']
                                        ) . PHP_EOL .
-                       '}}'
-               ;
-
+                       '}}' .
+                       PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL;
        }
 
        /**
@@ -183,7 +181,7 @@
         * the resulting wiki text is filtered
         */
        public function getTemplateAsWikiText( array &$user_options ) {
-               $result = '<!-- Mediawiki Template -->' . PHP_EOL;
+               $result = '';
                $sections = null;
                $template = '{{' . $this->mediawiki_template_name . PHP_EOL . 
'%s}}';
 
@@ -327,6 +325,7 @@
                }
 
                $result .= sprintf( $template, $sections );
+               $result .= PHP_EOL . PHP_EOL;
 
                return $result;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/132983
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I700b4e398448177016a06cf2fc3caa3f6c90a633
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Dan-nl <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to