|
1 | 1 | <?php
|
2 | 2 |
|
3 | 3 | require("../../global/library.php");
|
4 |
| -ft_init_module_page(); |
5 | 4 |
|
6 |
| -if (isset($_POST["add"])) |
7 |
| - list($g_success, $g_message) = ecf_add_field($_POST); |
| 5 | +use FormTools\Core; |
| 6 | +use FormTools\Modules; |
| 7 | +use FormTools\Modules\ExtendedClientFields\Fields; |
| 8 | + |
| 9 | +$module = Modules::initModulePage("admin"); |
| 10 | + |
| 11 | +$LANG = Core::$L; |
| 12 | +$L = $module->getLangStrings(); |
| 13 | + |
| 14 | +$success = true; |
| 15 | +$message = ""; |
| 16 | +if (isset($_POST["add"])) { |
| 17 | + list($success, $message) = Fields::addField($_POST, $L); |
| 18 | +} |
8 | 19 |
|
9 | 20 | $page_vars = array();
|
10 | 21 | $page_vars["head_title"] = $L["phrase_add_field"];
|
11 |
| -$page_vars["head_string"] = "<script src=\"global/scripts/field_options.js\"></script>"; |
12 | 22 | $page_vars["js_messages"] = array("word_delete");
|
13 | 23 | $page_vars["head_js"] =<<< EOF
|
14 | 24 | var rules = [];
|
15 | 25 | rules.push("required,template_hook,{$L["validation_no_template_hook"]}");
|
16 | 26 | rules.push("required,field_label,{$L["validation_no_field_label"]}");
|
17 | 27 | rules.push("required,field_type,{$L["validation_no_field_type"]}");
|
18 | 28 | $(function() {
|
19 |
| - ecf_ns.add_field_option(null, null); |
20 |
| - ecf_ns.add_field_option(null, null); |
21 |
| - $("#field_type").val("").bind("change keyup", function() { |
22 |
| - ecf_ns.change_field_type(this.value); |
23 |
| - }); |
| 29 | + ecf_ns.add_field_option(null, null); |
| 30 | + ecf_ns.add_field_option(null, null); |
| 31 | + $("#field_type").val("").bind("change keyup", function() { |
| 32 | + ecf_ns.change_field_type(this.value); |
| 33 | + }); |
24 | 34 | });
|
25 | 35 | EOF;
|
26 | 36 |
|
27 |
| -ft_display_module_page("templates/add.tpl", $page_vars); |
| 37 | +$module->displayPage("templates/add.tpl", $page_vars); |
0 commit comments