/** * update export module * @param array * @return bool * @author Manfred Dennerlein */ function update(&$d) { global $vmLogger, $VM_LANG; $db = new ps_DB(); $ps_vendor_id = $_SESSION['ps_vendor_id']; $timestamp = time(); if (!$this->validate_update($d)) { return False; } if (!empty($d['export_class'])) { $export_class = basename($d['export_class']); if (include_once CLASSPATH . 'export/' . $export_class . '.php') { $_EXPORT = new $export_class(); } } else { include_once CLASSPATH . 'export/ps_xmlexport.php'; $_EXPORT = new ps_xmlexport(); } if ($_EXPORT->configfile_writeable()) { $_EXPORT->write_configuration($d); $vmLogger->info($VM_LANG->_('VM_CONFIGURATION_CHANGE_SUCCESS', false)); } else { $vmLogger->err(sprintf($VM_LANG->_('VM_CONFIGURATION_CHANGE_FAILURE', false), CLASSPATH . "export/" . $_EXPORT->classname . ".cfg.php")); return false; } $fields = array('export_enabled' => $d['export_enabled'], 'export_config' => $d['export_config']); if (!$d['iscore']) { $fields['export_name'] = $d['export_name']; $fields['export_desc'] = $d['export_desc']; $fields['export_class'] = $d['export_class']; } $db->buildQuery('INSERT', '#__{vm}_export', $fields, 'WHERE export_id=' . (int) $d['export_id'] . " AND vendor_id='{$ps_vendor_id}'"); return $db->query() !== false; }
$option = empty($option) ? vmGet($_REQUEST, 'option', 'com_virtuemart') : $option; $vars['export_enabled'] = "Y"; $default['export_class'] = 'ps_xmlexport'; if (!empty($export_id)) { $q = "SELECT * FROM #__{vm}_export WHERE vendor_id='{$ps_vendor_id}' AND "; $q .= "export_id='{$export_id}'"; $db->query($q); $db->next_record(); } if ($db->f("export_class")) { if (include_once CLASSPATH . "export/" . $db->f("export_class") . ".php") { eval("\$_EXPORT = new " . $db->f("export_class") . "();"); } } else { include_once CLASSPATH . "export/ps_xmlexport.php"; $_EXPORT = new ps_xmlexport(); } //First create the object and let it print a form heading $formObj =& new formFactory($VM_LANG->_('VM_EXPORT_MODULE_FORM_LBL')); //Then Start the form $formObj->startForm(); ?> <br /> <?php $tabs = new vmTabPanel(0, 1, 'exportform'); $tabs->startPane('content-pane'); $tabs->startTab($VM_LANG->_('VM_EXPORT_MODULE_FORM_LBL'), 'global-page'); ?> <table class="adminform"> <tr class="row0"> <td class="labelcell"><?php