<?php
class AntadisSimulatorDisplayProductBlocController
{
    /**
     * @var ModuleAdminController
     */
    protected $module;
    
    /**
     * @var Context
     */
    protected $context;
    
    public function __construct($module, $file, $path)
    {
        $this->file = $file;
        $this->module = $module;
        $this->context = Context::getContext();
        $this->_path = $path;
    }
    
    public function run()
    {
        $id_product = (int)Tools::getValue('id_product');
        $simulatorCode = $this->context->smarty->getVariable('simulatorCode');

        if (!empty($simulatorCode)) {
            return $this->module->display($this->file, 'productbloc/'.$simulatorCode.'.tpl');
        }
        
        // Fallback
        return $this->module->display($this->file, 'displayProductBloc.tpl');
    }
}