$table = new Table;
$table->construct_header($lang->prefix);
$table->construct_header("gültig in Forum");
$table->construct_header($lang->controls, array('class' => 'align_center', 'colspan' => 3));
$prefixes = build_prefixes();
//sortiere Präfixe aufsteigend nach Prefix-ID
$sortArray = array();
foreach($prefixes as $prefixe){
foreach($prefixe as $key=>$value){
if(!isset($sortArray[$key])){
$sortArray[$key] = array();
}
$sortArray[$key][] = $value;
}
}
array_multisort($sortArray['pid'],SORT_ASC,$prefixes);
if(!empty($prefixes))
{
foreach($prefixes as $prefix)
{
$forumlink = "";
//überprüfen, ob Präfix für alle Foren eingestellt ist (-1) oder einzelne Foren ausgewählt wurden
if($prefix['forums'] != "-1")
{
$list_ids = explode(",",$prefix['forums']);
foreach($list_ids as $data)
{
//Hole alle Forennamen und die Foren-IDs für die entsprechend eingestellten Foren
$query = $db->simple_select("forums","name,fid","fid IN (".$data.")");
$result = $db->fetch_array($query);
$forumlink .= " <a href=\"../forumdisplay.php?fid=".$result['fid']."\" target=\"_blank\">".htmlspecialchars_uni(($result['name']))."</a> ";
}
}
else
{
$forumlink = "Alle";
}
$table->construct_cell("<a href=\"index.php?module=config-thread_prefixes&action=edit_prefix&pid={$prefix['pid']}\"><strong>".htmlspecialchars_uni($prefix['prefix'])."</strong></a>");
$table->construct_cell($forumlink);
$table->construct_cell("<a href=\"index.php?module=config-thread_prefixes&action=edit_prefix&pid={$prefix['pid']}\">{$lang->edit}</a>", array('width' => 100, 'class' => "align_center"));
$table->construct_cell("<a href=\"index.php?module=config-thread_prefixes&action=delete_prefix&pid={$prefix['pid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_thread_prefix_deletion}')\">{$lang->delete}</a>", array('width' => 100, 'class' => 'align_center'));
$table->construct_row();
}
}