mirror of
https://github.com/anope/anope.git
synced 2026-07-02 16:13:12 +02:00
Allow specifying the webcpanel template directory directly.
There's no need to hardcode a base path here.
This commit is contained in:
@@ -774,8 +774,11 @@ module { name = "sasl" }
|
||||
/* Web server to use. */
|
||||
server = "httpd/main";
|
||||
|
||||
/* Template to use. */
|
||||
template = "default";
|
||||
/*
|
||||
* The directory containing the webcpanel templates. This is relative to the
|
||||
* data directory.
|
||||
*/
|
||||
template_dir = "webcpanel/templates/default";
|
||||
|
||||
/* Page title. */
|
||||
title = "Anope IRC Services";
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "webcpanel.h"
|
||||
|
||||
Module *me;
|
||||
Anope::string provider_name, template_name, template_base, page_title;
|
||||
Anope::string provider_name, template_base, page_title;
|
||||
|
||||
class ModuleWebCPanel final
|
||||
: public Module
|
||||
@@ -60,8 +60,7 @@ public:
|
||||
|
||||
Configuration::Block *block = Config->GetModule(this);
|
||||
provider_name = block->Get<const Anope::string>("server", "httpd/main");
|
||||
template_name = block->Get<const Anope::string>("template", "default");
|
||||
template_base = Anope::ExpandData("webcpanel/templates/" + template_name);
|
||||
template_base = Anope::ExpandData(block->Get<const Anope::string>("template_dir", "webcpanel/templates/default"));
|
||||
page_title = block->Get<const Anope::string>("title", "Anope IRC Services");
|
||||
|
||||
provider = ServiceReference<HTTPProvider>("HTTPProvider", provider_name);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
extern Module *me;
|
||||
|
||||
extern Anope::string provider_name, template_name, template_base, page_title;
|
||||
extern Anope::string provider_name, template_base, page_title;
|
||||
|
||||
struct SubSection final
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user