1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-17 03:54:09 +02:00

Multi-site work in progress.

This commit is contained in:
Cameron
2013-07-14 09:45:01 -07:00
parent 1294467225
commit 8d4f1b97c8
2 changed files with 250 additions and 4 deletions

View File

@@ -984,9 +984,14 @@ class xmlClass
* @param boolean $debug [optional]
* @return array with keys 'success' and 'failed' - DB table entry status.
*/
public function e107Import($file, $mode='replace', $noLogs = false, $debug=FALSE)
public function e107Import($file, $mode='replace', $noLogs = false, $debug=FALSE, $sql = null)
{
if($sql == null)
{
$sql = e107::getDB();
}
$xmlArray = $this->loadXMLfile($file, 'advanced');
if($debug)
@@ -1047,11 +1052,11 @@ class xmlClass
$insert_array[$fieldkey] = $fieldval;
}
if(($mode == "replace") && e107::getDB()->db_Replace($table, $insert_array)!==FALSE)
if(($mode == "replace") && $sql->replace($table, $insert_array)!==FALSE)
{
$ret['success'][] = $table;
}
elseif(($mode == "add") && e107::getDB()->db_Insert($table, $insert_array)!==FALSE)
elseif(($mode == "add") && $sql->insert($table, $insert_array)!==FALSE)
{
$ret['success'][] = $table;
}