From 0d4dd0513a8c525c3c1fbd7237b9bb283adb7a77 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sat, 14 Mar 2009 14:25:10 +0100 Subject: Option to hide "Go Up" links --- src/generators.c | 4 ++-- src/setup.c | 3 +++ src/setup.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/generators.c b/src/generators.c index a755a45..48f7c0b 100644 --- a/src/generators.c +++ b/src/generators.c @@ -427,7 +427,7 @@ write_html_album (TGallerySetup *setup, } if (in_go_up_string && strstr (buffer, "")) { in_go_up_string = FALSE; - if (! items->parent_index) + if (! items->parent_index || ! setup->show_go_up) continue; } if (in_go_up_string) { @@ -520,7 +520,7 @@ write_html_album (TGallerySetup *setup, } /* Select apropriate line buffer */ - if (strstr (buffer, "") && items->parent_index) { + if (strstr (buffer, "") && items->parent_index && setup->show_go_up) { b = strdup (buf_go_up_string); } else b = strdup (buffer); diff --git a/src/setup.c b/src/setup.c index 17d8fda..4755ad7 100644 --- a/src/setup.c +++ b/src/setup.c @@ -135,6 +135,9 @@ parse_setup_xml (const char *filename, TGallerySetup *setup) s = xml_file_get_node_attribute (xml, "/gallery_setup/navigation/use_inpage_links", "value"); setup->use_inpage_links = s ? strcasecmp (s, "yes") == 0 : TRUE; /* default to TRUE */ if (s) g_free (s); + s = xml_file_get_node_attribute (xml, "/gallery_setup/navigation/show_go_up", "value"); + setup->show_go_up = s ? strcasecmp (s, "yes") == 0 : TRUE; /* default to TRUE */ + if (s) g_free (s); setup->nofullsize = xml_file_get_node_present (xml, "/gallery_setup/images/nofullsize"); diff --git a/src/setup.h b/src/setup.h index eb12f92..4019184 100644 --- a/src/setup.h +++ b/src/setup.h @@ -73,6 +73,7 @@ typedef struct { char *site_title; char *add_copyright; gboolean use_inpage_links; + gboolean show_go_up; char *favicon_file; char *favicon_type; -- cgit v1.2.3