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" 51 " <div id=\"header\">" 52 "<a id=\"logo\" href=\"/\"/><img src=\"/static/webview.png\" alt=\"Fawkes WebView\"/></a>" 60 __nav_manager = nav_manager;
65 std::string &active_baseurl,
66 std::string &html_header)
72 if ( asprintf(&s, PAGE_HEADER, title.c_str(), hi.
short_name(),
73 html_header.c_str()) != -1 )
79 rv +=
" <div id=\"mainnav\" class=\"nav\"><ul>";
80 WebNavManager::NavMap::const_iterator nei;
82 for (nei = nav_entries.begin(); nei != nav_entries.end(); ++nei) {
84 if ( nei->first == active_baseurl ) {
85 rv +=
" class=\"active\"";
87 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.