Mercurial > hg > mgallery
changeset 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 | 24b45acc59e4 |
children | 014e1d6991a3 |
files | basic.css mgallery.php |
diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/basic.css Wed May 13 07:34:43 2015 +0300 +++ b/basic.css Fri May 15 06:53:30 2015 +0300 @@ -179,11 +179,14 @@ margin: 0.5em; } -span.naviBreadCrumbItem { +.naviBreadCrumbItem { +} + +.naviBreadCrumbCurr { color: red; } -span.naviBreadCrumbSep:before { +.naviBreadCrumbSep:before { content: " → "; color: #0f0; font-weight: bold;
--- 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)).