-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_rights_import.php
129 lines (92 loc) · 3.69 KB
/
admin_rights_import.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");
require_once("include/dbcommon.php");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
set_time_limit(600);
require_once("include/admin_rights_variables.php");
require_once("include/import_functions.php");
require_once('classes/importpage.php');
if( !Security::processPageSecurity( $strtablename, 'I' ) )
return;
$layout = new TLayout("import_bootstrap", "OfficeOffice", "MobileOffice");
$layout->version = 3;
$layout->bootstrapTheme = "cerulean";
$layout->customCssPageName = "admin_rights_import";
$layout->blocks["top"] = array();
$layout->containers["page"] = array();
$layout->container_properties["page"] = array( );
$layout->containers["page"][] = array("name"=>"wrapper",
"block"=>"", "substyle"=>1 , "container"=>"panel" );
$layout->containers["panel"] = array();
$layout->container_properties["panel"] = array( );
$layout->containers["panel"][] = array("name"=>"wrapper",
"block"=>"", "substyle"=>1 , "container"=>"header" );
$layout->containers["header"] = array();
$layout->container_properties["header"] = array( );
$layout->containers["header"][] = array("name"=>"importheader",
"block"=>"", "substyle"=>1 );
$layout->skins["header"] = "";
$layout->containers["panel"][] = array("name"=>"wrapper",
"block"=>"", "substyle"=>1 , "container"=>"body" );
$layout->containers["body"] = array();
$layout->container_properties["body"] = array( );
$layout->containers["body"][] = array("name"=>"wrapper",
"block"=>"", "substyle"=>1 , "container"=>"message" );
$layout->containers["message"] = array();
$layout->container_properties["message"] = array( );
$layout->containers["message"][] = array("name"=>"errormessage",
"block"=>"", "substyle"=>1 );
$layout->skins["message"] = "";
$layout->containers["body"][] = array("name"=>"wrapper",
"block"=>"", "substyle"=>1 , "container"=>"import" );
$layout->containers["import"] = array();
$layout->container_properties["import"] = array( );
$layout->containers["import"][] = array("name"=>"importheader_text",
"block"=>"", "substyle"=>1 );
$layout->containers["import"][] = array("name"=>"importfields",
"block"=>"", "substyle"=>1 );
$layout->containers["import"][] = array("name"=>"import_rawtext_control",
"block"=>"", "substyle"=>1 );
$layout->containers["import"][] = array("name"=>"import_preview",
"block"=>"", "substyle"=>1 );
$layout->containers["import"][] = array("name"=>"import_process",
"block"=>"", "substyle"=>1 );
$layout->containers["import"][] = array("name"=>"import_results",
"block"=>"", "substyle"=>1 );
$layout->containers["import"][] = array("name"=>"importbuttons",
"block"=>"", "substyle"=>1 );
$layout->skins["import"] = "";
$layout->skins["body"] = "";
$layout->skins["panel"] = "";
$layout->skins["page"] = "";
$layout->blocks["top"][] = "page";
$page_layouts["admin_rights_import"] = $layout;
require_once('include/xtempl.php');
$xt = new Xtempl();
$id = postvalue_number("id");
$id = $id != "" ? $id : 1;
//an array of params for ImportPage constructor
$params = array();
$params["id"] = $id;
$params["xt"] = &$xt;
$params["tName"] = $strTableName;
$params["action"] = postvalue("a");
$params["pageType"] = PAGE_IMPORT;
$params["pageName"] = postvalue("page");
$params["needSearchClauseObj"] = false;
$params["strOriginalTableName"] = $strOriginalTableName;
if( $params["action"] == "importPreview" )
{
$params["importType"] = postvalue("importType");
$params["importText"] = postvalue("importText");
$params["useXHR"] = postvalue("useXHR");
}
elseif( $params["action"] == "importData" )
{
$params["importData"] = my_json_decode( postvalue("importData") );
}
$pageObject = new ImportPage($params);
$pageObject->init();
$pageObject->process();
?>