Robert Vogel has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/395960 )
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: Looks good to me, approved
jenkins-bot: Verified
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[] = '<div class="bs-page-content">';
+ $sTemplate[] = '<div %s>';
$sTemplate[] = '<a name="%s"></a>'; //jump-anchor
$sTemplate[] = '<h1 class="firstHeading">%s</h1>';
$sTemplate[] = '<div class="bodyContent">';
@@ -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/395960
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
Gerrit-Owner: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits