From 05d83083cb4b7f7d1e1c7c4398310852b824bda0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 12 May 2024 00:06:28 +0000 Subject: [PATCH] bug fixes --- .github/workflows/greetings.yml | 2 +- .../Theme/Backend/settings-nav.tpl.php | 4 +- Admin/Settings/Theme/Backend/settings.tpl.php | 4 +- Controller/BackendController.php | 30 ++++++++++++ Theme/Backend/mid-sub.tpl.php | 47 +++++++++++++++++++ 5 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 Theme/Backend/mid-sub.tpl.php diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index adb8716..75cb759 100755 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -9,5 +9,5 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Thank you for createing this issue. We will check it as soon as possible.' + issue-message: 'Thank you for creating this issue. We will check it as soon as possible.' pr-message: 'Thank you for your pull request. We will check it as soon as possible.' diff --git a/Admin/Settings/Theme/Backend/settings-nav.tpl.php b/Admin/Settings/Theme/Backend/settings-nav.tpl.php index 18f773c..72c10a1 100755 --- a/Admin/Settings/Theme/Backend/settings-nav.tpl.php +++ b/Admin/Settings/Theme/Backend/settings-nav.tpl.php @@ -104,7 +104,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Routes'); ?>download
@@ -201,6 +201,6 @@ echo $this->data['nav']->render(); ?> getHtml('Previous', '0', '0'); ?>getHtml('Next', '0', '0'); ?> - + diff --git a/Admin/Settings/Theme/Backend/settings.tpl.php b/Admin/Settings/Theme/Backend/settings.tpl.php index ef342e5..9ea10a6 100755 --- a/Admin/Settings/Theme/Backend/settings.tpl.php +++ b/Admin/Settings/Theme/Backend/settings.tpl.php @@ -27,7 +27,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Navigation'); ?>download
@@ -154,6 +154,6 @@ echo $this->data['nav']->render(); ?> getHtml('Next', '0', '0'); ?> --> - + diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 2646d0b..e936245 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -65,6 +65,36 @@ final class BackendController extends Controller return $navView; } + /** + * Create mid navigation + * + * @param int $pageId Page/parent Id for navigation + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * + * @return NavigationView + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function createNavigationMidSub(int $pageId, RequestAbstract $request, ResponseAbstract $response) : NavigationView + { + $nav = Navigation::getInstance( + $request, + $this->app->accountManager->get($request->header->account), + $this->app->dbPool, + $this->app->unitId, + $this->app->appId + ); + + $navView = new NavigationView($this->app->l11nManager, $request, $response); + $navView->setTemplate('/Modules/Navigation/Theme/Backend/mid-sub'); + $navView->nav = $nav->nav; + $navView->parent = $pageId; + + return $navView; + } + /** * Get basic navigation view * diff --git a/Theme/Backend/mid-sub.tpl.php b/Theme/Backend/mid-sub.tpl.php new file mode 100644 index 0000000..d65f56d --- /dev/null +++ b/Theme/Backend/mid-sub.tpl.php @@ -0,0 +1,47 @@ +nav[\Modules\Navigation\Models\NavigationType::TAB]) + && \phpOMS\Utils\ArrayUtils::inArrayRecursive( + $this->parent, + $this->nav[\Modules\Navigation\Models\NavigationType::TAB], + 'nav_parent' + ) +) : ?> +
+
+ +
+
+