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) (side-by-side diff)
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
@@ -546,25 +546,25 @@ int print_archive_ref(const char *refname, const unsigned char *sha1,
html("<h1>download</h1>\n");
*header = 1;
}
url = cgit_pageurl(ctx.qry.repo, "blob",
fmt("id=%s&amp;path=%s", sha1_to_hex(fileid),
buf));
html_link_open(url, NULL, "menu");
html_txt(strlpart(buf, 20));
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;
if (!ctx.cfg.virtual_root) {
url = fmt("%s/%s", ctx.qry.repo, page);
if (ctx.qry.path)
url = fmt("%s/%s", url, ctx.qry.path);
html_hidden("url", url);
}
if (incl_head && ctx.qry.head && ctx.repo->defbranch &&
strcmp(ctx.qry.head, ctx.repo->defbranch))
@@ -601,25 +601,25 @@ void cgit_print_pageheader(struct cgit_context *ctx)
html_attr(cgit_rooturl());
html("'><img src='");
html_attr(ctx->cfg.logo);
html("' alt='cgit logo'/></a></td>\n");
html("<td class='main'>");
if (ctx->repo) {
cgit_index_link("index", NULL, NULL, NULL, 0);
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> ");
html("<input type='submit' name='' value='switch'/>");
html("</form>");
} else
html_txt(ctx->cfg.root_title);
html("</td></tr>\n");
html("<tr><td class='sub'>");
if (ctx->repo) {
html_txt(ctx->repo->desc);
@@ -651,25 +651,25 @@ void cgit_print_pageheader(struct cgit_context *ctx)
cgit_stats_link("stats", NULL, hc(cmd, "stats"),
ctx->qry.head, NULL);
if (ctx->repo->readme)
reporevlink("about", "about", NULL,
hc(cmd, "about"), ctx->qry.head, NULL,
NULL);
html("</td><td class='form'>");
html("<form class='right' method='get' action='");
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);
html_option("committer", "committer", ctx->qry.grep);
html("</select>\n");
html("<input class='txt' type='text' size='10' name='q' value='");
html_attr(ctx->qry.search);
html("'/>\n");
html("<input type='submit' value='search'/>\n");
html("</form>\n");
} else {
site_link(NULL, "index", NULL, hc(cmd, "repolist"), NULL, 0);