本文整理汇总了C++中Assets_View类的典型用法代码示例。如果您正苦于以下问题:C++ Assets_View类的具体用法?C++ Assets_View怎么用?C++ Assets_View使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Assets_View类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: manage_indexing
string manage_indexing (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
string page;
page = Assets_Page::header (translate ("Indexing"), webserver_request, "");
Assets_View view = Assets_View ();
string refresh = request->query ["refresh"];
if (refresh == "bibles") {
tasks_logic_queue (REINDEXBIBLES);
redirect_browser (request, journal_index_url ());
return "";
}
if (refresh == "notes") {
tasks_logic_queue (REINDEXNOTES);
redirect_browser (request, journal_index_url ());
return "";
}
page += view.render ("manage", "indexing");
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: Assets_View
Dialog_Color::Dialog_Color (string url, string question)
{
Assets_View * view = new Assets_View ();
base_url = url;
view->set_variable ("question", question);
assets_view = view;
}
示例6: 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;
}
示例7: 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;
}
示例8: run
string Dialog_Color::run ()
{
Assets_View * view = (Assets_View *) assets_view;
view->set_variable ("base_url", base_url);
string page = view->render ("dialog", "color");
page += Assets_Page::footer ();
return page;
}
示例9: 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;
}
示例10: checks_suppress
string checks_suppress (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
Database_Check database_check;
string page;
page = Assets_Page::header (translate ("Suppressed check results"), webserver_request);
Assets_View view;
if (request->query.count ("release")) {
int release = convert_to_int (request->query["release"]);
database_check.release (release);
view.set_variable ("success", translate("The check result is no longer suppressed."));
}
// Get the Bibles the user has write-access to.
vector <string> bibles;
{
vector <string> all_bibles = request->database_bibles()->getBibles ();
for (auto bible : all_bibles) {
if (access_bible_write (webserver_request, bible)) {
bibles.push_back (bible);
}
}
}
string block;
vector <Database_Check_Hit> suppressions = database_check.getSuppressions ();
for (auto suppression : suppressions) {
string bible = suppression.bible;
// Only display entries for Bibles the user has write access to.
if (in_array (bible, bibles)) {
int id = suppression.rowid;
bible = filter_string_sanitize_html (bible);
string passage = filter_passage_display_inline ({Passage ("", suppression.book, suppression.chapter, convert_to_string (suppression.verse))});
string result = filter_string_sanitize_html (suppression.data);
result.insert (0, bible + " " + passage + " ");
block.append ("<p style=\"color:grey;\">\n");
block.append ("<a href=\"suppress?release=" + convert_to_string (id) + "\">\n");
block.append (emoji_wastebasket () + "\n");
block.append ("</a>\n");
block.append (result + "\n");
block.append ("</p>\n");
}
}
view.set_variable ("block", block);
page += view.render ("checks", "suppress");
page += Assets_Page::footer ();
return page;
}
示例11: editone_preview
string editone_preview (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
bool touch = request->session_logic ()->touchEnabled ();
string page;
Assets_Header header = Assets_Header (translate("Preview"), request);
header.setNavigator ();
header.setEditorStylesheet ();
if (touch) header.jQueryTouchOn ();
header.addBreadCrumb (menu_logic_translate_menu (), menu_logic_translate_text ());
header.refresh (5, "index");
page = header.run ();
Assets_View view;
// Get active Bible, and check read access to it.
// If needed, change Bible to one it has read access to.
string bible = access_bible_clamp (request, request->database_config_user()->getBible ());
string cls = Filter_Css::getClass (bible);
string font = Fonts_Logic::getTextFont (bible);
int direction = Database_Config_Bible::getTextDirection (bible);
int lineheight = Database_Config_Bible::getLineHeight (bible);
int letterspacing = Database_Config_Bible::getLetterSpacing (bible);
view.set_variable ("custom_class", cls);
view.set_variable ("custom_css", Filter_Css::getCss (cls,
Fonts_Logic::getFontPath (font),
direction,
lineheight,
letterspacing));
int book = Ipc_Focus::getBook (webserver_request);
int chapter = Ipc_Focus::getChapter (webserver_request);
//int verse = Ipc_Focus::getVerse (webserver_request);
string stylesheet = request->database_config_user()->getStylesheet ();
string usfm = request->database_bibles()->getChapter (bible, book, chapter);
Editor_Usfm2Html editor_usfm2html;
editor_usfm2html.load (usfm);
editor_usfm2html.stylesheet (stylesheet);
editor_usfm2html.run ();
string html = editor_usfm2html.get ();
view.set_variable ("html", html);
page += view.render ("editone", "preview");
page += Assets_Page::footer ();
return page;
}
示例12: 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;
}
示例13: 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;
}
示例14: 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;
}
示例15: 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;
}