Skip to content

Commit ae24b99

Browse files
committed
starting on FT3 support
1 parent 3a2dddc commit ae24b99

18 files changed

+1358
-1542
lines changed

README.md

+3-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
## module-extended_client_fields
1+
module_extended_client_fields
2+
=============================
23

3-
The Extended Client Fields module lets you construct any number of form fields to store additional information for your client accounts. The module comes with a number of nifty features, including:
4-
5-
* Control whether the fields appear in the Edit Client -> Main tab or -> Settings tab.
6-
* Control the location and order they appear in the pages.
7-
* Choose whether the field should only appear for the administrator, or the client as well.
8-
* Each field can be of any of the following field types: textbox, textarea, select or multi-select dropdown, radio buttons or checkboxes.
9-
* You can define a default value for the fields.
10-
* Group related field under a section header (optional)
11-
12-
For more information, check out the documentation.
13-
14-
### Documentation
15-
16-
[http://modules.formtools.org/custom_fields/](http://modules.formtools.org/custom_fields/)
17-
18-
### Form Tools Extensions
19-
20-
For further information about Form Tools extensions, check out the following link:
21-
[http://www.formtools.org/extensions.php](http://www.formtools.org/extensions.php)
4+
The Extended Client Fields module.

add.php

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
<?php
22

33
require("../../global/library.php");
4-
ft_init_module_page();
54

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+
}
819

920
$page_vars = array();
1021
$page_vars["head_title"] = $L["phrase_add_field"];
11-
$page_vars["head_string"] = "<script src=\"global/scripts/field_options.js\"></script>";
1222
$page_vars["js_messages"] = array("word_delete");
1323
$page_vars["head_js"] =<<< EOF
1424
var rules = [];
1525
rules.push("required,template_hook,{$L["validation_no_template_hook"]}");
1626
rules.push("required,field_label,{$L["validation_no_field_label"]}");
1727
rules.push("required,field_type,{$L["validation_no_field_type"]}");
1828
$(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+
});
2434
});
2535
EOF;
2636

27-
ft_display_module_page("templates/add.tpl", $page_vars);
37+
$module->displayPage("templates/add.tpl", $page_vars);

0 commit comments

Comments
 (0)