-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathexport.php
More file actions
38 lines (32 loc) · 1.3 KB
/
export.php
File metadata and controls
38 lines (32 loc) · 1.3 KB
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
<?php
/**
* Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
* CC-BY License - http://creativecommons.org/licenses/by/3.0/
*/
require_once( 'inc/header.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
check_logged();
bx_import ('BxDolExport');
if ('popup' === bx_get('action')) {
echo PopupBox('bx_profile_export', _t('_adm_txt_langs_export'), $GLOBALS['oSysTemplate']->parseHtmlByName('export.html', array(
'content' => $GLOBALS['oFunctions']->loadingBoxInline(),
'profile_id' => (int)bx_get('profile_id'),
)));
}
else {
$mixedRes = false;
if (0 === strcasecmp($_SERVER['REQUEST_METHOD'], 'POST')) {
$iProfileId = isAdmin() && (int)bx_get('profile_id') ? (int)bx_get('profile_id') : getLoggedId();
$mixedRes = BxDolExport::generateAllExports ($iProfileId);
}
header('Content-Type: text/html; charset=utf-8');
if (true === $mixedRes) {
$aProfile = getProfileInfo($iProfileId);
echo json_encode(array('err' => 0, 'msg' => _t('_sys_export_success', $aProfile['Email'])));
}
else {
echo json_encode(array('err' => 1, 'msg' => $mixedRes ? $mixedRes : _t('_Error occured')));
}
}