From: Christian Weiske Date: Mon, 27 Oct 2014 21:33:52 +0000 (+0100) Subject: highlight selected tag X-Git-Tag: v0.4.0~8 X-Git-Url: https://git.cweiske.de/grauphel.git/commitdiff_plain/46a9ff9889466f23c310e2de100d0ae16c5a2a1a?hp=13079a5bcb289ede331b2d377ba4e66b0f1a1446 highlight selected tag --- diff --git a/controller/guicontroller.php b/controller/guicontroller.php index 97a7f10..4f74ab5 100644 --- a/controller/guicontroller.php +++ b/controller/guicontroller.php @@ -99,7 +99,12 @@ class GuiController extends Controller ) ); - $this->addNavigation($res); + $selectedRawtag = null; + if (count($note->tags) > 0) { + $selectedRawtag = $note->tags[0]; + } + + $this->addNavigation($res, $selectedRawtag); return $res; } @@ -233,6 +238,7 @@ class GuiController extends Controller 'href' => $this->urlGen->linkToRoute( 'grauphel.gui.tag', array('rawtag' => $rawtag) ), + 'selected' => $rawtag == $selectedRawtag, ); } } diff --git a/templates/appnavigation.php b/templates/appnavigation.php index b0657e1..04eb86c 100644 --- a/templates/appnavigation.php +++ b/templates/appnavigation.php @@ -1,7 +1,7 @@