function render($sv) { global $Conf; // Tags $tagger = new Tagger(); echo "<h3 class=\"settings\">Tags</h3>\n"; echo "<table class=\"secondary-settings\"><tbody>"; $sv->set_oldv("tag_chair", join(" ", array_keys(TagInfo::chair_tags()))); $sv->echo_entry_row("tag_chair", "Chair-only tags", "PC members can view these tags, but only administrators can change them."); $sv->set_oldv("tag_sitewide", join(" ", array_keys(TagInfo::sitewide_tags()))); if ($sv->newv("tag_sitewide") || $Conf->has_any_manager()) { $sv->echo_entry_row("tag_sitewide", "Site-wide tags", "Chairs and administrators can view and change these tags for every paper."); } $sv->set_oldv("tag_approval", join(" ", array_keys(TagInfo::approval_tags()))); $sv->echo_entry_row("tag_approval", "Approval voting tags", "<a href=\"" . hoturl("help", "t=votetags") . "\">What is this?</a>"); $x = []; foreach (TagInfo::vote_tags() as $n => $v) { $x[] = "{$n}#{$v}"; } $sv->set_oldv("tag_vote", join(" ", $x)); $sv->echo_entry_row("tag_vote", "Allotment voting tags", "“vote#10” declares an allotment of 10 votes per PC member. <span class=\"barsep\">·</span> <a href=\"" . hoturl("help", "t=votetags") . "\">What is this?</a>"); $sv->set_oldv("tag_rank", $Conf->setting_data("tag_rank", "")); $sv->echo_entry_row("tag_rank", "Ranking tag", "The <a href='" . hoturl("offline") . "'>offline reviewing page</a> will expose support for uploading rankings by this tag. <span class='barsep'>·</span> <a href='" . hoturl("help", "t=ranking") . "'>What is this?</a>"); echo "</tbody></table>"; echo "<div class='g'></div>\n"; $sv->echo_checkbox('tag_seeall', "PC can see tags for conflicted papers"); preg_match_all('_(\\S+)=(\\S+)_', $Conf->setting_data("tag_color", ""), $m, PREG_SET_ORDER); $tag_colors = array(); foreach ($m as $x) { $tag_colors[TagInfo::canonical_color($x[2])][] = $x[1]; } $tag_colors_rows = array(); foreach (explode("|", TagInfo::BASIC_COLORS) as $k) { if ($sv->use_req()) { $v = defval($sv->req, "tag_color_{$k}", ""); } else { if (isset($tag_colors[$k])) { $v = join(" ", $tag_colors[$k]); } else { $v = ""; } } $tag_colors_rows[] = "<tr class='k0 {$k}tag'><td class='lxcaption'></td><td class='lxcaption taghl'>{$k}</td><td class='lentry' style='font-size: 10.5pt'><input type='text' name='tag_color_{$k}' value=\"" . htmlspecialchars($v) . "\" size='40' /></td></tr>"; /* MAINSIZE */ } preg_match_all('_(\\S+)=(\\S+)_', $Conf->setting_data("tag_badge", ""), $m, PREG_SET_ORDER); $tag_badges = array(); foreach ($m as $x) { $tag_badges[$x[2]][] = $x[1]; } foreach (["black" => "black label", "red" => "red label", "green" => "green label", "blue" => "blue label", "white" => "white label"] as $k => $desc) { if ($sv->use_req()) { $v = defval($sv->req, "tag_badge_{$k}", ""); } else { if (isset($tag_badges[$k])) { $v = join(" ", $tag_badges[$k]); } else { $v = ""; } } $tag_colors_rows[] = "<tr class='k0'><td class='lxcaption'></td><td class='lxcaption'><span class='badge {$k}badge' style='margin:0'>{$desc}</span><td class='lentry' style='font-size:10.5pt'><input type='text' name='tag_badge_{$k}' value=\"" . htmlspecialchars($v) . "\" size='40' /></td></tr>"; /* MAINSIZE */ } echo Ht::hidden("has_tag_color", 1), '<h3 class="settings g">Styles and colors</h3>', "<div class='hint'>Papers and PC members tagged with a style name, or with one of the associated tags, will appear in that style in lists.</div>", "<div class='smg'></div>", "<table id='foldtag_color'><tr><th colspan='2'>Style name</th><th>Tags</th></tr>", join("", $tag_colors_rows), "</table>\n"; echo '<h3 class="settings g">Tracks</h3>', "\n"; echo "<div class='hint'>Tracks control the PC members allowed to view or review different sets of papers. <span class='barsep'>·</span> <a href=\"" . hoturl("help", "t=tracks") . "\">What is this?</a></div>", Ht::hidden("has_tracks", 1), "<div class=\"smg\"></div>\n"; $this->do_track($sv, "", 0); $tracknum = 2; $trackj = $Conf->setting_json("tracks") ?: (object) array(); // existing tracks foreach ($trackj as $trackname => $x) { if ($trackname !== "_") { $this->do_track($sv, $trackname, $tracknum); ++$tracknum; } } // new tracks (if error prevented saving) if ($sv->use_req()) { for ($i = 1; isset($sv->req["name_track{$i}"]); ++$i) { $trackname = trim($sv->req["name_track{$i}"]); if (!isset($trackj->{$trackname})) { $this->do_track($sv, $trackname, $tracknum); ++$tracknum; } } } // catchall track $this->do_track($sv, "_", 1); echo Ht::button("Add track", array("onclick" => "settings_add_track()")); }
public function annotate_field_js(PaperList $pl, &$fjs) { $fjs["highlight_tags"] = $pl->search->highlight_tags(); if (TagInfo::has_votish()) { $fjs["votish_tags"] = array_keys(TagInfo::vote_tags() + TagInfo::approval_tags()); } }