Fix Path bugs after move

This commit is contained in:
Dennis Eichhorn 2018-09-21 23:09:54 +02:00
parent bfb785d358
commit 2b4e098ec2
2 changed files with 17 additions and 17 deletions

View File

@ -69,7 +69,7 @@ class BackendController extends Controller
$path = $this->getHelpGeneralPath($request); $path = $this->getHelpGeneralPath($request);
$content = Markdown::parse(\file_get_contents($path)); $content = Markdown::parse(\file_get_contents($path));
$navigation = Markdown::parse(\file_get_contents(__DIR__ . '/../../Documentation/SUMMARY.md')); $navigation = Markdown::parse(\file_get_contents(__DIR__ . '/../../../Documentation/SUMMARY.md'));
$view->setTemplate('/Modules/Help/Theme/Backend/help-general'); $view->setTemplate('/Modules/Help/Theme/Backend/help-general');
$view->setData('content', $content); $view->setData('content', $content);
@ -91,13 +91,13 @@ class BackendController extends Controller
private function getHelpGeneralPath(RequestAbstract $request) : string private function getHelpGeneralPath(RequestAbstract $request) : string
{ {
if ($request->getData('page') === 'README' || $request->getData('page') === null) { if ($request->getData('page') === 'README' || $request->getData('page') === null) {
$path = \realpath(__DIR__ . '/../../Documentation/README.md'); $path = \realpath(__DIR__ . '/../../../Documentation/README.md');
} else { } else {
$path = \realpath(__DIR__ . '/../../Documentation/' . $request->getData('page') . '.md'); $path = \realpath(__DIR__ . '/../../../Documentation/' . $request->getData('page') . '.md');
} }
if ($path === false) { if ($path === false) {
$path = \realpath(__DIR__ . '/../../Documentation/README.md'); $path = \realpath(__DIR__ . '/../../../Documentation/README.md');
} }
return $path; return $path;
@ -143,7 +143,7 @@ class BackendController extends Controller
$path = $this->getHelpModulePath($request); $path = $this->getHelpModulePath($request);
$content = Markdown::parse(\file_get_contents($path)); $content = Markdown::parse(\file_get_contents($path));
$navigation = Markdown::parse(\file_get_contents(\realpath(__DIR__ . '/../' . $request->getData('id') . '/Docs/Help/en/SUMMARY.md'))); $navigation = Markdown::parse(\file_get_contents(\realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/SUMMARY.md')));
$view->setTemplate('/Modules/Help/Theme/Backend/help-module'); $view->setTemplate('/Modules/Help/Theme/Backend/help-module');
$view->setData('content', $content); $view->setData('content', $content);
@ -165,13 +165,13 @@ class BackendController extends Controller
private function getHelpModulePath(RequestAbstract $request) : string private function getHelpModulePath(RequestAbstract $request) : string
{ {
if ($request->getData('page') === 'table-of-contencts' || $request->getData('page') === null) { if ($request->getData('page') === 'table-of-contencts' || $request->getData('page') === null) {
$path = \realpath(__DIR__ . '/../' . $request->getData('id') . '/Docs/introduction.md'); $path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/introduction.md');
} else { } else {
$path = \realpath(__DIR__ . '/../' . $request->getData('id') . '/Docs/Help/en/' . $request->getData('page') . '.md'); $path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/' . $request->getData('page') . '.md');
} }
if ($path === false) { if ($path === false) {
$path = \realpath(__DIR__ . '/../' . $request->getData('id') . '/Docs/introduction.md'); $path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/introduction.md');
} }
return $path; return $path;
@ -193,7 +193,7 @@ class BackendController extends Controller
$path = $this->getHelpDeveloperPath($request); $path = $this->getHelpDeveloperPath($request);
$content = Markdown::parse(\file_get_contents($path)); $content = Markdown::parse(\file_get_contents($path));
$navigation = Markdown::parse(\file_get_contents(__DIR__ . '/../../Developer-Guide/SUMMARY.md')); $navigation = Markdown::parse(\file_get_contents(__DIR__ . '/../../../Developer-Guide/SUMMARY.md'));
$view->setTemplate('/Modules/Help/Theme/Backend/help-developer'); $view->setTemplate('/Modules/Help/Theme/Backend/help-developer');
$view->setData('content', $content); $view->setData('content', $content);
@ -215,13 +215,13 @@ class BackendController extends Controller
private function getHelpDeveloperPath(RequestAbstract $request) : string private function getHelpDeveloperPath(RequestAbstract $request) : string
{ {
if ($request->getData('page') === 'README' || $request->getData('page') === null) { if ($request->getData('page') === 'README' || $request->getData('page') === null) {
$path = \realpath(__DIR__ . '/../../Developer-Guide/README.md'); $path = \realpath(__DIR__ . '/../../../Developer-Guide/README.md');
} else { } else {
$path = \realpath(__DIR__ . '/../../Developer-Guide/' . $request->getData('page') . '.md'); $path = \realpath(__DIR__ . '/../../../Developer-Guide/' . $request->getData('page') . '.md');
} }
if ($path === false) { if ($path === false) {
$path = \realpath(__DIR__ . '/../../Developer-Guide/README.md'); $path = \realpath(__DIR__ . '/../../../Developer-Guide/README.md');
} }
return $path; return $path;