本文整理汇总了PHP中Conf::resp_round_name_error方法的典型用法代码示例。如果您正苦于以下问题:PHP Conf::resp_round_name_error方法的具体用法?PHP Conf::resp_round_name_error怎么用?PHP Conf::resp_round_name_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conf
的用法示例。
在下文中一共展示了Conf::resp_round_name_error方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
function parse($sv, $si)
{
global $Conf;
if (!$sv->newv("resp_active")) {
return false;
}
$old_roundnames = $Conf->resp_round_list();
$roundnames = array(1);
$roundnames_set = array();
if (isset($sv->req["resp_roundname"])) {
$rname = trim(get_s($sv->req, "resp_roundname"));
if ($rname === "" || $rname === "none" || $rname === "1") {
/* do nothing */
} else {
if ($rerror = Conf::resp_round_name_error($rname)) {
$sv->set_error("resp_roundname", $rerror);
} else {
$roundnames[0] = $rname;
$roundnames_set[strtolower($rname)] = 0;
}
}
}
for ($i = 1; isset($sv->req["resp_roundname_{$i}"]); ++$i) {
$rname = trim(get_s($sv->req, "resp_roundname_{$i}"));
if ($rname === "" && get($old_roundnames, $i)) {
$rname = $old_roundnames[$i];
}
if ($rname === "") {
continue;
} else {
if ($rerror = Conf::resp_round_name_error($rname)) {
$sv->set_error("resp_roundname_{$i}", $rerror);
} else {
if (get($roundnames_set, strtolower($rname)) !== null) {
$sv->set_error("resp_roundname_{$i}", "Response round name “" . htmlspecialchars($rname) . "” has already been used.");
} else {
$roundnames[] = $rname;
$roundnames_set[strtolower($rname)] = $i;
}
}
}
}
foreach ($roundnames_set as $i) {
$isuf = $i ? "_{$i}" : "";
if (($v = parse_value($sv, "resp_open{$isuf}", Si::get("resp_open"))) !== null) {
$sv->save("resp_open{$isuf}", $v <= 0 ? null : $v);
}
if (($v = parse_value($sv, "resp_done{$isuf}", Si::get("resp_done"))) !== null) {
$sv->save("resp_done{$isuf}", $v <= 0 ? null : $v);
}
if (($v = parse_value($sv, "resp_grace{$isuf}", Si::get("resp_grace"))) !== null) {
$sv->save("resp_grace{$isuf}", $v <= 0 ? null : $v);
}
if (($v = parse_value($sv, "resp_words{$isuf}", Si::get("resp_words"))) !== null) {
$sv->save("resp_words{$isuf}", $v < 0 ? null : $v);
}
if (($v = parse_value($sv, "msg.resp_instrux{$isuf}", Si::get("msg.resp_instrux"))) !== null) {
$sv->save("msg.resp_instrux{$isuf}", $v);
}
}
if (count($roundnames) > 1 || $roundnames[0] !== 1) {
$sv->save("resp_rounds", join(" ", $roundnames));
} else {
$sv->save("resp_rounds", null);
}
return false;
}