| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: uc_node_checkout.admin.inc,v 1.1.2.1 2009/01/29 17:22:34 rszrama Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 128 |
function uc_node_checkout_type_form_submit($form, &$form_state) { |
function uc_node_checkout_type_form_submit($form, &$form_state) { |
| 129 |
// Save the product node ID. |
// Save the product node ID. |
| 130 |
if ($form_state['values']['product_nid'] || $form_state['values']['view']) { |
if ($form_state['values']['product_nid'] || $form_state['values']['view']) { |
| 131 |
db_query("UPDATE {uc_node_checkout_types} SET product_nid = %d, node_view = '%s' WHERE type = '%s'", $form_state['values']['product_nid'], $form_state['values']['view'], $form_state['values']['type']); |
db_query("UPDATE {uc_node_checkout_types} SET product_nid = %d, node_view = '%s' WHERE node_type = '%s'", $form_state['values']['product_nid'], $form_state['values']['view'], $form_state['values']['type']); |
| 132 |
if (!db_affected_rows()) { |
if (!db_affected_rows()) { |
| 133 |
db_query("INSERT INTO {uc_node_checkout_types} (type, product_nid, node_view) VALUES ('%s', %d, '%s')", $form_state['values']['type'], $form_state['values']['product_nid'], $form_state['values']['view']); |
db_query("INSERT INTO {uc_node_checkout_types} (node_type, product_nid, node_view) VALUES ('%s', %d, '%s')", $form_state['values']['type'], $form_state['values']['product_nid'], $form_state['values']['view']); |
| 134 |
} |
} |
| 135 |
} |
} |
| 136 |
else { |
else { |
| 137 |
db_query("DELETE FROM {uc_node_checkout_types} WHERE type = '%s'", $form_state['values']['type']); |
db_query("DELETE FROM {uc_node_checkout_types} WHERE node_type = '%s'", $form_state['values']['type']); |
| 138 |
} |
} |
| 139 |
|
|
| 140 |
// Save the restricted fields settings. |
// Save the restricted fields settings. |