Sumit has uploaded a new change for review.

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

Change subject: WikidataPageBanner improve documentation
......................................................................

WikidataPageBanner improve documentation

Improve the description of functions in WikidataPageBanner.hooks.php

Change-Id: I8257914b86f07d4bb51ffba4d6ede60055aa3f57
---
M includes/WikidataPageBanner.hooks.php
1 file changed, 10 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikidataPageBanner 
refs/changes/54/227254/1

diff --git a/includes/WikidataPageBanner.hooks.php 
b/includes/WikidataPageBanner.hooks.php
index dea3058..e5980ad 100644
--- a/includes/WikidataPageBanner.hooks.php
+++ b/includes/WikidataPageBanner.hooks.php
@@ -2,7 +2,8 @@
 class WikidataPageBanner {
        /**
         * WikidataPageBanner::addBanner Generates banner from given options 
and adds it and its styles
-        * to Output Page
+        * to Output Page. If no options defined through {{PAGEBANNER}}, tries 
to add a wikidata banner
+        * or a default one.
         *
         * @param $out OutputPage
         * @param $skin Skin Object
@@ -69,6 +70,7 @@
        /**
         * WikidataPageBanner::onOutputPageParserOutput add banner parameters 
from ParserOutput to
         * Output page
+        *
         * @param  OutputPage $out
         * @param  ParserOutput $pOut
         */
@@ -87,19 +89,22 @@
                                if ( strpos( $options['toc'], 'class="toc"' ) 
!== false ) {
                                        $options['toc'] = str_replace( 
'class="toc"', '', $options['toc'] );
                                }
+                               // disable default TOC
                                $out->enableTOC( false );
                        }
+                       // set banner properties as an OutputPage property
                        $out->setProperty( 'wpb-banner-options', $options );
                }
        }
 
        /**
         * WikidataPageBanner::addCustomBanner
-        * Parser function hooked to 'PAGEBANNER' magic word, to expand and 
load banner.
+        * Parser function hooked to 'PAGEBANNER' magic word, to define a 
custom banner and options to
+        * customize banner such as icons,horizontal TOC,etc.
         *
         * @param  $parser Parser
         * @param  $bannername Name of custom banner
-        * @return output
+        * @return array
         */
        public static function addCustomBanner( $parser, $bannername ) {
                global $wgBannerNamespaces;
@@ -129,6 +134,7 @@
                        if ( isset( $argumentsFromParserFunction['tooltip'] ) ) 
{
                                $paramsForBannerTemplate['tooltip'] = 
$argumentsFromParserFunction['tooltip'];
                        }
+                       // set 'bottomtoc' parameter to allow TOC completely 
below the banner
                        if ( isset( $argumentsFromParserFunction['bottomtoc'] ) 
&&
                                        
$argumentsFromParserFunction['bottomtoc'] === 'yes' ) {
                                $paramsForBannerTemplate['bottomtoc'] = true;
@@ -251,7 +257,7 @@
        }
 
        /**
-        * Fetches banner from wikidata for the specified page
+        * WikidataPageBanner::getWikidataBanner Fetches banner from wikidata 
for the specified page
         *
         * @param   Title $title Title of the page
         * @return  String|null file name of the banner from wikitata 
[description]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8257914b86f07d4bb51ffba4d6ede60055aa3f57
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikidataPageBanner
Gerrit-Branch: master
Gerrit-Owner: Sumit <asthana.sumi...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to