- mod_yparser: add a command to create comments

This commit is contained in:
svenhoefer
2012-07-26 21:45:15 +02:00
parent 84e94ad4ca
commit 03132b1f95

View File

@@ -353,6 +353,7 @@ std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// ycgi : cmd executing // ycgi : cmd executing
// comment:<y-comment>~<html-comment>
// script:<scriptname without .sh> // script:<scriptname without .sh>
// include:<filename> // include:<filename>
// func:<funcname> (funcname to be implemented in CyParser::YWeb_cgi_func) // func:<funcname> (funcname to be implemented in CyParser::YWeb_cgi_func)
@@ -377,7 +378,13 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) {
if (ySplitString(ycmd, ":", ycmd_type, ycmd_name)) { if (ySplitString(ycmd, ":", ycmd_type, ycmd_name)) {
if (ycmd_type == "L") if (ycmd_type == "L")
yresult = CLanguage::getInstance()->getTranslation(ycmd_name); yresult = CLanguage::getInstance()->getTranslation(ycmd_name);
else if (ycmd_type == "script") else if (ycmd_type == "comment") {
std::string comment_y, comment_html;
if (ySplitString(ycmd_name, "~", comment_y, comment_html)) {
if (comment_html != "")
yresult = "<!-- " + comment_html + " -->";
}
} else if (ycmd_type == "script")
yresult = YexecuteScript(hh, ycmd_name); yresult = YexecuteScript(hh, ycmd_name);
else if (ycmd_type == "if-empty") { else if (ycmd_type == "if-empty") {
std::string if_value, if_then, if_else; std::string if_value, if_then, if_else;