Commit 856b59ea authored by Charles Bourdot's avatar Charles Bourdot
Browse files

Bouton retour vue de lecture

parent 77d2f475
Loading
Loading
Loading
Loading
+9 −0
Changes for XML2HTMLPlugin.php: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ class XML2HTMLPlugin extends GenericPlugin
        $templateMgr->assign('metadataSource', $this->getSetting($context->getId(), 'metadataSource'));
        $templateMgr->assign('cssLandingPageUrl', $this->getCssFileUrl($request, 'cssLandingPageFile'));
        $templateMgr->assign('cssSideViewUrl', $this->getCssFileUrl($request, 'cssSideViewFile'));
        $templateMgr->assign('metadataUrl', $this->getMetadataUrl($submission->getId(), 'article'));

        $templateMgr->display($this->getTemplateResource('HTMLGalleyView.tpl'));

@@ -179,6 +180,7 @@ class XML2HTMLPlugin extends GenericPlugin
            $templateMgr->assign('text', $html);
            $templateMgr->assign('cssLandingPageUrl', $this->getCssFileUrl($this->getRequest(), 'cssLandingPageFile'));
            $templateMgr->assign('cssSideViewUrl', $this->getCssFileUrl($this->getRequest(), 'cssSideViewFile'));
            $templateMgr->assign('metadataUrl', $this->getMetadataUrl($submissionId, $op));
            $html = $templateMgr->display($this->getTemplateResource('HTMLGalleyView.tpl'));
            file_put_contents($htmlFile, $html, LOCK_EX);
        }
@@ -351,6 +353,13 @@ class XML2HTMLPlugin extends GenericPlugin
            . '/resources/custom/' . $filename;
    }

    private function getMetadataUrl(int $submissionId, string $op): string
    {
        $request = $this->getRequest();
        $page = $op === 'catalog' ? 'catalog' : 'article';
        return $request->url(null, $page, 'view', [$submissionId]);
    }

public static function transform(string $xmlFilePath, string $format)
{
    $xsltDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'xsl' . DIRECTORY_SEPARATOR . strtolower($format) . DIRECTORY_SEPARATOR;
+3 −0
Changes for locale/en_US/locale.po: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -37,3 +37,6 @@ msgstr "Settings for"

msgid "plugins.generic.xml2html.metadata"
msgstr "Metadata's source"

msgid "plugins.generic.xml2html.backToMetadata"
msgstr "Back to article page"
 No newline at end of file
+3 −0
Changes for locale/fr_FR/locale.po: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -37,3 +37,6 @@ msgstr "Paramétrage de la revue"

msgid "plugins.generic.xml2html.metadata"
msgstr "Source des métadonnées"

msgid "plugins.generic.xml2html.backToMetadata"
msgstr "Retour à la page de l'article"
 No newline at end of file
+39 −0
Changes for resources/styles/xml_2_html.css: 39 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -130,6 +130,45 @@ body.dark #moon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sideview-back-btn {
    position: fixed;
    top: 10px;
    right: 50px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.sideview-back-btn:hover,
.sideview-back-btn:focus {
    background: #f0f0f0;
    color: #000;
}

body.dark .sideview-back-btn {
    background: var(--dark-theme-bg);
    border-color: var(--dark-border);
    color: var(--dark-theme-txt);
}

body.dark .sideview-back-btn:hover,
body.dark .sideview-back-btn:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.wrap {
    padding-top: 42px;
    min-height: 100vh;
+3 −0
Changes for templates/HTMLGalleyView.tpl: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@
        {$dcMetas}
    </head>
    <body>
    {if $metadataUrl}
        <a href="{$metadataUrl}" class="sideview-back-btn" title="{translate key="plugins.generic.xml2html.backToMetadata"}" aria-label="{translate key="plugins.generic.xml2html.backToMetadata"}">&#10005;</a>
    {/if}
    <div class="page {if $metadataSource == 'tei'}metadata_tei{else}metadata_pkp{/if}">
        {$text}
    </div>