<?php
/*-----------------------------------------------------------------
* 	ID:						cseov25_qf10.php
* 	Letzter Stand:			v2.5
* 	zuletzt geaendert von:	akausch
* 	Datum:					2014/04/08
*
* 	Copyright (c) since 2010 commerce:SEO by Webdesign Erfurt
* 	http://www.commerce-seo.de
* ---------------------------------------------------------------*/

class cseov25_qf10 {
var $title, $output;

function cseov25_qf10() {
  $this->code = 'cseov25_qf10';
  $this->version = '2.5.10';
  $this->title = 'cseov25_qf10';
  $this->description = 'Fix5.10 für commerce:seo v2next 2.5.09';
  $this->enabled = ((MODULE_CSEO_V251QF10_STATUS == 'true') ? true : false);
  $this->sort_order = MODULE_CSEO_V251QF10_SORT_ORDER;

  $this->output = array();
}

function process() {
  global $order, $xtPrice;


}

function check() {
  if (!isset($this->_check)) {
	$check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_CSEO_V251QF10_STATUS'");
	$this->_check = xtc_db_num_rows($check_query);
  }

  return $this->_check;
}

function keys() {
	return array('MODULE_CSEO_V251QF10_STATUS', 'MODULE_CSEO_V251QF10_SORT_ORDER');
}

function install() {
	xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,configuration_group_id, sort_order, set_function, date_added) VALUES ('MODULE_CSEO_V251QF10_STATUS', 'true', '6', '1','', now())");
	xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,configuration_group_id, sort_order, date_added) VALUES ('MODULE_CSEO_V251QF10_SORT_ORDER', '1','6', '2', now())");
	xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,configuration_group_id, sort_order, date_added) VALUES ('MODULE_CSEO_V251QF10', 'true','6', '3', now())");

	
	//Fehlende Config
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'PAYPAL_PAYMENT_MODE';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'PAYPAL_PAYMENT_MODE', 'Sale', 25, 1, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('Sale', 'Authorization'),\");");
	}
	
	xtc_db_query("UPDATE admin_navigation SET title = 'magnalister' WHERE title = 'Magnalister';");
	xtc_db_query("UPDATE database_version SET version = 'commerce:seo v2next 2.5.10'");
	

}

function remove() {
  xtc_db_query("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key in ('" . implode("', '", $this->keys()) . "')");
  xtc_db_query("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'MODULE_CSEO_V251QF10'");
}

}
