author | Lars Hjemli <hjemli@gmail.com> | 2006-12-28 01:01:49 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2006-12-28 01:01:49 (UTC) |
commit | e39d738c39d37cdef115c145027f3eec85a62272 (patch) (unidiff) | |
tree | be60a07674a0d118d42f572a35b62ada9529a6bd /html.c | |
parent | 27cd3b2a700e1cc46cd0393ddea48c07b62ee3a6 (diff) | |
download | cgit-e39d738c39d37cdef115c145027f3eec85a62272.zip cgit-e39d738c39d37cdef115c145027f3eec85a62272.tar.gz cgit-e39d738c39d37cdef115c145027f3eec85a62272.tar.bz2 |
Add generic support for search box in page header
This adds the ability to show a search box in any pageheader with correct href and
hidden form data, but does not enable the box on any pages.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | html.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -112,16 +112,25 @@ void html_attr(char *txt) | |||
112 | txt = t+1; | 112 | txt = t+1; |
113 | } | 113 | } |
114 | t++; | 114 | t++; |
115 | } | 115 | } |
116 | if (t!=txt) | 116 | if (t!=txt) |
117 | html(txt); | 117 | html(txt); |
118 | } | 118 | } |
119 | 119 | ||
120 | void html_hidden(char *name, char *value) | ||
121 | { | ||
122 | html("<input type='hidden' name='"); | ||
123 | html_attr(name); | ||
124 | html("' value='"); | ||
125 | html_attr(value); | ||
126 | html("'/>"); | ||
127 | } | ||
128 | |||
120 | void html_link_open(char *url, char *title, char *class) | 129 | void html_link_open(char *url, char *title, char *class) |
121 | { | 130 | { |
122 | html("<a href='"); | 131 | html("<a href='"); |
123 | html_attr(url); | 132 | html_attr(url); |
124 | if (title) { | 133 | if (title) { |
125 | html("' title='"); | 134 | html("' title='"); |
126 | html_attr(title); | 135 | html_attr(title); |
127 | } | 136 | } |
@@ -150,8 +159,9 @@ void html_filemode(unsigned short mode) | |||
150 | else if (S_ISLNK(mode)) | 159 | else if (S_ISLNK(mode)) |
151 | html("l"); | 160 | html("l"); |
152 | else | 161 | else |
153 | html("-"); | 162 | html("-"); |
154 | html_fileperm(mode >> 6); | 163 | html_fileperm(mode >> 6); |
155 | html_fileperm(mode >> 3); | 164 | html_fileperm(mode >> 3); |
156 | html_fileperm(mode); | 165 | html_fileperm(mode); |
157 | } | 166 | } |
167 | |||