2021-10-31 23:11:48 +01:00
|
|
|
#ifndef ADMIN_PANEL_H
|
|
|
|
#define ADMIN_PANEL_H
|
|
|
|
|
|
|
|
#include "core/http/controller.h"
|
|
|
|
|
2021-11-01 00:39:39 +01:00
|
|
|
#include "core/string.h"
|
|
|
|
#include "core/containers/vector.h"
|
2021-10-31 23:11:48 +01:00
|
|
|
|
|
|
|
class Request;
|
|
|
|
class FormValidator;
|
2021-11-01 00:39:39 +01:00
|
|
|
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);
|
2021-11-01 00:39:39 +01:00
|
|
|
|
|
|
|
virtual void render_admin_panel_list(Request *request);
|
|
|
|
virtual void render_controller_panel(Request *request, AdminController *controller);
|
|
|
|
|
|
|
|
void register_admin_controller(const String §ion, AdminController *controller);
|
|
|
|
void clear();
|
2021-10-31 23:11:48 +01:00
|
|
|
|
|
|
|
static AdminPanel *get_singleton();
|
|
|
|
|
|
|
|
AdminPanel();
|
|
|
|
~AdminPanel();
|
|
|
|
|
|
|
|
protected:
|
2021-11-01 00:39:39 +01:00
|
|
|
struct AdminPanelSection {
|
|
|
|
String section_url;
|
|
|
|
AdminController *controller;
|
|
|
|
};
|
|
|
|
|
2021-10-31 23:11:48 +01:00
|
|
|
static AdminPanel *_self;
|
2021-11-01 00:39:39 +01:00
|
|
|
|
|
|
|
Vector<AdminPanelSection> _controllers;
|
2021-10-31 23:11:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|