-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Pres_01-2023_Solr-Verbesserungen_soft_comm…
…its_rebase
- Loading branch information
Showing
28 changed files
with
325 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?php | ||
/** | ||
* (c) Kitodo. Key to digital objects e.V. <[email protected]> | ||
* | ||
* This file is part of the Kitodo and TYPO3 projects. | ||
* | ||
* @license GNU General Public License version 3 or later. | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Kitodo\Dlf\Controller; | ||
|
||
use Kitodo\Dlf\Common\AbstractDocument; | ||
|
||
/** | ||
* Plugin 'Embedded3dViewer' for the 'dlf' extension | ||
* | ||
* @package TYPO3 | ||
* @subpackage dlf | ||
* | ||
* @access public | ||
*/ | ||
class Embedded3dViewerController extends AbstractController | ||
{ | ||
|
||
const MIDDLEWARE_DLF_EMBEDDED_3D_VIEWER_PREFIX = '/?middleware=dlf/embedded3dviewer'; | ||
|
||
/** | ||
* @access public | ||
* | ||
* @return void | ||
*/ | ||
public function mainAction(): void | ||
{ | ||
if (!empty($this->requestData['model']) || !empty($this->settings['model'])) { | ||
$this->view->assign('embedded3dViewerUrl', $this->buildEmbedded3dViewerUrl()); | ||
return; | ||
} | ||
|
||
if (!empty($this->settings['document'])) { | ||
$this->assignModelFromDocument($this->getDocumentByUrl($this->settings['document'])); | ||
} else { | ||
$this->loadDocument(); | ||
if (!$this->isDocMissingOrEmpty()) { | ||
$this->assignModelFromDocument($this->document->getCurrentDocument()); | ||
} | ||
} | ||
|
||
} | ||
|
||
/** | ||
* Builds the embedded 3D viewer url. | ||
* | ||
* @param string $model The model url | ||
* @return string The embedded 3D viewer url | ||
*/ | ||
public function buildEmbedded3dViewerUrl(string $model = ''): string | ||
{ | ||
$viewer = ""; | ||
$embedded3dViewerUrl = self::MIDDLEWARE_DLF_EMBEDDED_3D_VIEWER_PREFIX; | ||
|
||
if (!empty($this->requestData['model'])) { | ||
$model = $this->requestData['model']; | ||
} elseif (!empty($this->settings['model'])) { | ||
$model = $this->settings['model']; | ||
} | ||
|
||
if (!empty($model)) { | ||
$embedded3dViewerUrl .= '&model=' . $model; | ||
} | ||
|
||
if (!empty($this->requestData['viewer'])) { | ||
$viewer = $this->requestData['viewer']; | ||
} elseif (!empty($this->settings['viewer'])) { | ||
$viewer = $this->settings['viewer']; | ||
} | ||
|
||
if (!empty($viewer)) { | ||
$embedded3dViewerUrl .= '&viewer=' . $viewer; | ||
} | ||
return $embedded3dViewerUrl; | ||
} | ||
|
||
/** | ||
* Assign the model from document to view. | ||
* | ||
* @param AbstractDocument $document The document containing the model | ||
*/ | ||
public function assignModelFromDocument(AbstractDocument $document): void | ||
{ | ||
if ($document->getToplevelMetadata()['type'][0] === 'object') { | ||
$model = trim($document->getFileLocation($document->physicalStructureInfo[$document->physicalStructure[1]]['files']['DEFAULT'])); | ||
$this->view->assign('embedded3dViewerUrl', $this->buildEmbedded3dViewerUrl($model)); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
<!-- | ||
* (c) Kitodo. Key to digital objects e.V. <[email protected]> | ||
* | ||
* This file is part of the Kitodo and TYPO3 projects. | ||
* | ||
* @license GNU General Public License version 3 or later. | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
--> | ||
<T3DataStructure> | ||
<meta> | ||
<langDisable>1</langDisable> | ||
</meta> | ||
<sheets> | ||
<sDEF> | ||
<ROOT> | ||
<TCEforms> | ||
<sheetTitle>LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general</sheetTitle> | ||
</TCEforms> | ||
<type>array</type> | ||
<el> | ||
<settings.document> | ||
<TCEforms> | ||
<exclude>1</exclude> | ||
<label>LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.embedded3dviewer.flexform.document</label> | ||
<config> | ||
<type>input</type> | ||
<eval>trim</eval> | ||
</config> | ||
</TCEforms> | ||
</settings.document> | ||
<settings.model> | ||
<TCEforms> | ||
<exclude>1</exclude> | ||
<label>LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.embedded3dviewer.flexform.model</label> | ||
<config> | ||
<type>input</type> | ||
<eval>trim</eval> | ||
</config> | ||
</TCEforms> | ||
</settings.model> | ||
<settings.viewer> | ||
<TCEforms> | ||
<exclude>1</exclude> | ||
<label>LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.embedded3dviewer.flexform.viewer</label> | ||
<config> | ||
<type>input</type> | ||
<eval>trim</eval> | ||
</config> | ||
</TCEforms> | ||
</settings.viewer> | ||
</el> | ||
</ROOT> | ||
</sDEF> | ||
</sheets> | ||
</T3DataStructure> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.