shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

laybuy_layout.php (2628B)


      1 <?php
      2 class ControllerExtensionModuleLaybuyLayout extends Controller {
      3 	private $error = array();
      4 
      5 	public function index() {
      6 		$this->load->model('setting/setting');
      7 
      8 		$this->load->language('extension/module/laybuy_layout');
      9 
     10 		$this->document->setTitle($this->language->get('heading_title'));
     11 
     12 		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
     13 			$this->model_setting_setting->editSetting('module_laybuy_layout', $this->request->post);
     14 
     15 			$this->session->data['success'] = $this->language->get('text_success');
     16 
     17 			$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module', true));
     18 		}
     19 
     20 		$data['breadcrumbs'] = array();
     21 
     22 		$data['breadcrumbs'][] = array(
     23 			'text' => $this->language->get('text_home'),
     24 			'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
     25 		);
     26 
     27 		$data['breadcrumbs'][] = array(
     28 			'text' => $this->language->get('text_extension'),
     29 			'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module', true)
     30 		);
     31 
     32 		$data['breadcrumbs'][] = array(
     33 			'text' => $this->language->get('heading_title'),
     34 			'href' => $this->url->link('extension/module/laybuy_layout', 'user_token=' . $this->session->data['user_token'], true)
     35 		);
     36 
     37 		if (isset($this->error['warning'])) {
     38 			$data['error_warning'] = $this->error['warning'];
     39 		} else {
     40 			$data['error_warning'] = '';
     41 		}
     42 
     43 		$data['action'] = $this->url->link('extension/module/laybuy_layout', 'user_token=' . $this->session->data['user_token'], true);
     44 
     45 		$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module', true);
     46 
     47 		if (isset($this->request->post['module_laybuy_layout_status'])) {
     48 			$data['module_laybuy_layout_status'] = $this->request->post['module_laybuy_layout_status'];
     49 		} else {
     50 			$data['module_laybuy_layout_status'] = $this->config->get('module_laybuy_layout_status');
     51 		}
     52 
     53 		$data['header'] = $this->load->controller('common/header');
     54 		$data['column_left'] = $this->load->controller('common/column_left');
     55 		$data['footer'] = $this->load->controller('common/footer');
     56 
     57 		$this->response->setOutput($this->load->view('extension/module/laybuy_layout', $data));
     58 	}
     59 
     60 	protected function validate() {
     61 		if (!$this->user->hasPermission('modify', 'extension/module/laybuy_layout')) {
     62 			$this->error['warning'] = $this->language->get('error_permission');
     63 		}
     64 
     65 		return !$this->error;
     66 	}
     67 }