-
Notifications
You must be signed in to change notification settings - Fork 10
/
export.php
42 lines (34 loc) · 1.46 KB
/
export.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
<?php
/**
* Export.php
*
* This file does the actual generation of the content for view / display by the user. It calls the
* export.tpl found in the /modules/export_manager/templates folder.
*/
require_once("../../global/library.php");
use FormTools\Core;
use FormTools\Modules;
use FormTools\Sessions;
$module = Modules::initModulePage("client");
$L = $module->getLangStrings();
$root_dir = Core::getRootDir();
$root_url = Core::getRootUrl();
// passed in explicitly via POST or GET
$export_group_id = (isset($request["export_group_id"])) ? $request["export_group_id"] : "";
$export_type_id = (isset($request["export_type_id"])) ? $request["export_type_id"] : "";
$results = (isset($request["export_group_{$export_group_id}_results"])) ? $request["export_group_{$export_group_id}_results"] : "all";
// drawn from sessions
$form_id = Sessions::getWithFallback("curr_form_id", "");
$view_id = Sessions::getWithFallback("form_{$form_id}_view_id", "");
$order = Sessions::getWithFallback("current_search.order", "");
$search_fields = Sessions::getWithFallback("current_search.search_fields", array());
$export_group_results = Modules::loadModuleField("export_manager", "export_group_{$export_group_id}_results", "export_group_{$export_group_id}_results");
$module->export(array(
"form_id" => $form_id,
"view_id" => $view_id,
"order" => $order,
"search_fields" => $search_fields,
"export_group_id" => $export_group_id,
"export_type_id" => $export_type_id,
"results" => $results
));