Fork de wikipp, le moteur de wiki en c++, basé sur cppcms. Le fork ajoute la langue française
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

page_content.h 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef PAGE_CONTENT_H
  2. #define PAGE_CONTENT_H
  3. #include "master_content.h"
  4. namespace content {
  5. typedef std::list<std::pair<int,std::string> > diff_t;
  6. struct page_form : public cppcms::form {
  7. apps::wiki *w;
  8. cppcms::widgets::text title;
  9. cppcms::widgets::textarea content;
  10. cppcms::widgets::textarea sidebar;
  11. cppcms::widgets::submit save;
  12. cppcms::widgets::submit save_cont;
  13. cppcms::widgets::submit preview;
  14. cppcms::widgets::checkbox users_only;
  15. cppcms::form fields;
  16. cppcms::form buttons;
  17. page_form(apps::wiki *w);
  18. bool virtual validate();
  19. };
  20. struct page : public master {
  21. std::string title,content;
  22. std::string sidebar;
  23. std::string edit_link;
  24. std::string history_link;
  25. };
  26. struct page_hist: public page {
  27. int version;
  28. std::string rollback;
  29. time_t date;
  30. };
  31. struct edit_page: public page {
  32. page_form form;
  33. bool new_page;
  34. std::string back;
  35. std::string submit;
  36. edit_page(apps::wiki *w) : form(w),new_page(false) {}
  37. };
  38. struct history : public master {
  39. struct item {
  40. time_t update;
  41. std::string show_url;
  42. std::string edit_url;
  43. std::string diff_url;
  44. int version;
  45. std::string author;
  46. };
  47. std::vector<item> hist;
  48. std::string page;
  49. std::string title;
  50. std::string page_link;
  51. };
  52. struct diff: public master {
  53. std::string edit_v1,edit_v2;
  54. int v1,v2;
  55. diff_t content_diff_content;
  56. diff_t sidebar_diff_content;
  57. std::string title,title_1,title_2;
  58. bool title_diff,content_diff,sidebar_diff,no_versions,no_diff;
  59. diff() :
  60. title_diff(false),content_diff(false),
  61. sidebar_diff(false),no_versions(false),
  62. no_diff(false)
  63. {
  64. }
  65. };
  66. } // namespace content
  67. #endif