<?php
class ControllerModuleAccount extends Controller {
	protected function index() {

		$language = $this->language->load('module/account');
		$this->data = array_merge($this->data, $language);

		$this->load->type('tipocomum');
		$this->data['logged']           = $this->customer->isLogged();
		$this->data['register']         = $this->url->link('account/register', '', 'SSL');
    $this->data['login']         	  = $this->url->link('account/register', '', 'SSL');
		$this->data['logout']           = $this->url->link('account/logout', '', 'SSL');
		$this->data['forgotten']        = $this->url->link('account/forgotten', '', 'SSL');
		$this->data['account']          = $this->url->link('account/account', '', 'SSL');
		$this->data['edit']             = $this->url->link('account/edit', '', 'SSL');
		$this->data['password']         = $this->url->link('account/password', '', 'SSL');
		$this->data['address']          = $this->url->link('account/address', '', 'SSL');
		$this->data['wishlist']         = $this->url->link('account/wishlist');
		$this->data['order']            = $this->url->link('account/order', '', 'SSL');
		$this->data['download']         = $this->url->link('account/download', '', 'SSL');
		$this->data['return']           = $this->url->link('account/return', '', 'SSL');
		$this->data['transaction']      = $this->url->link('account/transaction', '', 'SSL');
		$this->data['newsletter']       = $this->url->link('account/newsletter', '', 'SSL');
		$this->data['recurring']        = $this->url->link('account/recurring', '', 'SSL');
		$this->data['store_rating_url'] = $this->url->link('account/store_rating', '', 'SSL');
		
		$this->data['store_rating_module_status'] = $this->config->get('store_rating_module_status');


		/* COMECO - Habilita e Desabilita Lista de Desejo e Comparação - por Henrique R. Pohl */
		$this->data['futura_habilita_lista_desejos'] 		= (	$this->config->get('wg24_futura_status_lista_desejos') 		== '') || ($this->config->get('wg24_futura_status_lista_desejos') 		== Type_Status::Tp_Habilitado	);
		$this->data['futura_habilita_lista_comparacao'] = (	$this->config->get('wg24_futura_status_lista_comparacao') == '') || ($this->config->get('wg24_futura_status_lista_comparacao') 	== Type_Status::Tp_Habilitado	);
		/* FIM - Habilita e Desabilita Lista de Desejo e Comparação - por Henrique R. Pohl */

        $this->data['fidelity_indication_status'] = $this->config->get('fidelity_status') && $this->config->get('indication_status')
            && ($this->config->get('indication_points') > 0);
        if ($this->data['fidelity_indication_status']){
            $this->data['fidelity_indication_link'] = $this->url->link('fidelity/indication');
        }

		$this->data['customer_interests_remember'] = ($this->config->get('fields_register_brazil_status_interests')) ? true : false;
		$this->data['interests']            = $this->url->link('account/interests', '', 'SSL');
		if($this->config->get('listapresente_status')){
			$this->data['listapresente_status'] = $this->config->get('listapresente_status');
			$this->data['listapresente']        = $this->url->link('listapresente/listapresente');
		}

    if($this->config->get('fidelity_status')){

      $this->data['points'] = $this->customer->getPoints();
      $this->data['link_extract'] = $this->url->link('fidelity/account/extractlist');
//      $this->response->setOutput($this->render('fidelity/account_info'));
    }


		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/account.twig')) {
			$this->template = $this->config->get('config_template') . '/template/module/account.twig';
		} else {
			$this->template = 'default/template/module/account.twig';
		}

		$this->render();
	}
}
