diff --git a/modules/extra/webcpanel/pages/hostserv/request.cpp b/modules/extra/webcpanel/pages/hostserv/request.cpp index 2a44df221..6335b1a56 100644 --- a/modules/extra/webcpanel/pages/hostserv/request.cpp +++ b/modules/extra/webcpanel/pages/hostserv/request.cpp @@ -18,7 +18,7 @@ bool WebCPanel::HostServ::Request::OnRequest(HTTPProvider *server, const Anope:: std::vector params; params.push_back(HTTPUtils::URLDecode(message.post_data["req"])); - WebPanel::RunCommand(na->nc->display, na->nc, Config->HostServ, "hostserv/request", params, replacements); + WebPanel::RunCommand(na->nc->display, na->nc, Config->HostServ, "hostserv/request", params, replacements, "CMDR"); } if (na->HasVhost()) diff --git a/modules/extra/webcpanel/pages/memoserv/memos.cpp b/modules/extra/webcpanel/pages/memoserv/memos.cpp index 9fa36d3c4..db4fcfc1b 100644 --- a/modules/extra/webcpanel/pages/memoserv/memos.cpp +++ b/modules/extra/webcpanel/pages/memoserv/memos.cpp @@ -57,7 +57,7 @@ bool WebCPanel::MemoServ::Memos::OnRequest(HTTPProvider *server, const Anope::st params.push_back(HTTPUtils::URLDecode(message.post_data["receiver"])); params.push_back(HTTPUtils::URLDecode(message.post_data["message"])); - WebPanel::RunCommand(na->nc->display, na->nc, Config->MemoServ, "memoserv/send", params, replacements); + WebPanel::RunCommand(na->nc->display, na->nc, Config->MemoServ, "memoserv/send", params, replacements, "CMDR"); } if (message.get_data.count("del") > 0 && message.get_data.count("number") > 0) { @@ -66,7 +66,7 @@ bool WebCPanel::MemoServ::Memos::OnRequest(HTTPProvider *server, const Anope::st params.push_back(chname); params.push_back(message.get_data["number"]); - WebPanel::RunCommand(na->nc->display, na->nc, Config->MemoServ, "memoserv/del", params, replacements); + WebPanel::RunCommand(na->nc->display, na->nc, Config->MemoServ, "memoserv/del", params, replacements, "CMDR"); } if (message.get_data.count("read") > 0 && message.get_data.count("number") > 0) { diff --git a/modules/extra/webcpanel/templates/default/chanserv/main.html b/modules/extra/webcpanel/templates/default/chanserv/main.html index 99fec7d75..dd9288f00 100644 --- a/modules/extra/webcpanel/templates/default/chanserv/main.html +++ b/modules/extra/webcpanel/templates/default/chanserv/main.html @@ -1,6 +1,8 @@ {INCLUDE header.html} Channels you have access in:
+
{FOR CH,ECH IN CHANNEL_NAMES,ESCAPED_CHANNEL_NAMES} {CH}
{END FOR} +
{INCLUDE footer.html} diff --git a/modules/extra/webcpanel/templates/default/header.html b/modules/extra/webcpanel/templates/default/header.html index 38f367acc..3cb1cf372 100644 --- a/modules/extra/webcpanel/templates/default/header.html +++ b/modules/extra/webcpanel/templates/default/header.html @@ -2,9 +2,98 @@ + {TITLE} + {IF EXISTS CMDR} + + {END IF} +
+
+

Status Message:

+
+ +
+
+
    diff --git a/modules/extra/webcpanel/templates/default/memoserv/memos.html b/modules/extra/webcpanel/templates/default/memoserv/memos.html index 559efd35b..4239a926f 100644 --- a/modules/extra/webcpanel/templates/default/memoserv/memos.html +++ b/modules/extra/webcpanel/templates/default/memoserv/memos.html @@ -1,7 +1,7 @@ {INCLUDE header.html} Channels you have access in:
    {FOR CH,ECH IN CHANNEL_NAMES,ESCAPED_CHANNEL_NAMES} - {CH} + {CH} {END FOR}

    {FOR M IN MESSAGES} @@ -9,29 +9,48 @@ {END FOR}
    {IF EXISTS NUMBER} + Memos List: - +
    - - - + + + {FOR I,S,T,TXT,U IN NUMBER,SENDER,TIME,TEXT,UNREAD} - - - - {IF EQ U YES} - + {ELSE} - + {END IF} - - + + + - - - + {IF EQ U YES} + + + + + {ELSE} + + + + + {END IF} + {END FOR}
    NumberSenderTime/MessageNumberSenderTime/Message
    {I}{S}{T}Mark as Read
    Mark as Unread
    Delete{I}{S}{TXT}
    {TXT}
    Mark as Read   + Reply  + Delete
    Mark as Unread   + Reply   + Delete
    @@ -43,7 +62,7 @@ Send a new Memo
    - Receiver: + Receiver: Message:
    diff --git a/modules/extra/webcpanel/templates/default/style.css b/modules/extra/webcpanel/templates/default/style.css index 7934e4850..13b4e4759 100644 --- a/modules/extra/webcpanel/templates/default/style.css +++ b/modules/extra/webcpanel/templates/default/style.css @@ -3,6 +3,7 @@ font-family: 'Cabin', Helvetica, Arial, sans-serif; } body { overflow:hidden; + z-index: 10; } .master { margin-left:0px; @@ -101,6 +102,15 @@ body { height: 125px; } +.cinfo { + overflow-x: scroll; + height: 450px; +} + +.right { + text-align: right; +} +/* Table Stuff */ .akillR1 { width: 80px; text-align: left; @@ -114,7 +124,81 @@ body { text-align: left; } -.danger { - color: red; - weight: bolder; +td.right a:link, td.right a:visited { + color: #000; + background-color: #FFF; + border: 1px solid #000; + padding: 0px 4px; + -webkit-border-radius: 5x; + border-radius: 5px; + text-decoration: none; +} + +td.right a:hover { + color: #00F; +} + +table#memoTable { + border-spacing: 0px; + border-collapse: collapse; +} + +table#memoTable tr { + padding: 1px; +} + +tr.read { + background-color: #FFF; +} + +tr.unread { + background-color: #EEE; +} + +tr.read td, tr.unread td { + padding: 2px; +} + +/* Modal Window */ +#mask { + position: absolute; + z-index: 9000; + background-color: #000; + height: 100%; + width: 100%; + display: none; +} + +#boxes .window { + position:fixed; + width:440px; + height:200px; + display:none; + z-index:9999; + padding:20px; +} + +#boxes #dialog { + text-align: center; + background-color: #FFF; + width:375px; + height:203px; + padding: 20px; + -webkit-border-radius: 15px; + border-radius: 15px; + display: none; +} + +#dialogClose { + padding-top: 20px; +} + +#dialogClose a:link, #dialogClose a:visited { + color: #000; + text-decoration: none; +} + +#dialogClose a:hover { + color: #000; + text-decoration: underline; } diff --git a/modules/extra/webcpanel/webcpanel.cpp b/modules/extra/webcpanel/webcpanel.cpp index 9855e6771..77e99dd4e 100644 --- a/modules/extra/webcpanel/webcpanel.cpp +++ b/modules/extra/webcpanel/webcpanel.cpp @@ -217,12 +217,12 @@ class ModuleWebCPanel : public Module namespace WebPanel { - void RunCommand(const Anope::string &user, NickCore *nc, const Anope::string &service, const Anope::string &c, const std::vector ¶ms, TemplateFileServer::Replacements &r) + void RunCommand(const Anope::string &user, NickCore *nc, const Anope::string &service, const Anope::string &c, const std::vector ¶ms, TemplateFileServer::Replacements &r, const Anope::string &key) { ServiceReference cmd("Command", c); if (!cmd) { - r["MESSAGES"] = "Unable to find command " + c; + r[key] = "Unable to find command " + c; return; } @@ -237,15 +237,16 @@ namespace WebPanel struct MyComandReply : CommandReply { TemplateFileServer::Replacements &re; + const Anope::string &k; - MyComandReply(TemplateFileServer::Replacements &_r) : re(_r) { } + MyComandReply(TemplateFileServer::Replacements &_r, const Anope::string &_k) : re(_r), k(_k) { } void SendMessage(const BotInfo *source, const Anope::string &msg) anope_override { - re["MESSAGES"] = msg; + re[k] = msg; } } - my_reply(r); + my_reply(r, key); CommandSource source(user, NULL, nc, &my_reply, bi); cmd->Execute(source, params); diff --git a/modules/extra/webcpanel/webcpanel.h b/modules/extra/webcpanel/webcpanel.h index d7c8b99db..74a8805d4 100644 --- a/modules/extra/webcpanel/webcpanel.h +++ b/modules/extra/webcpanel/webcpanel.h @@ -145,9 +145,10 @@ namespace WebPanel * @param service Service for source.owner and source.service * @param c Command to run (as a service name) * @param params Command parameters - * @param r Replacements, reply from command goes back into r["MESSAGES"] + * @param r Replacements, reply from command goes back here into key + * @param key The key to put the replies into r */ - extern void RunCommand(const Anope::string &user, NickCore *nc, const Anope::string &service, const Anope::string &c, const std::vector ¶ms, TemplateFileServer::Replacements &r); + extern void RunCommand(const Anope::string &user, NickCore *nc, const Anope::string &service, const Anope::string &c, const std::vector ¶ms, TemplateFileServer::Replacements &r, const Anope::string &key = "MESSAGES"); } #include "pages/index.h"