<?php
class ControllerextensionModulereasonstyle extends Controller {
	private $error = array();

	public function index() {
		$this->load->language('extension/module/reasonstyle');

		$this->document->setTitle(preg_replace('/<(.*?)strong>/i', '', $this->language->get('heading_title')));

		$this->load->model('extension/module');

		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
			if (!isset($this->request->get['module_id'])) {
				$this->model_extension_module->addModule('reasonstyle', $this->request->post);
			} else {
				$this->model_extension_module->editModule($this->request->get['module_id'], $this->request->post);
			}

			$this->session->data['success'] = $this->language->get('text_success');

			$this->response->redirect($this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=module', true));
		}

		$data['heading_title'] = preg_replace('/<(.*?)strong>/i', '', $this->language->get('heading_title'));

		$data['text_edit'] = $this->language->get('text_edit');
		$data['text_enabled'] = $this->language->get('text_enabled');
		$data['text_disabled'] = $this->language->get('text_disabled');
		$data['text_qq_open_signup'] = $this->language->get('text_qq_open_signup');
		$data['text_mainc'] = $this->language->get('text_mainc');
		$data['text_mainfw'] = $this->language->get('text_mainfw');
		$data['text_cwkj_wxts'] = $this->language->get('text_cwkj_wxts');
		$data['text_yes'] = $this->language->get('text_yes');
		$data['text_no'] = $this->language->get('text_no');
		
		$data['entry_status'] = $this->language->get('entry_status');
		$data['entry_name'] = $this->language->get('entry_name');
		$data['entry_titlename'] = $this->language->get('entry_titlename');
		$data['entry_bgcolortitle'] = $this->language->get('entry_bgcolortitle');
		$data['entry_bgcolor'] = $this->language->get('entry_bgcolor');
		$data['entry_bgcolorcss'] = $this->language->get('entry_bgcolorcss');
		$data['entry_titlejbcss'] = $this->language->get('entry_titlejbcss');
		$data['entry_titlejbsmcss'] = $this->language->get('entry_titlejbsmcss');
		$data['entry_titlecss'] = $this->language->get('entry_titlecss');
		$data['entry_titlesmcss'] = $this->language->get('entry_titlesmcss');
		$data['entry_describe'] = $this->language->get('entry_describe');
		$data['entry_title'] = $this->language->get('entry_title');
		$data['entry_text'] = $this->language->get('entry_text');
		$data['entry_icon'] = $this->language->get('entry_icon');
		$data['entry_buttonname'] = $this->language->get('entry_buttonname');
		$data['entry_link'] = $this->language->get('entry_link');
		$data['entry_image'] = $this->language->get('entry_image');
		$data['entry_sort_order'] = $this->language->get('entry_sort_order');
		$data['entry_mm'] = $this->language->get('entry_mm');
		$data['entry_mtitle'] = $this->language->get('entry_mtitle');
		$data['entry_mdescribe'] = $this->language->get('entry_mdescribe');
		$data['entry_mbgcolor'] = $this->language->get('entry_mbgcolor');
		$data['entry_mbgcolorjb'] = $this->language->get('entry_mbgcolorjb');
		$data['entry_mpa'] = $this->language->get('entry_mpa');
		$data['entry_boxmagin'] = $this->language->get('entry_boxmagin');
		$data['entry_mborder'] = $this->language->get('entry_mborder');
		$data['entry_mbcolor'] = $this->language->get('entry_mbcolor');
		$data['entry_miconbj'] = $this->language->get('entry_miconbj');
		$data['entry_miconcolor'] = $this->language->get('entry_miconcolor');
		$data['entry_miconround'] = $this->language->get('entry_miconround');
		$data['entry_miconsize'] = $this->language->get('entry_miconsize');
		$data['entry_miconborder'] = $this->language->get('entry_miconborder');
		$data['entry_miconbc'] = $this->language->get('entry_miconbc');
		$data['entry_iconstyle'] = $this->language->get('entry_iconstyle');
		$data['entry_miconwidth'] = $this->language->get('entry_miconwidth');
        $data['entry_miconheight'] = $this->language->get('entry_miconheight');
		$data['entry_rptop'] = $this->language->get('entry_rptop');
        $data['entry_rpbuttom'] = $this->language->get('entry_rpbuttom');
		$data['entry_segmentingline'] = $this->language->get('entry_segmentingline');
		$data['entry_rthreelw'] = $this->language->get('entry_rthreelw');
		$data['entry_rthreelh'] = $this->language->get('entry_rthreelh');
        $data['entry_rthreelc'] = $this->language->get('entry_rthreelc');
		$data['entry_mbgshowd'] = $this->language->get('entry_mbgshowd');
		$data['entry_miconcolorc'] = $this->language->get('entry_miconcolorc');
		$data['entry_hoverbj'] = $this->language->get('entry_hoverbj');
		$data['entry_hovertit'] = $this->language->get('entry_hovertit');
		$data['entry_main'] = $this->language->get('entry_main');
		$data['entry_autoplay'] = $this->language->get('entry_autoplay');
		$data['entry_fade'] = $this->language->get('entry_fade');
		$data['entry_speed'] = $this->language->get('entry_speed');
		$data['entry_mouseafter'] = $this->language->get('entry_mouseafter');
        $data['entry_columns'] = $this->language->get('entry_columns');
        $data['entry_column'] = $this->language->get('entry_column');
		$data['help_column'] = $this->language->get('help_column');		
		$data['entry_rows'] = $this->language->get('entry_rows');
		$data['entry_scroll'] = $this->language->get('entry_scroll');	
        $data['entry_rpbuttom'] = $this->language->get('entry_rpbuttom');
		$data['entry_segmentingline'] = $this->language->get('entry_segmentingline');
		$data['entry_rthreelw'] = $this->language->get('entry_rthreelw');
		$data['entry_rthreelh'] = $this->language->get('entry_rthreelh');
        $data['entry_rthreelc'] = $this->language->get('entry_rthreelc');
		$data['entry_mbottom'] = $this->language->get('entry_mbottom');
		$data['entry_ancolor'] = $this->language->get('entry_ancolor');
		$data['entry_boxbjhover'] = $this->language->get('entry_boxbjhover');
		$data['entry_boxcolorhover'] = $this->language->get('entry_boxcolorhover');
		$data['entry_imgmm'] = $this->language->get('entry_imgmm');
		$data['entry_imground'] = $this->language->get('entry_imground');        
		$data['entry_imgthumb'] = $this->language->get('entry_imgthumb');	
		$data['entry_imgshadow'] = $this->language->get('entry_imgshadow');
		$data['entry_imgpadding'] = $this->language->get('entry_imgpadding');        
		$data['entry_imgborder'] = $this->language->get('entry_imgborder');	
		$data['entry_imgcolor'] = $this->language->get('entry_imgcolor');
		$data['entry_imagewidth'] = $this->language->get('entry_imagewidth');
		$data['entry_imageheight'] = $this->language->get('entry_imageheight');
		$data['entry_sectionid'] = $this->language->get('entry_sectionid');
        $data['entry_sectiontab'] = $this->language->get('entry_sectiontab');	
		
		$data['button_save'] = $this->language->get('button_save');
		$data['button_cancel'] = $this->language->get('button_cancel');
		$data['button_add'] = $this->language->get('button_add');
		$data['button_remove'] = $this->language->get('button_remove');

		$data['error_name'] = $this->language->get('error_name');

		if (isset($this->error['warning'])) {
			$data['error_warning'] = $this->error['warning'];
		} else {
			$data['error_warning'] = '';
		}

		if (isset($this->error['name'])) {
			$data['error_name'] = $this->error['name'];
		} else {
			$data['error_name'] = '';
		}	
		if (isset($this->error['column'])) {
			$data['error_column'] = $this->error['column'];
		} else {
			$data['error_column'] = '';
		}
		if (isset($this->error['sectionid'])) {
			$data['error_sectionid'] = $this->error['sectionid'];
		} else {
			$data['error_sectionid'] = '';
		}		
		$data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL')
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_module'),
			'href' => $this->url->link('extension/extension', 'token=' . $this->session->data['token'], 'SSL')
		);

		$data['breadcrumbs'][] = array(
			'text' => preg_replace('/<(.*?)strong>/i', '', $this->language->get('heading_title')),
			'href' => $this->url->link('extension/module/reasonstyle', 'token=' . $this->session->data['token'], 'SSL')
		);

		if (!isset($this->request->get['module_id'])) {
			$data['action'] = $this->url->link('extension/module/reasonstyle', 'token=' . $this->session->data['token'], 'SSL');
		} else {
			$data['action'] = $this->url->link('extension/module/reasonstyle', 'token=' . $this->session->data['token'] . '&module_id=' . $this->request->get['module_id'], 'SSL');
		}

		$data['cancel'] = $this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=module', true);

		if (isset($this->request->get['module_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
			$module_info = $this->model_extension_module->getModule($this->request->get['module_id']);
		}

		$data['token'] = $this->session->data['token'];

		if (isset($this->request->post['status'])) {
			$data['status'] = $this->request->post['status'];
		} elseif (!empty($module_info)) {
			$data['status'] = $module_info['status'];
		} else {
			$data['status'] = '';
		}

		if (isset($this->request->post['name'])) {
			$data['name'] = $this->request->post['name'];
		} elseif (!empty($module_info)) {
			$data['name'] = $module_info['name'];
		} else {
			$data['name'] = '';
		}
		if (isset($this->request->post['sectionid'])) {
			$data['sectionid'] = $this->request->post['sectionid'];
		} elseif (!empty($module_info)) {
			$data['sectionid'] = $module_info['sectionid'];
		} else {
			$data['sectionid'] = '';
		}
		if (isset($this->request->post['sectiontab'])) {
			$data['sectiontab'] = $this->request->post['sectiontab'];
		} elseif (!empty($module_info)) {
			$data['sectiontab'] = $module_info['sectiontab'];
		} else {
			$data['sectiontab'] = '';
		}
		if (isset($this->request->post['titlename'])) {
			$data['titlename'] = $this->request->post['titlename'];
		} elseif (!empty($module_info)) {
			$data['titlename'] = $module_info['titlename'];
		} else {
			$data['titlename'] = '';
		}
		if (isset($this->request->post['describe'])) {
			$data['describe'] = $this->request->post['name'];
		} elseif (!empty($module_info)) {
			$data['describe'] = $module_info['describe'];
		} else {
			$data['describe'] = '';
		}
		if (isset($this->request->post['boxmagin'])) {
			$data['boxmagin'] = $this->request->post['boxmagin'];
		} elseif (!empty($module_info)) {
			$data['boxmagin'] = $module_info['boxmagin'];
		} else {
			$data['boxmagin'] = '';
		}
		if (isset($this->request->post['bgcolor'])) {
			$data['bgcolor'] = $this->request->post['bgcolor'];
		} elseif (!empty($module_info)) {
			$data['bgcolor'] = $module_info['bgcolor'];
		} else {
			$data['bgcolor'] = '';
		}
		if (isset($this->request->post['bgcolorcss'])) {
			$data['bgcolorcss'] = $this->request->post['bgcolorcss'];
		} elseif (!empty($module_info)) {
			$data['bgcolorcss'] = $module_info['bgcolorcss'];
		} else {
			$data['bgcolorcss'] = '';
		}
		if (isset($this->request->post['titlecss'])) {
			$data['titlecss'] = $this->request->post['titlecss'];
		} elseif (!empty($module_info)) {
			$data['titlecss'] = $module_info['titlecss'];
		} else {
			$data['titlecss'] = '';
		}		
		if (isset($this->request->post['titlesmcss'])) {
			$data['titlesmcss'] = $this->request->post['titlesmcss'];
		} elseif (!empty($module_info)) {
			$data['titlesmcss'] = $module_info['titlesmcss'];
		} else {
			$data['titlesmcss'] = '';
		}	

		if (isset($this->request->post['autoplay'])) {
			$data['autoplay'] = $this->request->post['autoplay'];
		} elseif (!empty($module_info)) {
			$data['autoplay'] = $module_info['autoplay'];
		} else {
			$data['autoplay'] = '';
		}
		if (isset($this->request->post['fade'])) {
			$data['fade'] = $this->request->post['fade'];
		} elseif (!empty($module_info)) {
			$data['fade'] = $module_info['fade'];
		} else {
			$data['fade'] = '';
		}
		if (isset($this->request->post['speed'])) {
			$data['speed'] = $this->request->post['speed'];
		} elseif (!empty($module_info)) {
			$data['speed'] = $module_info['speed'];
		} else {
			$data['speed'] = '3000';
		}
		if (isset($this->request->post['mouseafter'])) {
			$data['mouseafter'] = $this->request->post['mouseafter'];
		} elseif (!empty($module_info)) {
			$data['mouseafter'] = $module_info['mouseafter'];
		} else {
			$data['mouseafter'] = '';
		}
		if (isset($this->request->post['column'])) {
			$data['column'] = $this->request->post['column'];
		} elseif (!empty($module_info)) {
			$data['column'] = $module_info['column'];
		} else {
			$data['column'] = '3';
		}
		if (isset($this->request->post['rows'])) {
			$data['rows'] = $this->request->post['rows'];
		} elseif (!empty($module_info)) {
			$data['rows'] = $module_info['rows'];
		} else {
			$data['rows'] = '2';
		}
		if (isset($this->request->post['scroll'])) {
			$data['scroll'] = $this->request->post['scroll'];
		} elseif (!empty($module_info)) {
			$data['scroll'] = $module_info['scroll'];
		} else {
			$data['scroll'] = '1';
		}				
		if (isset($this->request->post['mtitle'])) {
			$data['mtitle'] = $this->request->post['mtitle'];
		} elseif (!empty($module_info)) {
			$data['mtitle'] = $module_info['mtitle'];
		} else {
			$data['mtitle'] = '';
		}
		if (isset($this->request->post['mdescribe'])) {
			$data['mdescribe'] = $this->request->post['mdescribe'];
		} elseif (!empty($module_info)) {
			$data['mdescribe'] = $module_info['mdescribe'];
		} else {
			$data['mdescribe'] = '';
		}
		if (isset($this->request->post['mbgcolor'])) {
			$data['mbgcolor'] = $this->request->post['mbgcolor'];
		} elseif (!empty($module_info)) {
			$data['mbgcolor'] = $module_info['mbgcolor'];
		} else {
			$data['mbgcolor'] = '';
		}
		if (isset($this->request->post['mbgcolorjb'])) {
			$data['mbgcolorjb'] = $this->request->post['mbgcolorjb'];
		} elseif (!empty($module_info)) {
			$data['mbgcolorjb'] = $module_info['mbgcolorjb'];
		} else {
			$data['mbgcolorjb'] = '';
		}
		if (isset($this->request->post['mpa'])) {
			$data['mpa'] = $this->request->post['mpa'];
		} elseif (!empty($module_info)) {
			$data['mpa'] = $module_info['mpa'];
		} else {
			$data['mpa'] = '';
		}
		if (isset($this->request->post['mborder'])) {
			$data['mborder'] = $this->request->post['mborder'];
		} elseif (!empty($module_info)) {
			$data['mborder'] = $module_info['mborder'];
		} else {
			$data['mborder'] = '';
		}	
		if (isset($this->request->post['mbcolor'])) {
			$data['mbcolor'] = $this->request->post['mbcolor'];
		} elseif (!empty($module_info)) {
			$data['mbcolor'] = $module_info['mbcolor'];
		} else {
			$data['mbcolor'] = '';
		}	
		if (isset($this->request->post['miconbj'])) {
			$data['miconbj'] = $this->request->post['miconbj'];
		} elseif (!empty($module_info)) {
			$data['miconbj'] = $module_info['miconbj'];
		} else {
			$data['miconbj'] = '';
		}	
		if (isset($this->request->post['miconcolor'])) {
			$data['miconcolor'] = $this->request->post['miconcolor'];
		} elseif (!empty($module_info)) {
			$data['miconcolor'] = $module_info['miconcolor'];
		} else {
			$data['miconcolor'] = '';
		}
		if (isset($this->request->post['miconround'])) {
			$data['miconround'] = $this->request->post['miconround'];
		} elseif (!empty($module_info)) {
			$data['miconround'] = $module_info['miconround'];
		} else {
			$data['miconround'] = '';
		}
		if (isset($this->request->post['miconsize'])) {
			$data['miconsize'] = $this->request->post['miconsize'];
		} elseif (!empty($module_info)) {
			$data['miconsize'] = $module_info['miconsize'];
		} else {
			$data['miconsize'] = '18';
		}	
		if (isset($this->request->post['miconborder'])) {
			$data['miconborder'] = $this->request->post['miconborder'];
		} elseif (!empty($module_info)) {
			$data['miconborder'] = $module_info['miconborder'];
		} else {
			$data['miconborder'] = '';
		}
		if (isset($this->request->post['miconbc'])) {
			$data['miconbc'] = $this->request->post['miconbc'];
		} elseif (!empty($module_info)) {
			$data['miconbc'] = $module_info['miconbc'];
		} else {
			$data['miconbc'] = '';
		}	
		if (isset($this->request->post['miconwidth'])) {
			$data['miconwidth'] = $this->request->post['miconwidth'];
		} elseif (!empty($module_info)) {
			$data['miconwidth'] = $module_info['miconwidth'];
		} else {
			$data['miconwidth'] = '50';
		}
		if (isset($this->request->post['miconheight'])) {
			$data['miconheight'] = $this->request->post['miconheight'];
		} elseif (!empty($module_info)) {
			$data['miconheight'] = $module_info['miconheight'];
		} else {
			$data['miconheight'] = '50';
		}
		if (isset($this->request->post['rptop'])) {
			$data['rptop'] = $this->request->post['rptop'];
		} elseif (!empty($module_info)) {
			$data['rptop'] = $module_info['rptop'];
		} else {
			$data['rptop'] = '70';
		}
		if (isset($this->request->post['rpbuttom'])) {
			$data['rpbuttom'] = $this->request->post['rpbuttom'];
		} elseif (!empty($module_info)) {
			$data['rpbuttom'] = $module_info['rpbuttom'];
		} else {
			$data['rpbuttom'] = '70';
		}
		if (isset($this->request->post['rthreelw'])) {
			$data['rthreelw'] = $this->request->post['rthreelw'];
		} elseif (!empty($module_info)) {
			$data['rthreelw'] = $module_info['rthreelw'];
		} else {
			$data['rthreelw'] = '';
		}	
		if (isset($this->request->post['rthreelh'])) {
			$data['rthreelh'] = $this->request->post['rthreelh'];
		} elseif (!empty($module_info)) {
			$data['rthreelh'] = $module_info['rthreelh'];
		} else {
			$data['rthreelh'] = '';
		}
		if (isset($this->request->post['rthreelc'])) {
			$data['rthreelc'] = $this->request->post['rthreelc'];
		} elseif (!empty($module_info)) {
			$data['rthreelc'] = $module_info['rthreelc'];
		} else {
			$data['rthreelc'] = '';
		}
		if (isset($this->request->post['mbgshowd'])) {
			$data['mbgshowd'] = $this->request->post['mbgshowd'];
		} elseif (!empty($module_info)) {
			$data['mbgshowd'] = $module_info['mbgshowd'];
		} else {
			$data['mbgshowd'] = '';
		}
		if (isset($this->request->post['miconcolorc'])) {
			$data['miconcolorc'] = $this->request->post['miconcolorc'];
		} elseif (!empty($module_info)) {
			$data['miconcolorc'] = $module_info['miconcolorc'];
		} else {
			$data['miconcolorc'] = '';
		}	
		if (isset($this->request->post['hoverbj'])) {
			$data['hoverbj'] = $this->request->post['hoverbj'];
		} elseif (!empty($module_info)) {
			$data['hoverbj'] = $module_info['hoverbj'];
		} else {
			$data['hoverbj'] = '';
		}
		if (isset($this->request->post['hovertit'])) {
			$data['hovertit'] = $this->request->post['hovertit'];
		} elseif (!empty($module_info)) {
			$data['hovertit'] = $module_info['hovertit'];
		} else {
			$data['hovertit'] = '';
		}
		if (isset($this->request->post['main'])) {
			$data['main'] = $this->request->post['main'];
		} elseif (!empty($module_info)) {
			$data['main'] = $module_info['main'];
		} else {
			$data['main'] = '';
		}
		if (isset($this->request->post['mbottom'])) {
			$data['mbottom'] = $this->request->post['mbottom'];
		} elseif (!empty($module_info)) {
			$data['mbottom'] = $module_info['mbottom'];
		} else {
			$data['mbottom'] = '';
		}
		if (isset($this->request->post['ancolor'])) {
			$data['ancolor'] = $this->request->post['ancolor'];
		} elseif (!empty($module_info)) {
			$data['ancolor'] = $module_info['ancolor'];
		} else {
			$data['ancolor'] = '';
		}	
		if (isset($this->request->post['boxbjhover'])) {
			$data['boxbjhover'] = $this->request->post['boxbjhover'];
		} elseif (!empty($module_info)) {
			$data['boxbjhover'] = $module_info['boxbjhover'];
		} else {
			$data['boxbjhover'] = '';
		}
		if (isset($this->request->post['boxcolorhover'])) {
			$data['boxcolorhover'] = $this->request->post['boxcolorhover'];
		} elseif (!empty($module_info)) {
			$data['boxcolorhover'] = $module_info['boxcolorhover'];
		} else {
			$data['boxcolorhover'] = '';
		}
		if (isset($this->request->post['imground'])) {
			$data['imground'] = $this->request->post['imground'];
		} elseif (!empty($module_info)) {
			$data['imground'] = $module_info['imground'];
		} else {
			$data['imground'] = '';
		}
		if (isset($this->request->post['imgthumb'])) {
			$data['imgthumb'] = $this->request->post['imgthumb'];
		} elseif (!empty($module_info)) {
			$data['imgthumb'] = $module_info['imgthumb'];
		} else {
			$data['imgthumb'] = 'img-thumbnail';
		}
		if (isset($this->request->post['imgshadow'])) {
			$data['imgshadow'] = $this->request->post['imgshadow'];
		} elseif (!empty($module_info)) {
			$data['imgshadow'] = $module_info['imgshadow'];
		} else {
			$data['imgshadow'] = '';
		}
		if (isset($this->request->post['imgpadding'])) {
			$data['imgpadding'] = $this->request->post['imgpadding'];
		} elseif (!empty($module_info)) {
			$data['imgpadding'] = $module_info['imgpadding'];
		} else {
			$data['imgpadding'] = '';
		}
		if (isset($this->request->post['imgborder'])) {
			$data['imgborder'] = $this->request->post['imgborder'];
		} elseif (!empty($module_info)) {
			$data['imgborder'] = $module_info['imgborder'];
		} else {
			$data['imgborder'] = '';
		}
		if (isset($this->request->post['imgcolor'])) {
			$data['imgcolor'] = $this->request->post['imgcolor'];
		} elseif (!empty($module_info)) {
			$data['imgcolor'] = $module_info['imgcolor'];
		} else {
			$data['imgcolor'] = '';
		}
		if (isset($this->request->post['imagewidth'])) {
			$data['imagewidth'] = $this->request->post['imagewidth'];
		} elseif (!empty($module_info)) {
			$data['imagewidth'] = $module_info['imagewidth'];
		} else {
			$data['imagewidth'] = '60';
		}
		if (isset($this->request->post['imageheight'])) {
			$data['imageheight'] = $this->request->post['imageheight'];
		} elseif (!empty($module_info)) {
			$data['imageheight'] = $module_info['imageheight'];
		} else {
			$data['imageheight'] = '60';
		}				
		$this->load->model('localisation/language');

		$data['languages'] = $this->model_localisation_language->getLanguages();

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

		if (isset($this->request->post['service'])) {
			$services = $this->request->post['service'];
		} elseif (isset($module_info['service'])) {
			$services = $module_info['service'];
		} else {
			$services = array();
		}

		$data['services'] = array();

		foreach ($services as $service) {
			if (is_file(DIR_IMAGE . $service['image'])) {
				$image = $service['image'];
				$thumb = $service['image'];
			} else {
				$image = '';
				$thumb = 'no_image.png';
			}

			$data['services'][] = array(
				'title'       => $service['title'],
				'text'        => $service['text'],
				'icon'        => $service['icon'],
				'buttonname'  => $service['buttonname'],
				'link'        => $service['link'],
				'image'       => $image,
				'thumb'       => $this->model_tool_image->resize($thumb, 40, 40),
				'sort_order'  => $service['sort_order']
			);
		}

		$data['placeholder'] = $this->model_tool_image->resize('no_image.png', 50, 50);

		$data['header'] = $this->load->controller('common/header');
		$data['column_left'] = $this->load->controller('common/column_left');
		$data['footer'] = $this->load->controller('common/footer');

		$this->response->setOutput($this->load->view('extension/module/reasonstyle.tpl', $data));
	}

	protected function validate() {
		if (!$this->user->hasPermission('modify', 'extension/module/reasonstyle')) {
			$this->error['warning'] = $this->language->get('error_permission');
		}
		if ((utf8_strlen($this->request->post['sectionid']) < 1) || (utf8_strlen($this->request->post['sectionid']) > 64)) {
			$this->error['sectionid'] = $this->language->get('error_name');
		}
		if ((utf8_strlen($this->request->post['name']) < 2) || (utf8_strlen($this->request->post['name']) > 64)) {
			$this->error['name'] = $this->language->get('error_name');
		}
		return !$this->error;
	}
}