author | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 10:19:31 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 10:19:31 (UTC) |
commit | ef0c6aadf70e33ef63f0a68ca16338a49d0a3f1f (patch) (side-by-side diff) | |
tree | 4115c32dc27aa18840dda2c940ca10b4a7d0cf86 | |
parent | 0cbb50841ac82e08e715bbff614f96c7d5ba22fa (diff) | |
download | cgit-ef0c6aadf70e33ef63f0a68ca16338a49d0a3f1f.zip cgit-ef0c6aadf70e33ef63f0a68ca16338a49d0a3f1f.tar.gz cgit-ef0c6aadf70e33ef63f0a68ca16338a49d0a3f1f.tar.bz2 |
Add support for 'noheader' option
This option can be used to disable the standard cgit page header, which
might be useful in combination with the 'embedded' option.
Suggested-by: Mark Constable <markc@renta.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.c | 2 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | ui-shared.c | 20 |
3 files changed, 16 insertions, 7 deletions
@@ -51,2 +51,4 @@ void config_cb(const char *name, const char *value) ctx.cfg.nocache = atoi(value); + else if (!strcmp(name, "noheader")) + ctx.cfg.noheader = atoi(value); else if (!strcmp(name, "snapshots")) @@ -174,2 +174,3 @@ struct cgit_config { int embedded; + int noheader; }; diff --git a/ui-shared.c b/ui-shared.c index f18b2c7..5e03a7a 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -613,10 +613,4 @@ char *hc(struct cgit_cmd *cmd, const char *page) -void cgit_print_pageheader(struct cgit_context *ctx) +static void print_header(struct cgit_context *ctx) { - struct cgit_cmd *cmd = cgit_get_cmd(ctx); - - if (!cmd && ctx->repo) - fallback_cmd = "summary"; - - html("<div id='cgit'>"); html("<table id='header'>\n"); @@ -661,2 +655,14 @@ void cgit_print_pageheader(struct cgit_context *ctx) html("</td></tr></table>\n"); +} + +void cgit_print_pageheader(struct cgit_context *ctx) +{ + struct cgit_cmd *cmd = cgit_get_cmd(ctx); + + if (!cmd && ctx->repo) + fallback_cmd = "summary"; + + html("<div id='cgit'>"); + if (!ctx->cfg.noheader) + print_header(ctx); |