[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27_dev]: PageContentProvider: Add additional wrapper classes

2017-12-10 Thread Robert Vogel (Code Review)
Robert Vogel has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/395959 )

Change subject: PageContentProvider: Add additional wrapper classes
..


PageContentProvider: Add additional wrapper classes

Allows better CSS styling in PDF Export.
This is required for ERM8101.

NEEDS CHERRY-PICK TO REL1_27 AND REL1_27_dev

Change-Id: I50614d7fde1a17391baac1330287e9e5ebaed791
---
M includes/utility/PageContentProvider.class.php
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved



diff --git a/includes/utility/PageContentProvider.class.php 
b/includes/utility/PageContentProvider.class.php
index d2d3ff3..f8951c6 100644
--- a/includes/utility/PageContentProvider.class.php
+++ b/includes/utility/PageContentProvider.class.php
@@ -26,7 +26,7 @@
 
//Default Template
$sTemplate = array();
-   $sTemplate[] = '';
+   $sTemplate[] = '';
$sTemplate[] = ''; //jump-anchor
$sTemplate[] = '%s';
$sTemplate[] = '';
@@ -349,6 +349,7 @@
if( $this->bEncapsulateContent ) {
$sHTML = sprintf(
$this->getTemplate(),
+   $this->getWrapperAttributes( $oTitle ),
'bs-ue-jumpmark-'.
md5( 
$oTitle->getPrefixedText().$aParams['oldid'] ),
empty( $sTitle ) ? $oTitle->getPrefixedText( ) 
: $sTitle,
@@ -364,6 +365,15 @@
}
 
/**
+   * @param \Title $oTitle
+   * @return string
+   */
+   protected function getWrapperAttributes( $oTitle ) {
+   $cssClass = Sanitizer::escapeClass( 
'page-'.$oTitle->getPrefixedDBKey() );
+   return "class=\"bs-page-content $cssClass\"";
+   }
+
+   /**
 * This method returns the WikiText of a Wiki page as seen in the edit 
view. Currently, it supports Title objects of normal Articles.
 * @param Title $oTitle The MediaWiki Title object from which the html 
output should be extracted
 * @param Array $aParams Contains processing information, like the 
requested revision id (oldid) and wether to follow redirects or not.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I50614d7fde1a17391baac1330287e9e5ebaed791
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27_dev
Gerrit-Owner: Pwirth 
Gerrit-Reviewer: Ljonka 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Robert Vogel 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27_dev]: PageContentProvider: Add additional wrapper classes

2017-12-07 Thread Pwirth (Code Review)
Pwirth has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395959 )

Change subject: PageContentProvider: Add additional wrapper classes
..

PageContentProvider: Add additional wrapper classes

Allows better CSS styling in PDF Export.
This is required for ERM8101.

NEEDS CHERRY-PICK TO REL1_27 AND REL1_27_dev

Change-Id: I50614d7fde1a17391baac1330287e9e5ebaed791
---
M includes/utility/PageContentProvider.class.php
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/59/395959/1

diff --git a/includes/utility/PageContentProvider.class.php 
b/includes/utility/PageContentProvider.class.php
index d2d3ff3..f8951c6 100644
--- a/includes/utility/PageContentProvider.class.php
+++ b/includes/utility/PageContentProvider.class.php
@@ -26,7 +26,7 @@
 
//Default Template
$sTemplate = array();
-   $sTemplate[] = '';
+   $sTemplate[] = '';
$sTemplate[] = ''; //jump-anchor
$sTemplate[] = '%s';
$sTemplate[] = '';
@@ -349,6 +349,7 @@
if( $this->bEncapsulateContent ) {
$sHTML = sprintf(
$this->getTemplate(),
+   $this->getWrapperAttributes( $oTitle ),
'bs-ue-jumpmark-'.
md5( 
$oTitle->getPrefixedText().$aParams['oldid'] ),
empty( $sTitle ) ? $oTitle->getPrefixedText( ) 
: $sTitle,
@@ -364,6 +365,15 @@
}
 
/**
+   * @param \Title $oTitle
+   * @return string
+   */
+   protected function getWrapperAttributes( $oTitle ) {
+   $cssClass = Sanitizer::escapeClass( 
'page-'.$oTitle->getPrefixedDBKey() );
+   return "class=\"bs-page-content $cssClass\"";
+   }
+
+   /**
 * This method returns the WikiText of a Wiki page as seen in the edit 
view. Currently, it supports Title objects of normal Articles.
 * @param Title $oTitle The MediaWiki Title object from which the html 
output should be extracted
 * @param Array $aParams Contains processing information, like the 
requested revision id (oldid) and wether to follow redirects or not.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50614d7fde1a17391baac1330287e9e5ebaed791
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27_dev
Gerrit-Owner: Pwirth 
Gerrit-Reviewer: Robert Vogel 

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