PHP Code:
// Admin mod section ---
function check() {
global $db;
if (!isset($this->_check)) {
$check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_IC_STATUS'");
$this->_check = $check_query->RecordCount();
}
return $this->_check;
}
function install() {
global $db;
/* zen_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow International Checkout', 'MODULE_PAYMENT_IC_STATUS', 'True', 'Do you want to accept International Checkout payments?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
zen_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('International Checkout Company', 'MODULE_PAYMENT_IC_COMPANY', '', 'Company used for International Checkout payments', '6', '0', now())");*/
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable International Checkout Module', 'MODULE_PAYMENT_IC_STATUS', 'True', 'Do you want to accept International Checkout payments?', '6', '130', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_IC_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '131' , now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('International Checkout Company ID', 'MODULE_PAYMENT_IC_COMPANY', '', 'Company used for International Checkout payments', '6', '132', now())");
}
function remove() {
zen_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
return array('MODULE_PAYMENT_IC_STATUS', 'MODULE_PAYMENT_IC_SORT_ORDER', 'MODULE_PAYMENT_IC_COMPANY');
}
}