23 #include "header_generator.h" 25 #include <utils/system/hostinfo.h> 26 #include <webview/nav_manager.h> 40 const char * WebviewHeaderGenerator::PAGE_HEADER =
43 " <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" />\n" 44 " <meta http-equiv=\"Content-Language\" content=\"en-us\" />\n" 45 " <title>%s (%s)</title>\n" 46 " <link rel=\"icon\" type=\"image/png\" href=\"/static/images/favicon.png\" />\n" 47 " <link rel=\"stylesheet\" type=\"text/css\" href=\"/static/css/webview.css\" />\n" 57 __nav_manager = nav_manager;
62 std::string &active_baseurl,
63 std::string &html_header)
69 if ( asprintf(&s, PAGE_HEADER, title.c_str(), hi.
short_name(),
70 html_header.c_str()) != -1 )
77 " <div id=\"mainnav\" class=\"nav\"><a id=\"logo\" href=\"/\"/>" 78 "<img class=\"navlogo\" src=\"/static/chrome/navlogo.png\" /></a><ul>";
79 WebNavManager::NavMap::const_iterator nei;
81 for (nei = nav_entries.begin(); nei != nav_entries.end(); ++nei) {
83 if ( nei->first == active_baseurl ) {
84 rv +=
" class=\"active\"";
86 rv +=
"><a href=\"" + nei->first +
"\">" + nei->second +
"</a></li>";
const char * short_name()
Get short hostname (up to first dot).
Fawkes library namespace.
std::map< std::string, std::string > NavMap
Navigation map type, mapping URLs to labels.
Manage visible navigation entries.