Tpt has uploaded a new change for review.

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


Change subject: Use default header and footer defined in system messages
......................................................................

Use default header and footer defined in system messages

Bug 57978

Change-Id: Idd8a7c7c07eeb60f9c6275b65cccb4a72c6327b8
---
M includes/index/ProofreadIndexPage.php
1 file changed, 17 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/12/99412/1

diff --git a/includes/index/ProofreadIndexPage.php 
b/includes/index/ProofreadIndexPage.php
index a0304a3..9eac5b8 100644
--- a/includes/index/ProofreadIndexPage.php
+++ b/includes/index/ProofreadIndexPage.php
@@ -131,7 +131,7 @@
                        }
                } else {
                        $attributes = explode( "\n", wfMessage( 
'proofreadpage_index_attributes' )->inContentLanguage()->text() );
-                       $indexAttributes = explode( ' ', wfMessage( 
'proofreadpage_js_attributes' )->inContentLanguage()->text() );
+                       $headerAttributes = explode( ' ', wfMessage( 
'proofreadpage_js_attributes' )->inContentLanguage()->text() );
                        $config = array();
                        foreach( $attributes as $attribute ) {
                                $m = explode( '|', $attribute );
@@ -160,7 +160,7 @@
                                $config[$m[0]] = $params;
                        }
 
-                       foreach( $indexAttributes as $attribute ) {
+                       foreach( $headerAttributes as $attribute ) {
                                if ( isset( $config[$attribute] ) ) {
                                        $config[$attribute]['header'] = true;
                                } else {
@@ -177,6 +177,21 @@
                        }
                }
 
+               if( !array_key_exists( 'Header', $config ) ) {
+                       $config['Header'] = array(
+                               'default' => wfMessage( 
'proofreadpage_default_header' )->inContentLanguage()->plain(),
+                               'header' => true,
+                               'hidden' => true
+                       );
+               }
+               if( !array_key_exists( 'Footer', $config ) ) {
+                       $config['Footer'] = array(
+                               'default' => wfMessage( 
'proofreadpage_default_footer' )->inContentLanguage()->plain(),
+                               'header' => true,
+                               'hidden' => true
+                       );
+               }
+
                return $config;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd8a7c7c07eeb60f9c6275b65cccb4a72c6327b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Tpt <thoma...@hotmail.fr>

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

Reply via email to