rcpp_framework/modules/paged_list/paged_list.cpp

44 lines
786 B
C++
Raw Normal View History

2021-07-07 10:47:37 +02:00
#include "paged_list.h"
#include "core/http/request.h"
#include <iostream>
#include "core/file_cache.h"
#include "core/database/database_manager.h"
#include "core/html/html_builder.h"
2022-01-08 12:54:36 +01:00
void PagedList::handle_request_main(Request *request) {
const String path = request->get_current_path_segment();
2021-07-07 10:47:37 +02:00
if (request->get_remaining_segment_count() == 0) {
2022-01-08 12:52:03 +01:00
main_page->handle_request_main(request);
2021-07-07 10:47:37 +02:00
return;
}
articles->handle_request_main(request);
2021-07-07 10:47:37 +02:00
}
void PagedList::load() {
main_page->folder = folder;
main_page->load();
articles->base_path = base_path;
articles->folder = folder;
articles->load();
}
PagedList::PagedList() :
2022-01-08 12:54:36 +01:00
WebNode() {
2021-07-07 10:47:37 +02:00
main_page = new ListPage();
articles = new PagedArticle();
}
PagedList::~PagedList() {
delete main_page;
delete articles;
}