private static function updateJavaScript() { try { $params = self::get_params(); $userId = $params['user_id']; $apiKey = $params['api_key']; $client = new Giftd_Client($userId, $apiKey); $result = $client->query('partner/getJs'); $code = isset($result['data']['js']) ? $result['data']['js'] : null; if ($code) { $file = GIFTD_PLUGIN_DIR . 'assets/js/giftd.js'; file_put_contents($file, $code); } } catch (Exception $e) { } }
public function uninstall() { require_once DIR_SYSTEM . 'GiftdApiClient.php'; if ($this->config->get('giftd_user_id') && $this->config->get('giftd_api_key')) { $client = new Giftd_Client($this->config->get('giftd_user_id'), $this->config->get('giftd_api_key')); $result = $client->query("openCart/uninstall"); } $this->load->model('module/giftd'); $this->model_module_giftd->uninstall(); }
private function updateJavaScript() { try { $userId = $this->params->get('user_id', ''); $apiKey = $this->params->get('api_key', ''); $client = new Giftd_Client($userId, $apiKey); $result = $client->query('partner/getJs'); $code = isset($result['data']['js']) ? $result['data']['js'] : null; if ($code) { $file = JPATH_ROOT . '/plugins/system/giftd/assets/js/giftd.js'; JFile::write($file, $code); } } catch (Exception $e) { } }