<?php if (!defined("IN_MYBB")) { die("Direct access not allowed."); } $page->add_breadcrumb_item("Themes", "index.php?module=style-theme_vars"); $baseurl = "index.php?module=style-theme_vars"; $table = new TABLE(); if ($mybb->input['tid'] && !$mybb->input['action']) { $tid = (int) $mybb->input['tid']; $page->add_breadcrumb_item("Variable Management"); $page->output_header("Theme Variable Manager"); $query = $db->simple_select("theme_variables", "*", "tid IN(-1,{$tid})", array("order_by" => "name", "order_dir" => "ASC")); $table->construct_header("Name"); $table->construct_header("Syntax"); $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 . "&action=edit&vid=" . $stylevar['vid'] . "'>Edit</a>"); $table->construct_cell("<a href='" . $baseurl . "&action=copy&vid=" . $stylevar['vid'] . "'>Copy</a>"); $table->construct_cell("<a href='" . $baseurl . "&action=delete&vid=" . $stylevar['vid'] . "'>Delete</a>"); $table->construct_row(); } $table->output("Available Variables");