Beispiel #1
0
 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) {
     }
 }
Beispiel #2
0
 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();
 }
Beispiel #3
0
 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) {
     }
 }