<?php
class ControllerextensionModuleAlerts extends Controller {
	public function index($setting) {
		$data['dbgcolor'] = $setting['dbgcolor'];
		$data['dbgcolorj'] = $setting['dbgcolorj'];
		$data['dpposition'] = $setting['dpposition'];
		$data['tcolor'] = $setting['tcolor'];
		$data['ttpadding'] = $setting['ttpadding'];
		$data['tbpadding'] = $setting['tbpadding'];
		$data['buttoncolor1'] = $setting['buttoncolor1'];
		$data['buttoncolor2'] = $setting['buttoncolor2'];
		$data['buttonsize'] = $setting['buttonsize'];
		$data['buttoninset'] = $setting['buttoninset'];	       
        $data['buttonborder'] = $setting['buttonborder'];
        $data['buttonround'] = $setting['buttonround'];	
        $data['buttonhover'] = $setting['buttonhover'];
        $data['buttond'] = $setting['buttond'];	
		$data['icons1'] = $setting['icons1'];
		$data['icons2'] = $setting['icons2'];
		static $module = 0;

		$this->load->model('tool/image');

		if (is_file(DIR_IMAGE . $setting['image'])) {
			$image = $setting['image'];
		} else {
			$image = 'placeholder.png';
		}

		$data['image'] = $this->model_tool_image->resize($image, $setting['width'], $setting['height']);

		$data['title'] = $setting['title'];
		$data['section1'] = $setting['section1'];
		$data['buttonname1'] = $setting['buttonname1'];
		$data['link1'] = $setting['link1'];
		$data['buttonname2'] = $setting['buttonname2'];
		$data['link2'] = $setting['link2'];

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . 'extension/module/Alerts.tpl')) {
			return $this->load->view($this->config->get('config_template') . 'extension/module/Alerts.tpl', $data);
		} else {
			return $this->load->view('extension/module/Alerts.tpl', $data);
		}
	}
}