|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* (c) Kitodo. Key to digital objects e.V. <[email protected]> |
|
4
|
|
|
* |
|
5
|
|
|
* This file is part of the Kitodo and TYPO3 projects. |
|
6
|
|
|
* |
|
7
|
|
|
* @license GNU General Public License version 3 or later. |
|
8
|
|
|
* For the full copyright and license information, please read the |
|
9
|
|
|
* LICENSE.txt file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Kitodo\Dlf\Controller; |
|
13
|
|
|
|
|
14
|
|
|
use Kitodo\Dlf\Common\Doc; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Plugin 'View3D' for the 'dlf' extension |
|
18
|
|
|
* |
|
19
|
|
|
* @author Beatrycze Volk <[email protected]> |
|
20
|
|
|
* @package TYPO3 |
|
21
|
|
|
* @subpackage dlf |
|
22
|
|
|
* @access public |
|
23
|
|
|
*/ |
|
24
|
|
|
class View3DController extends AbstractController |
|
25
|
|
|
{ |
|
26
|
|
|
/** |
|
27
|
|
|
* @return string|void |
|
28
|
|
|
*/ |
|
29
|
|
|
public function mainAction() |
|
30
|
|
|
{ |
|
31
|
|
|
$this->cObj = $this->configurationManager->getContentObject(); |
|
|
|
|
|
|
32
|
|
|
// Load current document. |
|
33
|
|
|
$this->loadDocument($this->requestData); |
|
34
|
|
|
if ( |
|
35
|
|
|
$this->document === null |
|
36
|
|
|
|| $this->document->getDoc() === null |
|
37
|
|
|
|| $this->document->getDoc()->metadataArray['LOG_0001']['type'][0] != 'object' |
|
38
|
|
|
) { |
|
39
|
|
|
// Quit without doing anything if required variables are not set. |
|
40
|
|
|
return ''; |
|
41
|
|
|
} else { |
|
42
|
|
|
$url = $this->document->getDoc()->getFileLocation($this->document->getDoc()->physicalStructureInfo[$this->document->getDoc()->physicalStructure[1]]['files']['DEFAULT']); |
|
43
|
|
|
if ($this->settings['useInternalProxy']) { |
|
44
|
|
|
// Configure @action URL for form. |
|
45
|
|
|
$uri = $this->uriBuilder->reset() |
|
46
|
|
|
->setTargetPageUid($GLOBALS['TSFE']->id) |
|
47
|
|
|
->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? true : false) |
|
48
|
|
|
->setArguments([ |
|
49
|
|
|
'eID' => 'tx_dlf_pageview_proxy', |
|
50
|
|
|
'url' => urlencode($url), |
|
51
|
|
|
'uHash' => GeneralUtility::hmac($url, 'PageViewProxy') |
|
|
|
|
|
|
52
|
|
|
]) |
|
53
|
|
|
->build(); |
|
54
|
|
|
$url = $uri; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
$this->view->assign('url', $url); |
|
58
|
|
|
$this->view->assign('scriptMain', '/typo3conf/ext/dlf/Resources/Public/Javascript/3DViewer/main.js'); |
|
59
|
|
|
$this->view->assign('scriptToastify', '/typo3conf/ext/dlf/Resources/Public/Javascript/3DViewer/toastify.js'); |
|
60
|
|
|
$this->view->assign('scriptSpinner', '/typo3conf/ext/dlf/Resources/Public/Javascript/3DViewer/spinner/main.js'); |
|
61
|
|
|
} |
|
62
|
|
|
} |
|
63
|
|
|
} |
|
64
|
|
|
|