Commit 2f6a30b6 authored by Prosper De Laure's avatar Prosper De Laure
Browse files

FEAT #5736 Document are display on detail screen

parent 2cc00084
......@@ -52,17 +52,9 @@ class digitalResource
$url = \laabs::createPublicResource($contents);
$this->view->addContent(
'<div class="container-fluid">
<br/>
<div class="row">
<pre>'.print_r($resource, true).'</pre>
<div class="col col-lg-12">
<object class="embed-responsive-item" data="'.$url.'"" type="'.$resource->mimetype.'">
</object>
</div>
</div>
</div>'
'<object class="embed-responsive-item" data="'.$url.'"" type="'.$resource->mimetype.'"></object>'
);
return $this->view->saveHtml();
......
......@@ -243,6 +243,10 @@ class welcome
$this->view->addContentFile('dashboard/mainScreen/documentInformation.html');
$this->view->translate();
if (isset(\laabs::configuration('presentation.maarchRM')['displayableFormat'])) {
$this->view->setSource("displayableFormat", json_encode(\laabs::configuration('presentation.maarchRM')['displayableFormat']));
$this->view->merge();
}
return $this->view->saveHtml();
}
/**
......
<div id="resourceInformation" class="row">
<div class="col-xs-12 text-center">
<div id="preview" class="hide" data-format="[?merge displayableFormat ?]" style="height: 300px"/>
<i class="infoIcon fa fa-file-o"/>
</div>
<div class="col-xs-12 text-center">
......@@ -107,6 +108,25 @@
if (resource.metadata) {
}
var displayableFormat = $('#preview').data('format');
if ($.inArray(resource.mimetype, displayableFormat) > -1) {
$.ajax({
url : "/digitalResource/"+resource.resId,
type : "GET",
dataType : 'html',
success : function(response) {
$("#preview").removeClass('hide').html(response);
$('#preview').find('object').css('max-height', '300px').css('max-width', '300px');
$('#preview').siblings('i').addClass('hide');
},
error : function(response) {
$("preview").removeClass('hide').html(response);
}
})
}
}
}
......
......@@ -119,7 +119,7 @@ interface retrieveInterface
*/
public function readRecordsmanagementDocument_docId_();
/**
/**
* Retrieve an archive resource by its id
*
* @return recordsManagement/archive/getContents
......@@ -127,6 +127,14 @@ interface retrieveInterface
*/
public function readRecordsmanagementDigitalresource_resId_();
/**
* Retrieve an archive resource by its id
*
* @return digitalResource/digitalResource/retrieve
* @uses recordsManagement/archive/readDigitalResource_resId_
*/
public function readDigitalresource_resId_();
/**
* Retrieve an archive content document (CDO)
*
......
Supports Markdown
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