Advertisement
Guest User

Untitled

a guest
Jun 24th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class Evirtual_Xautoimport_Helper_Data extends Mage_Core_Helper_Abstract {
  15.  
  16. protected $array = array();
  17. protected $subarray = array();
  18. protected $categoryarray = array();
  19. protected $_CollectionProducts = array();
  20. protected $_productArray = array();
  21. public $_helperProductArray = array();
  22. protected $_tmpArray = array();
  23. protected $_oldRootFieldMapping = null;
  24. protected $_oldSRootFieldMapping = null;
  25. public function licenseCheck($key) {
  26.  
  27. $domain = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
  28. $domainName = $this->getDomain($domain);
  29. $options = array("location" => "http://development4magento.com/dev/xautoimportlicense/license.php", "uri" => "http://development4magento.com/dev/xautoimportlicense/", "soap_version" => SOAP_1_2);
  30. $client = new SoapClient(null, $options);
  31. $result = $client->checkLicense($domainName, $key);
  32. if ($result == "Valid")
  33. {
  34. $Switch = new Mage_Core_Model_Config();
  35. $Switch->saveConfig("evirtual_xautoimport/general/enable", "1", "default", 1);
  36. $Switch->saveConfig("evirtual_xautoimport/general/status", $result, "default", $result);
  37. return null;
  38. }
  39. $Switch = new Mage_Core_Model_Config();
  40. $Switch->saveConfig("evirtual_xautoimport/general/status", $result, "default", $result);
  41. return;
  42. }
  43.  
  44. public function globlelicenseCheck($key) {
  45.  
  46. $domain = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
  47. $domainName = $this->getDomain($domain);
  48. $options = array("location" => "http://development4magento.com/dev/xautoimportlicense/license.php", "uri" => "http://development4magento.com/dev/xautoimportlicense/", "soap_version" => SOAP_1_2);
  49. $client = new SoapClient(null, $options);
  50. $result = $client->checkLicense($domainName, $key);
  51. return $result;
  52. }
  53.  
  54. protected function getDomain($url) {
  55.  
  56. $pieces = parse_url($url);
  57. return $pieces["host"] . $pieces["path"];
  58. }
  59.  
  60. public function convertOptions($options) {
  61.  
  62. $converted = array();
  63. foreach ($options as $option)
  64. {
  65. if ((isset($option["value"]) && !is_array($option["value"]) && isset($option["label"]) && !is_array($option["label"])))
  66. {
  67. $converted[$option["value"]] = $option["label"];
  68. continue;
  69. }
  70. continue;
  71. }
  72. return $converted;
  73. }
  74.  
  75. public function keycasechange($array, $case = CASE_LOWER) {
  76.  
  77. $array = array_change_key_case($array, $case);
  78. foreach ($array as $key => $value)
  79. {
  80. if (!is_array($value))
  81. {
  82. continue;
  83. }
  84. $array[$key] = $this->keycasechange($value, $case);
  85. continue;
  86. }
  87. return $array;
  88. }
  89.  
  90. public function changeKeyHirarchy($array) {
  91.  
  92. $this->subarray = array();
  93. if (is_array($array))
  94. {
  95. $this->_changeKeyHirarchy($array);
  96. }
  97. Zend_Debug::dump($this->subarray);
  98. exit();
  99. return $this->subarray;
  100. }
  101.  
  102. public function _changeKeyHirarchy($child, $parent = "") {
  103.  
  104. if (is_array($child))
  105. {
  106. foreach ($child as $key => $value)
  107. {
  108. if ($parent == "")
  109. {
  110. if (!is_int($key) && !is_array($value))
  111. {
  112. $this->subarray[$key] = $value;
  113. continue;
  114. }
  115. $this->_changeKeyHirarchy($value, $key);
  116. continue;
  117. }
  118. if (is_array($value))
  119. {
  120. if (!is_int($key) && !is_array($value))
  121. {
  122. .........................................................................
  123. ..................................
  124. ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement