<?php
$loader = $this->registry->get('load');
$loader->controller('product/productList');

class ControllerModuleProductViewedAll extends ControllerProductProductList {

	public function index($setting=null) {
    $this->language->load('module/product_viewed_all');

        if (isset($setting['hide_title'])) {
            $heading_title = false;
        } else {
            $heading_title = ($this->config->get('product_viewed_all_title')) ? $this->config->get('product_viewed_all_title') : $this->language->get('heading_title');
        }

        $this->data['productListTitle'] = array();

		$this->data['heading_title'] 					= $heading_title;
        $this->data['productbox_size'] = $this->config->get('wg24_productbox_size');
		$this->data['link'] = $this->url->link('product/modules_in_page','&name='.str_replace('.php', '', basename( __FILE__ )),'SSL');
		$this->data['grid']             = (isset($setting['entry_type'])) ? $setting['entry_type'] : 0;
        $this->data['product_list_title_style'] =  $this->config->get('product_list_title_style');

        $this->data['productListTitle'] = array(
            'heading_title' => $heading_title,
            'heading_subtitle' => $this->config->get('product_viewed_all_subtitle') ? $this->config->get('product_viewed_all_subtitle') : '',
            'link' => (isset($this->data['link'])) ? $this->data['link'] : '',
        );

        $this->productlistitle->setProductListTitle($this->data['productListTitle']);

        $this->childrenData = array(
            'product/productList/moduleProductViewedAll' => $setting
        );

        $this->children = array(
            'common/product_list_title',
        );

		$this->render('module/product_viewed_all');
	}

}
