rcpp_framework/modules/admin_panel/admin_panel.h

57 lines
1.3 KiB
C
Raw Normal View History

2021-10-31 23:11:48 +01:00
#ifndef ADMIN_PANEL_H
#define ADMIN_PANEL_H
#include "core/http/controller.h"
#include "core/string.h"
#include "core/containers/vector.h"
2021-10-31 23:11:48 +01:00
class Request;
class FormValidator;
class AdminController;
2021-10-31 23:11:48 +01:00
class AdminPanel : public Controller {
RCPP_OBJECT(AdminPanel, Controller);
public:
void handle_request_main(Request *request);
virtual void render_admin_panel_list(Request *request);
virtual void render_controller_panel(Request *request, AdminController *controller);
void register_admin_controller(const String &section, AdminController *controller);
void clear();
2021-10-31 23:11:48 +01:00
virtual void render_headers(Request *request);
virtual void render_main_body_top(Request *request);
virtual void render_segment_body_top(Request *request);
virtual void render_footer(Request *request);
void set_default_header(const String &val);
void set_default_main_body_top(const String &val);
void set_default_segment_body_top(const String &val);
void set_default_footer(const String &val);
2021-10-31 23:11:48 +01:00
static AdminPanel *get_singleton();
AdminPanel();
~AdminPanel();
protected:
struct AdminPanelSection {
String section_url;
String name;
AdminController *controller;
};
2021-10-31 23:11:48 +01:00
static AdminPanel *_self;
Vector<AdminPanelSection> _controllers;
String _default_headers;
String _default_main_body_top;
String _default_segment_body_top;
String _default_footer;
2021-10-31 23:11:48 +01:00
};
#endif