示例#1
0
    $table->construct_header("Replacement");
    $table->construct_header("Controls", array("colspan" => 3));
    $table->construct_row();
    if (!$db->num_rows($query)) {
        $table->construct_cell("There are no results to display.", array("colspan" => 6, "style" => "text-align:center"));
    }
    while ($stylevar = $db->fetch_array($query)) {
        $table->construct_cell($stylevar['name']);
        $table->construct_cell("@{" . $stylevar['unique_name'] . "}");
        $table->construct_cell(htmlspecialchars($stylevar['content']));
        $table->construct_cell("<a href='" . $baseurl . "&amp;action=edit&amp;vid=" . $stylevar['vid'] . "'>Edit</a>");
        $table->construct_cell("<a href='" . $baseurl . "&amp;action=copy&amp;vid=" . $stylevar['vid'] . "'>Copy</a>");
        $table->construct_cell("<a href='" . $baseurl . "&amp;action=delete&amp;vid=" . $stylevar['vid'] . "'>Delete</a>");
        $table->construct_row();
    }
    $table->output("Available Variables");
    $form = new DefaultForm("index.php?module=style-theme_vars&action=create&tid={$tid}", "post");
    $form->output_submit_wrapper(array($form->generate_submit_button("Create Variable")));
    $form->end();
}
if (!$mybb->input['action'] && !$mybb->input['tid']) {
    $page->output_header("Theme Variable Manager");
    // No action so show a list of themes
    $themequery = $db->simple_select("themes", "tid,name,allowedgroups");
    // Create a cache of variable count so admins know how many variables they have.
    $variablequery = $db->simple_select("theme_variables", "tid");
    $themecounts = array();
    $globalkeys = 0;
    while ($count = $db->fetch_array($variablequery)) {
        $key = $count['tid'];
        if ($key == -1) {