Skip to content

Commit

Permalink
starting on FT3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
benkeen committed Oct 17, 2017
1 parent 3a2dddc commit ae24b99
Show file tree
Hide file tree
Showing 18 changed files with 1,358 additions and 1,542 deletions.
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
## module-extended_client_fields
module_extended_client_fields
=============================

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:

* Control whether the fields appear in the Edit Client -> Main tab or -> Settings tab.
* Control the location and order they appear in the pages.
* Choose whether the field should only appear for the administrator, or the client as well.
* Each field can be of any of the following field types: textbox, textarea, select or multi-select dropdown, radio buttons or checkboxes.
* You can define a default value for the fields.
* Group related field under a section header (optional)

For more information, check out the documentation.

### Documentation

[http://modules.formtools.org/custom_fields/](http://modules.formtools.org/custom_fields/)

### Form Tools Extensions

For further information about Form Tools extensions, check out the following link:
[http://www.formtools.org/extensions.php](http://www.formtools.org/extensions.php)
The Extended Client Fields module.
30 changes: 20 additions & 10 deletions add.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
<?php

require("../../global/library.php");
ft_init_module_page();

if (isset($_POST["add"]))
list($g_success, $g_message) = ecf_add_field($_POST);
use FormTools\Core;
use FormTools\Modules;
use FormTools\Modules\ExtendedClientFields\Fields;

$module = Modules::initModulePage("admin");

$LANG = Core::$L;
$L = $module->getLangStrings();

$success = true;
$message = "";
if (isset($_POST["add"])) {
list($success, $message) = Fields::addField($_POST, $L);
}

$page_vars = array();
$page_vars["head_title"] = $L["phrase_add_field"];
$page_vars["head_string"] = "<script src=\"global/scripts/field_options.js\"></script>";
$page_vars["js_messages"] = array("word_delete");
$page_vars["head_js"] =<<< EOF
var rules = [];
rules.push("required,template_hook,{$L["validation_no_template_hook"]}");
rules.push("required,field_label,{$L["validation_no_field_label"]}");
rules.push("required,field_type,{$L["validation_no_field_type"]}");
$(function() {
ecf_ns.add_field_option(null, null);
ecf_ns.add_field_option(null, null);
$("#field_type").val("").bind("change keyup", function() {
ecf_ns.change_field_type(this.value);
});
ecf_ns.add_field_option(null, null);
ecf_ns.add_field_option(null, null);
$("#field_type").val("").bind("change keyup", function() {
ecf_ns.change_field_type(this.value);
});
});
EOF;

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

0 comments on commit ae24b99

Please sign in to comment.