Robert Vogel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395800 )

Change subject: Add option to set source attribute for PDF export
......................................................................

Add option to set source attribute for PDF export

When file is retrieved to be exported in PDF, only its "src" attribute is
evaluated. This works perfectly for images, but in case of PDF (and
other) attachements, it wont work.
Added option where caller can set which attribute to look as a source
attribute

Change-Id: I8de7fbf37e7fd71d446e4607ca40786425cb75df
ERM: #8100
---
M UEModulePDF/includes/PDFFileResolver.php
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/00/395800/1

diff --git a/UEModulePDF/includes/PDFFileResolver.php 
b/UEModulePDF/includes/PDFFileResolver.php
index 55a13ac..63631aa 100644
--- a/UEModulePDF/includes/PDFFileResolver.php
+++ b/UEModulePDF/includes/PDFFileResolver.php
@@ -15,6 +15,11 @@
        /**
         * @var string
         */
+       protected $sSourceAttribute;
+
+       /**
+        * @var string
+        */
        protected $sFileName = '';
 
        /**
@@ -46,9 +51,10 @@
         *
         * @param DOMElement $imgEl
         */
-       public function __construct ( $oImgEl, $sWebrootFileSystemPath ) {
+       public function __construct ( $oImgEl, $sWebrootFileSystemPath, 
$sSourceAttribute = 'src' ) {
                $this->oImgNode= $oImgEl;
                $this->sWebrootFileSystemPath = $sWebrootFileSystemPath;
+               $this->sSourceAttribute = $sSourceAttribute;
 
                $this->init();
        }
@@ -72,7 +78,7 @@
                        $wgScriptPath
                );
 
-               $sOrigUrl = $this->oImgNode->getAttribute( 'src' );
+               $sOrigUrl = $this->oImgNode->getAttribute( 
$this->sSourceAttribute );
                if( strpos( $sOrigUrl, '?' ) ) {
                        $sOrigUrl = substr( $sOrigUrl, 0, strpos( $sOrigUrl, 
'?'  ) );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8de7fbf37e7fd71d446e4607ca40786425cb75df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27_dev
Gerrit-Owner: Robert Vogel <vo...@hallowelt.biz>
Gerrit-Reviewer: ItSpiderman <d.savulje...@gmail.com>

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

Reply via email to