本文整理汇总了PHP中Conf::msg_warning方法的典型用法代码示例。如果您正苦于以下问题:PHP Conf::msg_warning方法的具体用法?PHP Conf::msg_warning怎么用?PHP Conf::msg_warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conf
的用法示例。
在下文中一共展示了Conf::msg_warning方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: report
public function report()
{
$msgs = array();
$any_errors = false;
foreach ($this->errmsg as $m) {
if ($m && $m !== true && $m !== 1) {
$msgs[] = $any_errors = $m;
}
}
foreach ($this->warnmsg as $m) {
if ($m && $m !== true && $m !== 1) {
$msgs[] = "Warning: " . $m;
}
}
$mt = '<div class="multimessage"><div>' . join('</div><div>', $msgs) . '</div></div>';
if (count($msgs) && $any_errors) {
Conf::msg_error($mt);
} else {
if (count($msgs)) {
Conf::msg_warning($mt);
}
}
$this->warnings_reported = true;
}
示例2: run
function run(Contact $user, $qreq, $ssel)
{
global $Conf;
$papers = $ssel->selection();
$act = $qreq->tagfn;
$tagreq = trim(str_replace(",", " ", (string) $qreq->tag));
$tags = preg_split('/\\s+/', $tagreq);
if ($act == "da") {
$otags = $tags;
foreach ($otags as $t) {
$tags[] = "all~" . preg_replace(',\\A.*~([^~]+)\\z', '$1', $t);
}
$act = "d";
} else {
if ($act == "sor") {
shuffle($papers);
}
}
$x = array("action,paper,tag\n");
if ($act == "s" || $act == "so" || $act == "sos" || $act == "sor") {
foreach ($tags as $t) {
$x[] = "cleartag,all," . TagInfo::base($t) . "\n";
}
}
if ($act == "s" || $act == "a") {
$action = "tag";
} else {
if ($act == "d") {
$action = "cleartag";
} else {
if ($act == "so" || $act == "sor" || $act == "ao") {
$action = "nexttag";
} else {
if ($act == "sos" || $act == "aos") {
$action = "seqnexttag";
} else {
$action = null;
}
}
}
}
$assignset = new AssignmentSet($user, $user->privChair);
if (count($papers) && $action) {
foreach ($papers as $p) {
foreach ($tags as $t) {
$x[] = "{$action},{$p},{$t}\n";
}
}
$assignset->parse(join("", $x));
} else {
if (count($papers) && $act == "cr" && $user->privChair) {
$source_tag = trim((string) $qreq->tagcr_source);
if ($source_tag == "") {
$source_tag = substr($tagreq, 0, 2) == "~~" ? substr($tagreq, 2) : $tagreq;
}
$tagger = new Tagger($user);
if ($tagger->check($tagreq, Tagger::NOPRIVATE | Tagger::NOVALUE) && $tagger->check($source_tag, Tagger::NOPRIVATE | Tagger::NOCHAIR | Tagger::NOVALUE)) {
$r = new PaperRank($source_tag, $tagreq, $papers, $qreq->tagcr_gapless, "Search", "search");
$r->run($qreq->tagcr_method);
$r->apply($assignset);
$assignset->finish();
if ($qreq->q === "") {
$qreq->q = "order:{$tagreq}";
}
} else {
$assignset->error($tagger->error_html);
}
}
}
if ($errors = join("<br />\n", $assignset->errors_html())) {
if ($assignset->has_assigners()) {
Conf::msg_warning("Some tag assignments were ignored:<br />\n{$errors}");
$assignset->clear_errors();
} else {
Conf::msg_error($errors);
}
}
$success = $assignset->execute();
if (!$Conf->headerPrinted && $qreq->ajax) {
$Conf->ajaxExit(array("ok" => $success));
} else {
if (!$Conf->headerPrinted && $success) {
if (!$errors) {
$Conf->confirmMsg("Tags saved.");
}
$args = array("atab" => "tag");
foreach (array("tag", "tagfn", "tagcr_method", "tagcr_source", "tagcr_gapless") as $arg) {
if (isset($qreq[$arg])) {
$args[$arg] = $qreq[$arg];
}
}
redirectSelf($args);
}
}
}