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

class ControllerModuleRandom extends ControllerProductProductList
{

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

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

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

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

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


        $this->data['heading_title'] = $heading_title;
        $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['Type_ProductListTitleStyle'] = $this->load->typeForTwig('Type_ProductListTitleStyle');

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

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

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


}
