Fix relative path

This commit is contained in:
Dennis Eichhorn 2019-02-11 17:24:35 +01:00
parent a086a2c5b2
commit 01a55f1d4f
2 changed files with 4 additions and 4 deletions

View File

@ -133,7 +133,7 @@ final class ApiController extends Controller
break;
default:
$response->getHeader()->set('Content-Type', 'text/html; charset=utf-8');
$view->setTemplate('/' . \substr($view->getData('tcoll')['template']->getPath(), 0, -8));
$view->setTemplate('/Modules/' . \substr($view->getData('tcoll')['template']->getPath(), 0, -8));
}
}

View File

@ -21,8 +21,8 @@ $template = $this->getData('template');
$report = $this->getData('report');
/** @noinspection PhpIncludeInspection */
$reportLanguage = include __DIR__ . '/../../../../' . \ltrim($tcoll['lang']->getPath(), '/');
$lang = $reportLanguage[$cLang];
$reportLanguage = isset($tcoll['lang']) ? include __DIR__ . '/../../../../' . \ltrim($tcoll['lang']->getPath(), '/') : [];
$lang = $reportLanguage[$cLang] ?? [];
echo $this->getData('nav')->render(); ?>
<div class="row" style="height: calc(100% - 85px);">
@ -86,7 +86,7 @@ echo $this->getData('nav')->render(); ?>
</select>
<tr>
<td><input type="button" value="<?= $this->getHtml('Export'); ?>"
data-ropen="/{#lang}/api/helper/export.php?{type=#iExport}{lang=#iLang}{QUERY}">
data-ropen="{#lang}/api/helper/export.php?{type=#iExport}{lang=#iLang}{QUERY}">
</table>
</form>
</div>