Example #1
0
	}
}
*/
if ($action == 'builddoc') {
    // Build import file
    $result = $objimport->build_file($user, $_POST['model'], $datatoimport, $array_match_file_to_database);
    if ($result < 0) {
        $mesg = '<div class="error">' . $objimport->error . '</div>';
    } else {
        $mesg = '<div class="ok">' . $langs->trans("FileSuccessfullyBuilt") . '</div>';
    }
}
if ($action == 'deleteprof') {
    if ($_GET["id"]) {
        $objimport->fetch($_GET["id"]);
        $result = $objimport->delete($user);
    }
}
// Save import config to database
if ($action == 'add_import_model') {
    if ($import_name) {
        // Set save string
        $hexa = '';
        foreach ($array_match_file_to_database as $key => $val) {
            if ($hexa) {
                $hexa .= ',';
            }
            $hexa .= $key . '=' . $val;
        }
        $objimport->model_name = $import_name;
        $objimport->datatoimport = $datatoimport;
Example #2
0
 private function revert()
 {
     if (!$this->isRequiredIDValid('importID', $_GET)) {
         $this->import();
         return;
     }
     $importID = $_GET['importID'];
     $import = new Import($this->_siteID);
     $tableName = $import->get($importID);
     if (!$tableName) {
         $this->import();
         return;
     }
     $tableName = $import->revert($tableName['moduleName'], $importID);
     $tableName = $import->delete($importID);
     if (!eval(Hooks::get('IMPORT_REVERT'))) {
         return;
     }
     $message = 'The revert was successful.';
     $this->_template->assign('successMessage', $message);
     $this->viewPending();
     return;
 }