} ?> <p class="error_message" style="display: none;">Errors found! Please fix the highlighted fields before submitting.</p> <div class="form_fields"> <?php $bigtree["html_fields"] = array(); $bigtree["simple_html_fields"] = array(); $bigtree["tabindex"] = 1; $bigtree["field_namespace"] = uniqid("template_field_"); $bigtree["field_counter"] = 0; // We alias $bigtree["entry"] to $bigtree["resources"] so that information is in the same place for field types. $bigtree["entry"] =& $bigtree["resources"]; if (is_array($bigtree["template"]["resources"]) && count($bigtree["template"]["resources"])) { foreach ($bigtree["template"]["resources"] as $resource) { $field = array("type" => $resource["type"], "title" => $resource["title"], "subtitle" => $resource["subtitle"], "key" => "resources[" . $resource["id"] . "]", "value" => isset($bigtree["resources"][$resource["id"]]) ? $bigtree["resources"][$resource["id"]] : "", "tabindex" => $bigtree["tabindex"], "options" => $resource["options"]); BigTreeAdmin::drawField($field); } } else { echo '<p>There are no resources for the selected template.</p>'; } ?> </div> <?php $bigtree["html_editor_width"] = 898; $bigtree["html_editor_height"] = 365; include BigTree::path("admin/layouts/_html-field-loader.php"); $bigtree["tinymce_fields"] = array_merge($bigtree["html_fields"], $bigtree["simple_html_fields"]); ?> <script> BigTree.TinyMCEFields = <?php echo json_encode($bigtree["tinymce_fields"]);