diff --git a/modules/admin_panel/admin_panel.cpp b/modules/admin_panel/admin_panel.cpp index df9987c..338a1e6 100644 --- a/modules/admin_panel/admin_panel.cpp +++ b/modules/admin_panel/admin_panel.cpp @@ -32,7 +32,9 @@ void AdminPanel::handle_request_main(Request *request) { return; } + render_headers(request); render_controller_panel(request, c); + render_footer(request); //request->pop_path(); @@ -44,7 +46,7 @@ void AdminPanel::handle_request_main(Request *request) { } void AdminPanel::render_admin_panel_list(Request *request) { - //set up headers + render_headers(request); String rootlink = request->get_url_root(); @@ -80,7 +82,7 @@ void AdminPanel::render_admin_panel_list(Request *request) { b.cdiv(); - //set up footers + render_footer(request); request->body += b.result; request->compile_and_send_body(); @@ -106,6 +108,21 @@ void AdminPanel::clear() { _controllers.clear(); } +void AdminPanel::render_headers(Request *request) { + request->head += _default_headers; +} + +void AdminPanel::render_footer(Request *request) { + request->body += _default_footer; +} + +void AdminPanel::set_default_header(const String &val) { + _default_headers = val; +} +void AdminPanel::set_default_footer(const String &val) { + _default_footer = val; +} + AdminPanel *AdminPanel::get_singleton() { return _self; } diff --git a/modules/admin_panel/admin_panel.h b/modules/admin_panel/admin_panel.h index eb717a4..2056840 100644 --- a/modules/admin_panel/admin_panel.h +++ b/modules/admin_panel/admin_panel.h @@ -22,6 +22,12 @@ public: void register_admin_controller(const String §ion, AdminController *controller); void clear(); + virtual void render_headers(Request *request); + virtual void render_footer(Request *request); + + void set_default_header(const String &val); + void set_default_footer(const String &val); + static AdminPanel *get_singleton(); AdminPanel(); @@ -37,6 +43,9 @@ protected: static AdminPanel *_self; Vector _controllers; + + String _default_headers; + String _default_footer; }; #endif \ No newline at end of file