$new_tag) * $can_manage = whether things like "add new alias" should be shown */ public function display_aliases($aliases, $pageNumber, $totalPages) { global $page, $user; $can_manage = $user->can("manage_alias_list"); if($can_manage) { $h_action = "Action"; $h_add = " ".make_form(make_link("alias/add"))." "; } else { $h_action = ""; $h_add = ""; } $h_aliases = ""; $n = 0; foreach($aliases as $old => $new) { $h_old = html_escape($old); $h_new = "".html_escape($new).""; $oe = ($n++ % 2 == 0) ? "even" : "odd"; $h_aliases .= "$h_old$h_new"; if($can_manage) { $h_aliases .= " ".make_form(make_link("alias/remove"))." "; } $h_aliases .= ""; } $html = " $h_action$h_aliases$h_add
FromTo

Download as CSV

"; $bulk_html = " ".make_form(make_link("alias/import"), $multipart=True)." "; $page->set_title("Alias List"); $page->set_heading("Alias List"); $page->add_block(new NavBlock()); $page->add_block(new Block("Aliases", $html)); if($can_manage) { $page->add_block(new Block("Bulk Upload", $bulk_html, "main", 51)); } $this->display_paginator($page, "alias/list", null, $pageNumber, $totalPages); } } ?>