diff --git a/Controller/ApiController.php b/Controller/ApiController.php index e24b232..3bcc0c8 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -135,7 +135,7 @@ final class ApiController extends Controller default: $response->getHeader()->set('Content-Type', 'text/html; charset=utf-8'); // todo: use html template here instead which uses the tcoll/template!!! - $view->setTemplate(\substr($view->getData('tcoll')['template']->getPath(), 0, -8)); + $view->setTemplate('/' . \substr($view->getData('tcoll')['template']->getPath(), 0, -8)); } } @@ -161,12 +161,19 @@ final class ApiController extends Controller $lowerPath = \strtolower($tMedia->getPath()); if (StringUtils::endsWith($lowerPath, '.lang.php')) { - $tcoll['lang'][$tMedia->getName()] = $tMedia; - } elseif (StringUtils::endsWith($lowerPath, '.xlsx.php') || StringUtils::endsWith($lowerPath, '.xls.php')) { + $language = \explode('.', $lowerPath)[0]; + $tcoll['lang'][$language] = $tMedia; + } elseif (StringUtils::endsWith($lowerPath, '.xlsx.php') + || StringUtils::endsWith($lowerPath, '.xls.php') + ) { $tcoll['excel'][$tMedia->getName()] = $tMedia; - } elseif (StringUtils::endsWith($lowerPath, '.docx.php') || StringUtils::endsWith($lowerPath, '.doc.php')) { + } elseif (StringUtils::endsWith($lowerPath, '.docx.php') + || StringUtils::endsWith($lowerPath, '.doc.php') + ) { $tcoll['word'][$tMedia->getName()] = $tMedia; - } elseif (StringUtils::endsWith($lowerPath, '.pptx.php') || StringUtils::endsWith($lowerPath, '.ppt.php')) { + } elseif (StringUtils::endsWith($lowerPath, '.pptx.php') + || StringUtils::endsWith($lowerPath, '.ppt.php') + ) { $tcoll['powerpoint'][$tMedia->getName()] = $tMedia; } elseif (StringUtils::endsWith($lowerPath, '.pdf.php')) { $tcoll['pdf'][$tMedia->getName()] = $tMedia; @@ -194,7 +201,7 @@ final class ApiController extends Controller ); $rcoll = []; - $report = end($report); + $report = \end($report); $report = $report === false ? new NullReport() : $report; if (!($report instanceof NullReport)) { diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 2e3f8ca..d58d61a 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -149,7 +149,7 @@ final class BackendController extends Controller $files = $template->getSource()->getSources(); foreach ($files as $tMedia) { - $lowerPath = strtolower($tMedia->getPath()); + $lowerPath = \strtolower($tMedia->getPath()); if (StringUtils::endsWith($lowerPath, '.lang.php')) { $tcoll['lang'] = $tMedia; @@ -192,7 +192,7 @@ final class BackendController extends Controller ); $rcoll = []; - $report = end($report); + $report = \end($report); $report = $report === false ? new NullReport() : $report; if (!($report instanceof NullReport)) { diff --git a/Models/Template.php b/Models/Template.php index ad03819..be60e94 100644 --- a/Models/Template.php +++ b/Models/Template.php @@ -144,7 +144,7 @@ class Template implements \JsonSerializable public function getNewestReport() : Report { if (!empty($this->reports)) { - return end($this->reports()); + return \end($this->reports()); } return new NullReport(); diff --git a/Theme/Backend/helper-list.tpl.php b/Theme/Backend/helper-list.tpl.php index 6ce78a5..6ebca97 100644 --- a/Theme/Backend/helper-list.tpl.php +++ b/Theme/Backend/helper-list.tpl.php @@ -19,9 +19,9 @@ $templates = $this->getData('reports'); $footerView = new \phpOMS\Views\PaginationView($this->app, $this->request, $this->response); $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); -$footerView->setPages(count($templates) / 25); +$footerView->setPages(\count($templates) / 25); $footerView->setPage(1); -$footerView->setResults(count($templates)); +$footerView->setResults(\count($templates)); echo $this->getData('nav')->render(); ?> @@ -40,7 +40,7 @@ echo $this->getData('nav')->render(); ?> - + getHtml('Empty', 0, 0); ?> diff --git a/Theme/Backend/helper-single.tpl.php b/Theme/Backend/helper-single.tpl.php index f3d1d1c..cc3b536 100644 --- a/Theme/Backend/helper-single.tpl.php +++ b/Theme/Backend/helper-single.tpl.php @@ -28,12 +28,12 @@ echo $this->getData('nav')->render(); ?>
- +