diff mgallery.php @ 3:c85f630a4198

Improve bread crumb navigation by making the current album a link as well.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 15 May 2015 06:53:30 +0300
parents ac688606ec4b
children 014e1d6991a3
line wrap: on
line diff
--- a/mgallery.php	Wed May 13 07:34:43 2015 +0300
+++ b/mgallery.php	Fri May 15 06:53:30 2015 +0300
@@ -204,19 +204,18 @@
 {
   $res = array();
   if ($galData["caption"])
-    $res[] = chentities($galData["caption"]);
+    $res[] = "<a class=\"naviBreadCrumbCurr\" href=\"".mgGetURL($pdata["path"], FALSE)."\">".chentities($galData["caption"])."</a>";
 
   $tmp = $galData;
   while (isset($tmp["parent"]))
   {
     $pdata = $tmp["parent"];
-    $res[] = "<a href=\"".mgGetURL($pdata["path"], FALSE)."\">".chentities($pdata["caption"])."</a>";
+    $res[] = "<a class=\"naviBreadCrumbItem\" href=\"".mgGetURL($pdata["path"], FALSE)."\">".chentities($pdata["caption"])."</a>";
     $tmp = $tmp["parent"];
   }
 
   if (count($res) > 1)
   {
-    $res = array_map(function ($a) { return "<span class=\"naviBreadCrumbItem\">".$a."</span>"; }, $res);
     echo
       "<div class=\"naviBreadCrumbs\">".
       implode("<span class=\"naviBreadCrumbSep\"></span>", array_reverse($res)).