本文整理汇总了C++中Assets_Header类的典型用法代码示例。如果您正苦于以下问题:C++ Assets_Header类的具体用法?C++ Assets_Header怎么用?C++ Assets_Header使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Assets_Header类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: collaboration_password
string collaboration_password (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
string page;
Assets_Header header = Assets_Header (translate("Collaboration"), request);
page = header.run ();
Assets_View view;
string object = request->query ["object"];
view.set_variable ("object", object);
if (request->post.count ("url")) {
string url = request->post["urlvalue"];
Database_Config_Bible::setRemoteRepositoryUrl (object, url);
}
string url = Database_Config_Bible::getRemoteRepositoryUrl (object);
view.set_variable ("url", url);
page += view.render ("collaboration", "password");
page += Assets_Page::footer ();
return page;
}
示例2: notes_bible_n
string notes_bible_n (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
Database_Notes database_notes (webserver_request);
Notes_Logic notes_logic = Notes_Logic (webserver_request);
string page;
Assets_Header header = Assets_Header (translate("Bibles"), request);
page += header.run ();
Assets_View view;
string bibleblock;
vector <string> bibles = access_bible_bibles (webserver_request);
bibles.push_back (notes_logic.generalBibleName ());
for (auto & bible : bibles) {
bibleblock.append ("<li><a href=\"bulk?bible=" + bible + "\">" + bible + "</a></li>\n");
}
view.set_variable ("bibleblock", bibleblock);
page += view.render ("notes", "bible-n");
page += Assets_Page::footer ();
return page;
}
示例3: resource_admin
string resource_admin (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
string page;
Assets_Header header = Assets_Header (translate("Resources"), request);
header.addBreadCrumb (menu_logic_settings_menu (), menu_logic_settings_text ());
page = header.run ();
Assets_View view;
vector <string> resources = resource_external_names ();
string resourceblock;
for (auto & resource : resources) {
resourceblock.append ("<p>");
resourceblock.append ("<a href=\"download?name=" + resource + "\" title=\"" + translate("Download resource") + "\">" + resource + "</a>");
resourceblock.append ("</p>\n");
}
view.set_variable ("resourceblock", resourceblock);
page += view.render ("resource", "admin");
page += Assets_Page::footer ();
return page;
}
示例4: notes_assign_n
string notes_assign_n (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
Database_Notes database_notes (webserver_request);
Notes_Logic notes_logic = Notes_Logic (webserver_request);
Database_NoteAssignment database_noteassignment;
string page;
Assets_Header header = Assets_Header (translate("Assign notes"), request);
page += header.run();
Assets_View view;
string user = request->session_logic ()->currentUser ();
// Notes can be assigned to the assignees.
string userblock;
vector <string> assignees = database_noteassignment.assignees (user);
for (auto & assignee : assignees) {
userblock.append ("<li><a href=\"bulk?assign=" + assignee + "\">" + assignee + "</a></li>\n");
}
view.set_variable ("userblock", userblock);
page += view.render ("notes", "assign-n");
page += Assets_Page::footer ();
return page;
}
示例5: public_create
string public_create (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
Database_Notes database_notes (webserver_request);
Notes_Logic notes_logic = Notes_Logic (webserver_request);
string page;
Assets_Header header = Assets_Header (translate("Create note"), request);
page += header.run ();
Assets_View view;
string bible = request->database_config_user()->getBible ();
int book = Ipc_Focus::getBook (webserver_request);
int chapter = Ipc_Focus::getChapter (webserver_request);
int verse = Ipc_Focus::getVerse (webserver_request);
string chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter);
string verse_usfm = usfm_get_verse_text (chapter_usfm, verse);
string stylesheet = Database_Config_Bible::getExportStylesheet (bible);
Filter_Text filter_text = Filter_Text (bible);
filter_text.html_text_standard = new Html_Text (bible);
filter_text.addUsfmCode (verse_usfm);
filter_text.run (stylesheet);
string versetext = filter_text.html_text_standard->getInnerHtml ();
view.set_variable ("versetext", versetext);
if (request->post.count ("submit")) {
string summary = filter_string_trim (request->post["summary"]);
if (summary.empty ()) summary = translate ("Feedback");
string contents = "<p>" + versetext + "</p>" + filter_string_trim (request->post["contents"]);
int identifier = notes_logic.createNote (bible, book, chapter, verse, summary, contents, false);
// A note created by a public user is made public to all.
database_notes.setPublic (identifier, true);
// Subscribe the user to the note.
// Then the user receives email about any updates made on this note.
database_notes.subscribe (identifier);
// Go to the main public notes page.
redirect_browser (request, public_index_url ());
return "";
}
if (request->post.count ("cancel")) {
redirect_browser (request, public_index_url ());
return "";
}
string passage = filter_passage_display (book, chapter, convert_to_string (verse));
view.set_variable ("passage", passage);
page += view.render ("public", "create");
page += Assets_Page::footer ();
return page;
}
示例6: xrefs_translate
string xrefs_translate (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
string sourceBible = request->database_config_user()->getSourceXrefBible ();
string targetBible = request->database_config_user()->getTargetXrefBible ();
// Save book / abbreviation pair.
if (request->post.count ("save")) {
string fullname = request->post ["fullname"];
string abbreviation = request->post ["abbreviation"];
string abbreviations = Database_Config_Bible::getBookAbbreviations (targetBible);
abbreviations = filter_abbreviations_add (abbreviations, fullname, abbreviation);
Database_Config_Bible::setBookAbbreviations (targetBible, abbreviations);
}
string abbrevs = Database_Config_Bible::getBookAbbreviations (sourceBible);
vector <pair <int, string> > sourceAbbreviations = filter_abbreviations_read (abbrevs);
vector <int> sourceBooks;
for (auto element : sourceAbbreviations) sourceBooks.push_back (element.first);
abbrevs = Database_Config_Bible::getBookAbbreviations (targetBible);
vector <pair <int, string> > targetAbbreviations = filter_abbreviations_read (abbrevs);
vector <int> targetBooks;
for (auto element : targetAbbreviations) targetBooks.push_back (element.first);
vector <int> unknown_books = filter_string_array_diff (sourceBooks, targetBooks);
unknown_books = array_unique (unknown_books);
if (unknown_books.empty ()) {
redirect_browser (request, xrefs_clear_url ());
return "";
}
string page;
Assets_Header header = Assets_Header (translate("Cross references"), webserver_request);
page = header.run ();
Assets_View view;
view.set_variable ("remaining", convert_to_string (unknown_books.size () - 1));
string bookname = Database_Books::getEnglishFromId (unknown_books [0]);
view.set_variable ("bookname", bookname);
page += view.render ("xrefs", "translate");
page += Assets_Page::footer ();
return page;
}
示例7: xrefs_help
string xrefs_help (void * webserver_request)
{
string page;
Assets_Header header = Assets_Header (translate("Cross references"), webserver_request);
page = header.run ();
Assets_View view;
page += view.render ("xrefs", "help");
page += Assets_Page::footer ();
return page;
}
示例8: basic_index
string basic_index (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
Assets_Header header = Assets_Header ("Settings", webserver_request);
string page = header.run ();
Assets_View view;
if (request->query.count ("changebible")) {
string changebible = request->query ["changebible"];
if (changebible == "") {
Dialog_List dialog_list = Dialog_List ("index", translate("Select which Bible to make the active one for editing"), "", "");
vector <string> bibles = access_bible_bibles (request);
for (auto & bible : bibles) {
dialog_list.add_row (bible, "changebible", bible);
}
page += dialog_list.run();
return page;
} else {
request->database_config_user()->setBible (changebible);
// Going to another Bible, ensure that the focused book exists there.
int book = Ipc_Focus::getBook (request);
vector <int> books = request->database_bibles()->getBooks (changebible);
if (find (books.begin(), books.end(), book) == books.end()) {
if (!books.empty ()) book = books [0];
else book = 0;
Ipc_Focus::set (request, book, 1, 1);
}
}
}
string bible = access_bible_clamp (request, request->database_config_user()->getBible ());
view.set_variable ("bible", bible);
#ifdef CLIENT_PREPARED
view.enable_zone ("client");
if (client_logic_client_enabled ()) {
view.enable_zone ("connected");
}
#else
view.enable_zone ("cloud");
#endif
page += view.render ("basic", "index");
page += Assets_Page::footer ();
return page;
}
示例9: bible_abbreviations
string bible_abbreviations (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
string page;
Assets_Header header = Assets_Header (translate("Abbreviations"), webserver_request);
header.addBreadCrumb (menu_logic_settings_menu (), menu_logic_settings_text ());
header.addBreadCrumb (bible_manage_url (), menu_logic_bible_manage_text ());
page = header.run ();
Assets_View view;
string success_message;
string error_message;
// The name of the Bible.
string bible = access_bible_clamp (request, request->query ["bible"]);
view.set_variable ("bible", filter_string_sanitize_html (bible));
// Data submission.
if (request->post.count ("submit")) {
string data = request->post ["data"];
data = filter_string_trim (data);
if (data != "") {
if (unicode_string_is_valid (data)) {
Database_Config_Bible::setBookAbbreviations (bible, data);
success_message = translate("The abbreviations were saved.");
} else {
error_message = translate("Please supply valid Unicode UTF-8 text.");
}
} else {
success_message = translate("Nothing was saved.");
}
}
string data = Database_Config_Bible::getBookAbbreviations (bible);
data = filter_abbreviations_display (data);
view.set_variable ("data", data);
view.set_variable ("success_message", success_message);
view.set_variable ("error_message", error_message);
page += view.render ("bible", "abbreviations");
page += Assets_Page::footer ();
return page;
}
示例10: notes_assign_1
string notes_assign_1 (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
Database_Notes database_notes (webserver_request);
Notes_Logic notes_logic = Notes_Logic (webserver_request);
Database_NoteAssignment database_noteassignment;
string page;
Assets_Header header = Assets_Header (translate("Assign note"), request);
page += header.run();
Assets_View view;
string success, error;
string user = request->session_logic ()->currentUser ();
int id = convert_to_int (request->query ["id"]);
view.set_variable ("id", convert_to_string (id));
if (request->query.count ("assign")) {
string assign = request->query ["assign"];
if (database_noteassignment.exists (user, assign)) {
notes_logic.assignUser (id, assign);
}
redirect_browser (request, notes_actions_url () + "?id=" + convert_to_string (id));
return "";
}
// Note assignees.
string userblock;
vector <string> assignees = database_noteassignment.assignees (user);
for (auto & assignee : assignees) {
userblock.append ("<li><a href=\"assign-1?id=" + convert_to_string (id) + "&assign=" + assignee + "\">" + assignee + "</a></li>\n");
}
view.set_variable ("userblock", userblock);
view.set_variable ("success", success);
view.set_variable ("error", error);
page += view.render ("notes", "assign-1");
page += Assets_Page::footer ();
return page;
}
示例11: search_replace2
string search_replace2 (void * webserver_request)
{
// Build the advanced replace page.
Webserver_Request * request = (Webserver_Request *) webserver_request;
string bible = request->database_config_user()->getBible ();
string page;
Assets_Header header = Assets_Header (translate("Replace"), request);
header.addBreadCrumb (menu_logic_search_menu (), menu_logic_search_text ());
page = header.run ();
Assets_View view;
view.set_variable ("bible", bible);
string script = "var searchBible = \"" + bible + "\";";
view.set_variable ("script", script);
page += view.render ("search", "replace2");
page += Assets_Page::footer ();
return page;
}
示例12: index_index
string index_index (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
Assets_Header header = Assets_Header ("Bibledit", webserver_request);
if (config_logic_demo_enabled ()) {
// The demo, when there's no active menu, forwards to a the active workbench.
if (request->query.empty ()) {
header.refresh (5, "/" + workbench_index_url ());
}
}
// Mode toggle: basic <> advanced.
string mode = request->query ["mode"];
if (!mode.empty ()) {
int flip = false;
if (mode == "basic") {
if (!request->session_logic ()->touchEnabled ()) {
flip = true;
}
}
if (mode == "advanced") {
if (request->session_logic ()->touchEnabled ()) {
flip = true;
}
}
request->database_config_user ()->setFlipInterfaceMode (flip);
}
// Normally a page does not show the expanded main menu.
// This is to save space on the screen.
// But the home page of Bibledit show the extended main menu.
if (request->query.count ("item") == 0) {
request->query ["item"] = "main";
}
string page = header.run ();
Assets_View view;
page += view.render ("index", "index");
page += Assets_Page::footer ();
return page;
}
示例13: administration_timezone
string administration_timezone (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
string page;
Assets_Header header = Assets_Header (translate("Timezone"), webserver_request);
header.addBreadCrumb (menu_logic_settings_menu (), menu_logic_settings_text ());
page = header.run ();
Assets_View view;
string success;
string error;
if (request->post.count ("submit")) {
string input = request->post ["timezone"];
input = filter_string_str_replace ("UTC", "", input);
int timezone = convert_to_int (input);
bool clipped = false;
if (timezone < MINIMUM_TIMEZONE) {
timezone = MINIMUM_TIMEZONE;
clipped = true;
}
if (timezone > MAXIMUM_TIMEZONE) {
timezone = MAXIMUM_TIMEZONE;
clipped = true;
}
if (clipped) error = translate ("The timezone was clipped");
Database_Config_General::setTimezone (timezone);
success = translate ("The timezone was saved");
}
int timezone = Database_Config_General::getTimezone();
view.set_variable ("timezone", convert_to_string (timezone));
view.set_variable ("success", success);
view.set_variable ("error", error);
page += view.render ("administration", "timezone");
page += Assets_Page::footer ();
return page;
}
示例14: public_comment
string public_comment (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
Database_Notes database_notes (webserver_request);
Notes_Logic notes_logic = Notes_Logic (webserver_request);
string page;
Assets_Header header = Assets_Header (translate("Feedback"), request);
page += header.run();
Assets_View view;
int id = convert_to_int (request->query ["id"]);
view.set_variable ("id", convert_to_string (id));
if (request->post.count ("submit")) {
string comment = filter_string_trim (request->post ["comment"]);
notes_logic.addComment (id, comment);
redirect_browser (request, public_note_url () + "?id=" + convert_to_string (id));
return "";
}
if (request->post.count ("cancel")) {
redirect_browser (request, public_note_url () + "?id=" + convert_to_string (id));
return "";
}
string summary = database_notes.getSummary (id);
view.set_variable ("summary", summary);
string content = database_notes.getContents (id);
view.set_variable ("content", content);
page += view.render ("public", "comment");
page += Assets_Page::footer ();
return page;
}
示例15: session_switch
string session_switch (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
string page;
Assets_Header header = Assets_Header (translate ("Switch user"), webserver_request);
page += header.run ();
Assets_View view;
string user = request->session_logic ()->currentUser ();
view.set_variable ("user", user);
page += view.render ("session", "switch");
page += Assets_Page::footer ();
return page;
}