1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
foreach($template_groups as $prefix => $group)
{
$tmp_expand = "";
if(in_array($group['gid'], $expand_array))
{
$expand = $lang->collapse;
$expanded = true;
$tmp_expand = $expand_array;
$unsetgid = array_search($group['gid'], $tmp_expand);
unset($tmp_expand[$unsetgid]);
$group['expand_str'] = implode("|", $tmp_expand);
}
else
{
$expand = $lang->expand;
$expanded = false;
$group['expand_str'] = implode("|", $expand_array);
if($group['expand_str'])
{
$group['expand_str'] .= "|";
}
$group['expand_str'] .= $group['gid'];
}
if($group['expand_str'])
{
$group['expand_str'] = "&expand={$group['expand_str']}";
}
if($expanded == true && isset($group['templates']) && count($group['templates']) > 0)
{
$table->construct_cell("<strong><a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>");
$table->construct_cell("<a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center"));
$table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));
$templates = $group['templates'];
ksort($templates);
foreach($templates as $template)
{
$template['pretty_title'] = $template['title'];
$popup = new PopupMenu("template_{$template['tid']}", $lang->options);
$popup->add_item($lang->full_edit, "index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}{$expand_str}");
if(isset($template['modified']) && $template['modified'] == true)
{
if($sid > 0)
{
$popup->add_item($lang->diff_report, "index.php?module=style-templates&action=diff_report&title=".urlencode($template['title'])."&sid2={$sid}");
$popup->add_item($lang->revert_to_orig, "index.php?module=style-templates&action=revert&title=".urlencode($template['title'])."&sid={$sid}&my_post_key={$mybb->post_code}{$expand_str}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_revertion}')");
}
$template['pretty_title'] = "<span style=\"color: green;\">{$template['title']}</span>";
}
// This template does not exist in the master list
else if(isset($template['original']) && $template['original'] == false)
{
$popup->add_item($lang->delete_template, "index.php?module=style-templates&action=delete_template&title=".urlencode($template['title'])."&sid={$sid}&my_post_key={$mybb->post_code}{$expand_str}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_deletion}')");
$template['pretty_title'] = "<span style=\"color: blue;\">{$template['title']}</span>";
}
$table->construct_cell("<span style=\"padding: 20px;\"><a href=\"index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");
$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();
}
}
else if(isset($group['templates']) && count($group['templates']) > 0)
{
$table->construct_cell("<strong><a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>");
$table->construct_cell("<a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center"));
$table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));
}
}
$table->output($template_sets[$sid]);
$page->output_footer();
}
|