From 5eb9127cb6b6cf2fabf707de86831a44977b0e7c Mon Sep 17 00:00:00 2001 From: Moritz Strohm Date: Mon, 24 Oct 2022 17:24:38 +0200 Subject: added overview page --- app/controllers/u.php | 11 +++++++++++ app/views/u/overview.php | 37 +++++++++++++++++++++++++++++++++++ lib/navigation/ContentsNavigation.php | 4 ++++ 3 files changed, 52 insertions(+) create mode 100644 app/views/u/overview.php diff --git a/app/controllers/u.php b/app/controllers/u.php index 9e6375b..98414b7 100644 --- a/app/controllers/u.php +++ b/app/controllers/u.php @@ -53,6 +53,7 @@ class UController extends AuthenticatedController public function alias_action($url_id) { + PageLayout::setTitle(_('Bezeichnung ändern')); $short_url = new ShortURL($url_id); $this->form = \Studip\Forms\Form::fromSORM( $short_url, @@ -68,4 +69,14 @@ class UController extends AuthenticatedController ); $this->form->autoStore(); } + + + public function overview_action() + { + PageLayout::setTitle(_('Meine Kurz-URLs')); + if (Navigation::hasItem('/contents/short_urls')) { + Navigation::activateItem('/contents/short_urls'); + } + $this->short_urls = ShortURL::findBySql('user_id = :user_id ORDER BY `alias` ASC', ['user_id' => $GLOBALS['user']->id]); + } } diff --git a/app/views/u/overview.php b/app/views/u/overview.php new file mode 100644 index 0000000..8a70283 --- /dev/null +++ b/app/views/u/overview.php @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + +
alias) ?>url) ?> + addLink( + $controller->url_for('u/alias/' . $url->id), + _('Bezeichnung ändern'), + Icon::create('edit') + ); + $actions->addLink( + $controller->url_for('u/delete/' . $url->id), + _('Löschen'), + Icon::create('trash') + ); + ?> + render() ?> +
+ + + diff --git a/lib/navigation/ContentsNavigation.php b/lib/navigation/ContentsNavigation.php index 8e814ef..95c3772 100644 --- a/lib/navigation/ContentsNavigation.php +++ b/lib/navigation/ContentsNavigation.php @@ -152,5 +152,9 @@ class ContentsNavigation extends Navigation $help->addSubNavigation('help_content', new Navigation(_('Hilfe-Texte'), 'dispatch.php/help_content/admin_overview')); } + $short_urls = new Navigation(_('Kurz-URLs'), 'dispatch.php/u/overview'); + $short_urls->setImage(Icon::create('group')); + $short_urls->setDescription(_('Verwaltung Ihrer Kurz-URLs')); + $this->addSubNavigation('short_urls', $short_urls); } } -- cgit v1.0