highlight selected tag
[grauphel.git] / controller / guicontroller.php
index 97a7f10c9289f2622b6e77eabc531ca882744583..4f74ab53f1fa3e81f9b29e67a4e64f328b79463f 100644 (file)
@@ -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,
                 );
             }
         }