cgit

commit c3c925f4eca3e863bedaae4cfe237c3ad52092b6

Author: Lars Hjemli <hjemli@gmail.com>

ui-shared: externalize add_hidden_formfields()

This function will be reused by ui-stats.c in the next commit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>

 ui-shared.c | 6 +++---
 ui-shared.h | 3 ++-


diff --git a/ui-shared.c b/ui-shared.c
index a5eb25fbafd42189830df97add07a16170dfee77..1bb30c291646c3e0d07fc5ca736024c1de6dd39d 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -555,7 +555,7 @@ 	html_link_close();
 	return 0;
 }
 
-void add_hidden_formfields(int incl_head, int incl_search, char *page)
+void cgit_add_hidden_formfields(int incl_head, int incl_search, char *page)
 {
 	char *url;
 
@@ -610,7 +610,7 @@ 		html(" : ");
 		cgit_summary_link(ctx->repo->name, ctx->repo->name, NULL, NULL);
 		html("</td><td class='form'>");
 		html("<form method='get' action=''>\n");
-		add_hidden_formfields(0, 1, ctx->qry.page);
+		cgit_add_hidden_formfields(0, 1, ctx->qry.page);
 		html("<select name='h' onchange='this.form.submit();'>\n");
 		for_each_branch_ref(print_branch_option, ctx->qry.head);
 		html("</select> ");
@@ -660,7 +660,7 @@ 		if (ctx->cfg.virtual_root)
 			html_url_path(cgit_fileurl(ctx->qry.repo, "log",
 						   ctx->qry.path, NULL));
 		html("'>\n");
-		add_hidden_formfields(1, 0, "log");
+		cgit_add_hidden_formfields(1, 0, "log");
 		html("<select name='qt'>\n");
 		html_option("grep", "log msg", ctx->qry.grep);
 		html_option("author", "author", ctx->qry.grep);




diff --git a/ui-shared.h b/ui-shared.h
index e3fae641e1e51592657935dffa655fb7e2a80598..1524dc35a3b1e28a2be61d5de38021517c83f4d0 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -44,5 +44,6 @@ extern void cgit_print_pageheader(struct cgit_context *ctx);
 extern void cgit_print_filemode(unsigned short mode);
 extern void cgit_print_snapshot_links(const char *repo, const char *head,
 				      const char *hex, int snapshots);
-
+extern void cgit_add_hidden_formfields(int incl_head, int incl_search,
+				       char *page);
 #endif /* UI_SHARED_H */