summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
authorLars Hjemli <hjemli@gmail.com>2008-12-07 14:52:35 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-12-07 14:52:35 (UTC)
commitc3c925f4eca3e863bedaae4cfe237c3ad52092b6 (patch) (unidiff)
tree5d3afa3a3ed0fbdbe00ad8e3519cf3cf60413e09 /ui-shared.c
parent837d464af77d76a2661d92e05167657cbf430d80 (diff)
downloadcgit-c3c925f4eca3e863bedaae4cfe237c3ad52092b6.zip
cgit-c3c925f4eca3e863bedaae4cfe237c3ad52092b6.tar.gz
cgit-c3c925f4eca3e863bedaae4cfe237c3ad52092b6.tar.bz2
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>
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui-shared.c b/ui-shared.c
index a5eb25f..1bb30c2 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -552,13 +552,13 @@ int print_archive_ref(const char *refname, const unsigned char *sha1,
552 html_link_open(url, NULL, "menu"); 552 html_link_open(url, NULL, "menu");
553 html_txt(strlpart(buf, 20)); 553 html_txt(strlpart(buf, 20));
554 html_link_close(); 554 html_link_close();
555 return 0; 555 return 0;
556} 556}
557 557
558void add_hidden_formfields(int incl_head, int incl_search, char *page) 558void cgit_add_hidden_formfields(int incl_head, int incl_search, char *page)
559{ 559{
560 char *url; 560 char *url;
561 561
562 if (!ctx.cfg.virtual_root) { 562 if (!ctx.cfg.virtual_root) {
563 url = fmt("%s/%s", ctx.qry.repo, page); 563 url = fmt("%s/%s", ctx.qry.repo, page);
564 if (ctx.qry.path) 564 if (ctx.qry.path)
@@ -607,13 +607,13 @@ void cgit_print_pageheader(struct cgit_context *ctx)
607 if (ctx->repo) { 607 if (ctx->repo) {
608 cgit_index_link("index", NULL, NULL, NULL, 0); 608 cgit_index_link("index", NULL, NULL, NULL, 0);
609 html(" : "); 609 html(" : ");
610 cgit_summary_link(ctx->repo->name, ctx->repo->name, NULL, NULL); 610 cgit_summary_link(ctx->repo->name, ctx->repo->name, NULL, NULL);
611 html("</td><td class='form'>"); 611 html("</td><td class='form'>");
612 html("<form method='get' action=''>\n"); 612 html("<form method='get' action=''>\n");
613 add_hidden_formfields(0, 1, ctx->qry.page); 613 cgit_add_hidden_formfields(0, 1, ctx->qry.page);
614 html("<select name='h' onchange='this.form.submit();'>\n"); 614 html("<select name='h' onchange='this.form.submit();'>\n");
615 for_each_branch_ref(print_branch_option, ctx->qry.head); 615 for_each_branch_ref(print_branch_option, ctx->qry.head);
616 html("</select> "); 616 html("</select> ");
617 html("<input type='submit' name='' value='switch'/>"); 617 html("<input type='submit' name='' value='switch'/>");
618 html("</form>"); 618 html("</form>");
619 } else 619 } else
@@ -657,13 +657,13 @@ void cgit_print_pageheader(struct cgit_context *ctx)
657 html("</td><td class='form'>"); 657 html("</td><td class='form'>");
658 html("<form class='right' method='get' action='"); 658 html("<form class='right' method='get' action='");
659 if (ctx->cfg.virtual_root) 659 if (ctx->cfg.virtual_root)
660 html_url_path(cgit_fileurl(ctx->qry.repo, "log", 660 html_url_path(cgit_fileurl(ctx->qry.repo, "log",
661 ctx->qry.path, NULL)); 661 ctx->qry.path, NULL));
662 html("'>\n"); 662 html("'>\n");
663 add_hidden_formfields(1, 0, "log"); 663 cgit_add_hidden_formfields(1, 0, "log");
664 html("<select name='qt'>\n"); 664 html("<select name='qt'>\n");
665 html_option("grep", "log msg", ctx->qry.grep); 665 html_option("grep", "log msg", ctx->qry.grep);
666 html_option("author", "author", ctx->qry.grep); 666 html_option("author", "author", ctx->qry.grep);
667 html_option("committer", "committer", ctx->qry.grep); 667 html_option("committer", "committer", ctx->qry.grep);
668 html("</select>\n"); 668 html("</select>\n");
669 html("<input class='txt' type='text' size='10' name='q' value='"); 669 html("<input class='txt' type='text' size='10' name='q' value='");