Skip to content
Snippets Groups Projects
Commit 3f05cc96 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #73871 Plug filemanager to load xsl file

parent c4b39a79
Branches
Tags
5 merge requests!2660Master,!2616Dev#73871 minsoc xlst etape 2 association fichier xslt,!2601Dev#73871 minsoc xlst etape 2 association fichier xslt,!2597Dev#73871 minsoc xlst etape 2 association fichier xslt,!2589Dev#73871 minsoc xlst etape 2 association fichier xslt
Pipeline #3872 failed with stage
in 32 minutes and 21 seconds
......@@ -97,9 +97,8 @@ class Class_Notice_Xsl {
if(empty($settings))
return;
if(!array_key_exists(Class_Notice_Xsl::KEY, $settings))
return;
return $settings[Class_Notice_Xsl::KEY];
return array_key_exists(Class_Notice_Xsl::KEY, $settings)
? Class_FileManager::find($settings[Class_Notice_Xsl::KEY])
: null;
}
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ class ZendAfi_View_Helper_Notice_Xsl extends ZendAfi_View_Helper_BaseHelper {
return '';
$xsl_doc = new DOMDocument();
$xsl_doc->load($xsl_file);
$xsl_doc->load($xsl_file->getRealpath());
$xml = new DOMDocument();
$xml->load($marc_xml);
......@@ -38,12 +38,13 @@ class ZendAfi_View_Helper_Notice_Xsl extends ZendAfi_View_Helper_BaseHelper {
$xslt->importStylesheet($xsl_doc);
$response = $xslt->transformToXml($xml);
if(($errors = $xsl->getErrors()) || (!$response))
return $this->_tag('p', $this->_('La transformation du %s en HTML par le fichier %s n\'a pas fonctionné.',
$this->view->tagAnchor(Class_Url::absolute($marc_xml),
$this->_('marc-xml'),
['target' => 'blank']),
$this->view->tagAnchor(Class_Url::absolute($xsl_file),
$this->view->tagAnchor(Class_Url::absolute($xsl_file->getPath()),
$this->_('xsl'),
['target' => 'blank'])),
['class' => 'error'])
......
......@@ -113,9 +113,15 @@ class XslDocTypeConfigurationPostDispatchTest extends Admin_AbstractControllerTe
class XslNoticeajaxDetailDispatchTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$disk = $this->mock();
Class_FileManager::setFileSystem($disk);
$php_command = $this->mock()
->whenCalled('extension_loaded')
->answers(true)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment