<?php

if (!defined('_PS_VERSION_'))
    exit;
class Whthemevars extends Module
{
    public function __construct()
    {
       $this->name = 'whthemevars';
        $this->tab = 'front_office_features';
        $this->version = '1';

        $this->need_instance = '0';
        parent::__construct();
        $this->displayName = $this->l('Theme core module');
        $this->description = $this->l('Theme core module');
        $this->confirmUninstall = $this->l('are you sure ? for work theme , this module should be install, do not uninstall this module');
    }
  
    public  function install()
    {
        if (!parent::install() ||
            !$this->registerHook('DisplayHeader') ||
            !$this->registerHook('DisplayFooter') ||
            !Configuration::updateValue('WPRODUCT_SPECIFIC_PRICESS', 0) ||
            !Configuration::updateValue('WPS_CATALOG_MOODE', 0) ||
            !Configuration::updateValue('WADD_PRODD_DISPLAY', 0) ||
			!Configuration::updateValue('WGETSPAGELINKS', 0)

        )
            return false;
        return true;
    }

    public function uninstall()
    {
        if (!parent::uninstall() ||
            !Configuration::deleteByName('WPRODUCT_SPECIFIC_PRICESS') ||
            !Configuration::deleteByName('WPS_CATALOG_MOODE') ||
            !Configuration::deleteByName('WADD_PRODD_DISPLAY') ||
			!Configuration::deleteByName('WGETSPAGELINKS')

        )
            return false;
        return true;
    }

    public function hookDisplayHeader()
    {
	
        $this->context->smarty->assign(
            array(
                'wproduct_specific_pricess' => Configuration::get('WPRODUCT_SPECIFIC_PRICESS'),
                'wps_catalog_moode' => Configuration::get('WPS_CATALOG_MOODE'),
                'wadd_prodd_display' => Configuration::get('WADD_PRODD_DISPLAY'),
				'wgetspagelinks' => Configuration::get('WGETSPAGELINKS')

            )
        );
    }


}