<?php

class ControllerExtensionThemeOpencartvip extends Controller {
	public function index() {
		if (version_compare(VERSION, '3', '>=')) {
			$this->response->redirect($this->url->link('opencartvip/opencartvip', 'user_token=' . $this->session->data['user_token'], true) . '#/dashboard');
		} else {
			$this->response->redirect($this->url->link('opencartvip/opencartvip', 'token=' . $this->session->data['token'], true) . '#/dashboard');
		}
	}

	public function install() {
		$this->load->model('opencartvip/opencartvip');
		$this->load->model('setting/setting');

		$this->model_opencartvip_opencartvip->install();

		$this->model_setting_setting->editSetting('theme_opencartvip', array(
			'theme_opencartvip_status'    => '1',
		), 0);

		$this->config->set('theme_opencartvip_status', '1');
	}

	public function uninstall() {
		$this->load->model('opencartvip/opencartvip');

		$this->model_opencartvip_opencartvip->uninstall();
	}
}
