/
tiki-import_xml_zip.php
42 lines (38 loc) · 1.25 KB
/
tiki-import_xml_zip.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
<?php
/**
* @package tikiwiki
*/
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: tiki-import_xml_zip.php 44444 2013-01-05 21:24:24Z changi67 $
$section = 'wiki page';
require_once('tiki-setup.php');
$access->check_feature('feature_wiki');
$access->check_permission('tiki_p_admin');
@ini_set('max_execution_time', 0); //will not work in safe_mode is on
if (isset($_REQUEST['import'])) {
check_ticket('import_xml_zip');
if (!empty($_REQUEST['local'])) {
$zipFile = $_REQUEST['local'];
} elseif (is_uploaded_file($_FILES['zip']['tmp_name'])) {
$zipFile = $_FILES['zip']['tmp_name'];
} else {
$smarty->assign('error', tra('Error'));
$zipFile = '';
}
if ($zipFile) {
include_once('lib/wiki/xmllib.php');
$xmllib = new XmlLib;
$config = array();
if ($xmllib->import_pages($zipFile, $config)) {
$smarty->assign('msg', tra('Operations executed successfully'));
} else {
$smarty->assign('error', $xmllib->get_error());
}
}
}
ask_ticket('import_xml_zip');
$smarty->assign('mid', 'tiki-import_xml_zip.tpl');
$smarty->display("tiki.tpl");