Skip to content

Commit

Permalink
Add default link attributes (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhj authored Jun 15, 2021
1 parent 80613b6 commit faf487e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/*
* This file is part of richardhj/contao-knp-menu.
*
* Copyright (c) 2020-2020 Richard Henkenjohann
* Copyright (c) 2020-2021 Richard Henkenjohann
*
* @package richardhj/contao-knp-menu
* @author Richard Henkenjohann <[email protected]>
* @copyright 2020-2020 Richard Henkenjohann
* @copyright 2020-2021 Richard Henkenjohann
* @license MIT
*/

Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/RichardhjContaoKnpMenuExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/*
* This file is part of richardhj/contao-knp-menu.
*
* Copyright (c) 2020-2020 Richard Henkenjohann
* Copyright (c) 2020-2021 Richard Henkenjohann
*
* @package richardhj/contao-knp-menu
* @author Richard Henkenjohann <[email protected]>
* @copyright 2020-2020 Richard Henkenjohann
* @copyright 2020-2021 Richard Henkenjohann
* @license MIT
*/

Expand Down
16 changes: 14 additions & 2 deletions src/Menu/MenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/*
* This file is part of richardhj/contao-knp-menu.
*
* Copyright (c) 2020-2020 Richard Henkenjohann
* Copyright (c) 2020-2021 Richard Henkenjohann
*
* @package richardhj/contao-knp-menu
* @author Richard Henkenjohann <[email protected]>
* @copyright 2020-2020 Richard Henkenjohann
* @copyright 2020-2021 Richard Henkenjohann
* @license MIT
*/

Expand Down Expand Up @@ -184,6 +184,18 @@ private function populateMenuItem(MenuItem $item, ?PageModel $requestPage, PageM
$item->setLinkAttribute('rel', implode(' ', $arrRel));
}

if ($title = $page->pageTitle ?: $page->title) {
$item->setLinkAttribute('title', $title);
}

if ($page->accesskey) {
$item->setLinkAttribute('accesskey', $page->accesskey);
}

if ($page->tabindex) {
$item->setLinkAttribute('tabindex', $page->tabindex);
}

foreach ($extra as $k => $v) {
$item->setExtra($k, $v);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Menu/NavigationModuleProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/*
* This file is part of richardhj/contao-knp-menu.
*
* Copyright (c) 2020-2020 Richard Henkenjohann
* Copyright (c) 2020-2021 Richard Henkenjohann
*
* @package richardhj/contao-knp-menu
* @author Richard Henkenjohann <[email protected]>
* @copyright 2020-2020 Richard Henkenjohann
* @copyright 2020-2021 Richard Henkenjohann
* @license MIT
*/

Expand Down
4 changes: 2 additions & 2 deletions src/Resources/contao/dca/tl_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/*
* This file is part of richardhj/contao-knp-menu.
*
* Copyright (c) 2020-2020 Richard Henkenjohann
* Copyright (c) 2020-2021 Richard Henkenjohann
*
* @package richardhj/contao-knp-menu
* @author Richard Henkenjohann <[email protected]>
* @copyright 2020-2020 Richard Henkenjohann
* @copyright 2020-2021 Richard Henkenjohann
* @license MIT
*/

Expand Down
4 changes: 2 additions & 2 deletions src/RichardhjContaoKnpMenuBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/*
* This file is part of richardhj/contao-knp-menu.
*
* Copyright (c) 2020-2020 Richard Henkenjohann
* Copyright (c) 2020-2021 Richard Henkenjohann
*
* @package richardhj/contao-knp-menu
* @author Richard Henkenjohann <[email protected]>
* @copyright 2020-2020 Richard Henkenjohann
* @copyright 2020-2021 Richard Henkenjohann
* @license MIT
*/

Expand Down

0 comments on commit faf487e

Please sign in to comment.