<?php $view_types = array(VIEW::TYPE_BODY => "Body", VIEW::TYPE_POPUP => "Popup", VIEW::TYPE_BLANK => "Blank", VIEW::TYPE_COMPONENT => "Component"); if ($is_mva_component) { $data[] = array("MVA Components", HTML_UTIL::get_checkboxes("mva_components", array("V" => "View", "A" => "Action"), $mva_components)); } $task_name_div = HTML_UTIL::get_div("", array("id" => "task_name")); $data[] = array("ACL Roles", HTML_UTIL::dropdown("security_roles", $security_roles, $selected_security_roles, array("class" => "w100p"), count($security_roles), true)); if ($show_view_type) { $data[] = array("Type", HTML_UTIL::dropdown("view_type", $view_types, $view_type, array("class" => "w100p"))); } $data[] = array("Controller", HTML_UTIL::input("controller", $controller, array("class" => "w100p"))); $data[] = array($task_name_div, HTML_UTIL::input("task", $task, array("class" => "w100p"))); $data[] = array("Location", HTML_UTIL::dropdown("location", CMODEL_GENERATOR::get_locations(), "", array("class" => "wa"))); $data[] = array("", HTML_UTIL::get_checkbox("override", "1", $override, [], "Override")); $data[] = array("", HTML_UTIL::get_button("cmd_generate", "Generate", array("class" => "btn-primary"))); $html_table = new HTML_TABLE_UTIL(); $html_table->set_data($data); $html_table->set_row_id_prefix("row-"); $html_table->set_column_attribute(0, "width", 120); $html_table->set_padding(2); $html_table->set_class(""); $html_table->render();
<?php $table_data = array(); $html_table = new HTML_TABLE_UTIL(); $html_table->set_data($table_data); $html_table->render();
<h1>API Generation</h1> <?php $data[] = array("Model Name: ", HTML_UTIL::input("model", $model, array("placeholder" => "", "class" => "w200"))); $data[] = array("Plural Model Name: ", HTML_UTIL::input("model-plural", "", array("placeholder" => "", "class" => "w200"))); $data[] = array("", HTML_UTIL::button("generate", "Generate", array("id" => "generate")) . " " . HTML_UTIL::checkbox("override", "1", "", array(), "Override")); $data[] = array("", HTML_UTIL::get_div("", array("class" => "pt20"))); HTML_TABLE_UTIL::create()->set_data($data)->set_column_attribute(0, "class", "vat")->set_padding(2)->set_class("")->render(); ?> <script> $(function() { $("input[name='model']").keyup(function() { if($(this).val()) $("input[name='model-plural']").val($(this).val() + "s"); }).trigger("keyup"); $("#generate").click(function() { $.post("/generate/doapi",$("#form-api").serializeArray(),function(response) { if(response.has_success) FF.msg.success(response.data.messages); else FF.msg.error(response.errors); }); }); });
<h1>Model Creation</h1> <form id="form-model"> <?php $model_type_list = HTML_UTIL::get_checkboxes("model_types", array("c" => "Complex", "h" => "Handler"), $model_types, array()); $data[] = array("Model Type", $model_type_list); $data[] = array("Model", HTML_UTIL::get_input("model", $model, array("style" => "width:300px"))); $data[] = array("Extends Model", HTML_UTIL::get_input("extends", $extends, array("style" => "width:300px"))); $data[] = array("Location:", HTML_UTIL::dropdown("location", CMODEL_GENERATOR::get_locations(), "", array("class" => "wa"))); $data[] = array("", HTML_UTIL::get_checkbox("override", "1", $override, [], "Override")); $data[] = array("", HTML_UTIL::link("javascript:;", "Generate", array("class" => "btn btn-primary", "id" => "generate"))); $db_table = HTML_TABLE_UTIL::create()->set_data($data)->set_padding(3)->set_class(""); $tablename_dd_count = count($tablename_list); $tablename_dd = HTML_UTIL::dropdown("tablename", $tablename_list, $tablename, array("onKeyUp" => "update_class_name(this)", "onChange" => "update_class_name(this)", "size" => 30), $tablename_dd_count); HTML_TABLE_UTIL::create()->set_data(array(array("Table Name: ", $tablename_dd, $db_table->get_html())))->set_default_column_attribute("class", "vat")->set_padding(3)->set_class("")->render(); ?> </form> <script> function update_class_name(obj) { $("#model").val(get_singular($(obj).val())); update_links($(obj).val(),get_singular($(obj).val())); } $("input[name='model']").on("input",function() { update_links("",$(this).val()); }); $("#generate").click(function() { $.post("/generate/domodel",$("#form-model").serializeArray(),function(response) {
if ($create_dbq) { $select_object_list[] = "dbq"; } $data[] = array("Generate:", HTML_UTIL::get_checkboxes("objects", $object_list, $select_object_list)); $data[] = array("Class Name:", HTML_UTIL::get_input("classname", $classname, array("class" => "w300"))); $data[] = array("Location:", HTML_UTIL::dropdown("location", CMODEL_GENERATOR::get_locations(), "", array("class" => "wa"))); $data[] = array("", HTML_UTIL::get_checkbox("override", "1", $override, [], "Override")); $data[] = array("", HTML_UTIL::link("javascript:;", "Generate", array("id" => "generate", "class" => "btn btn-primary"))); $db_table = new HTML_TABLE_UTIL(); $db_table->set_data($data); $db_table->set_column_attribute(0, "style", "padding-top:2px"); $db_table->set_row_id_prefix("row-"); $db_table->set_class(""); $db_table->set_padding(3); $tablename_dd = HTML_UTIL::dropdown("tablename", $tablename_list, $tablename, array("onKeyUp" => "update_class_name(this)", "onChange" => "update_class_name(this)", "size" => 30), 50); $html_table = new HTML_TABLE_UTIL(); $html_table->set_data(array(array("Table Name: ", $tablename_dd, $db_table->get_html()))); $html_table->set_default_column_attribute("class", "vat"); $html_table->set_class(""); $html_table->set_padding(3); $html_table->render(); ?> </form> <script> var dbqs = [<?php echo implode(",", $existing_dbqs); ?> ];