-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
67 lines (56 loc) · 1.69 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
require_once("../../global/library.php");
use FormTools\Core;
use FormTools\General;
use FormTools\Modules;
use FormTools\Modules\ExtendedClientFields\Fields;
$module = Modules::initModulePage("admin");
$LANG = Core::$L;
$L = $module->getLangStrings();
$success = true;
$message = "";
if (isset($_GET["delete"])) {
list($success, $message) = Fields::deleteField($_GET["delete"], $L);
}
if (isset($_POST["add_field"])) {
header("location: add.php");
exit;
} else if (isset($_POST["update_order"])) {
list($success, $message) = Fields::updateFieldOrder($_POST, $L);
}
$num_fields_per_page = 10;
$page = Modules::loadModuleField("extended_client_fields", "page", "extended_client_fields_page", 1);
$info = Fields::getClientFields($page);
$results = $info["results"];
$num_results = $info["num_results"];
$page_vars = array(
"results" => $results,
"head_title" => $module->getModuleName(),
"pagination" => General::getPageNav($num_results, $num_fields_per_page, $page, ""),
"js_messages" => array("word_edit")
);
$page_vars["head_js"] =<<< END
var page_ns = {};
page_ns.delete_dialog = $("<div></div>");
page_ns.delete_field = function(client_field_id) {
ft.create_dialog({
dialog: page_ns.delete_dialog,
title: "{$LANG["phrase_please_confirm"]}",
content: "{$L["confirm_delete_field"]}",
popup_type: "warning",
buttons: [{
text: "{$LANG["word_yes"]}",
click: function() {
window.location = 'index.php?delete=' + client_field_id;
}
},
{
text: "{$LANG["word_no"]}",
click: function() {
$(this).dialog("close");
}
}]
});
}
END;
$module->displayPage("templates/index.tpl", $page_vars);